-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Added cybro-lpmanager #17170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
0xMBro
wants to merge
16
commits into
DefiLlama:main
Choose a base branch
from
0xMBro:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added cybro-lpmanager #17170
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5f7732f
added dex tvl to projects/cybro
0xMBro e15c313
updated addresses
0xMBro 3db239c
minor fix
g1nt0ki e38423c
added arbitrum vaults
0xMBro 7cc04af
Merge branch 'main' into main
0xMBro 2bb20f1
fixed errors
0xMBro 7aa652d
Merge branch 'DefiLlama:main' into main
0xMBro 3169fd8
added base vaults tvl to cybro
0xMBro ddcce8b
added vault address
0xMBro e4b2ea2
merged main
0xMBro 66402ee
added bsc network and updated vaults addresses
0xMBro c76db02
Merge branch 'DefiLlama:main' into main
0xMBro df5f343
added addresses to arbitrum & base vaults
0xMBro 4a2063e
Merge branch 'DefiLlama:main' into main
0xMBro aef1090
added cybro-lpmanager
0xMBro c8b09ca
updated
0xMBro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| const axios = require('axios'); | ||
|
|
||
| const API_ENDPOINT = 'https://v2-api.cybro.io/api/v1/dashboard/aum'; | ||
|
|
||
| const chainIdMap = { | ||
| arbitrum: 42161, | ||
| base: 8453, | ||
| unichain: 130, | ||
| }; | ||
|
|
||
| const config = { | ||
| arbitrum: { | ||
| lpManager: '0x0964B7A10631f2139dcf2e0aa1b621F97a19e998', | ||
| }, | ||
| base: { | ||
| lpManager: '0xB3dA213b0005dF568A222876e5F5DB61C985936F', | ||
| }, | ||
| unichain: { | ||
| lpManager: '0x7aD4e1e8FAe276B9debb40340Dc65d6A2274189B', | ||
| }, | ||
| }; | ||
|
|
||
| async function fetchAUM(chain) { | ||
| const chainId = chainIdMap[chain]; | ||
| const response = await axios.get(API_ENDPOINT, { params: { chain_id: chainId } }); | ||
| return response.data.aum_usd || 0; | ||
| } | ||
|
|
||
| module.exports = { | ||
| doublecounted: false, | ||
| }; | ||
|
|
||
| Object.keys(config).forEach(chain => { | ||
| module.exports[chain] = { | ||
| tvl: async () => { | ||
| const aum = await fetchAUM(chain); | ||
| return { [chain]: aum }; | ||
| } | ||
| }; | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please count token balances on chain rather than returning a USD value from an API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't calculate this metric on-chain, cause our LPManager contract doesn't hold any state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are the tokens that are AUM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AUM represents the total value of all active liquidity positions that were managed through Cybro’s LPManager smart contract, so the tokens are in uniswap liquidity pools