-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # projects/helper/chain/cosmos.js # projects/helper/tokenMapping.js
- Loading branch information
Showing
148 changed files
with
2,550 additions
and
387 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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,12 @@ | ||
const { getUniTVL } = require('../helper/unknownTokens') | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
methodology: "Factory addresses (0x3a0Fa7884dD93f3cd234bBE2A0958Ef04b05E13b for PulseChain) is used to find the LP pairs. TVL is equal to the liquidity on the AMM.", | ||
pulse: { | ||
tvl: getUniTVL({ | ||
factory: '0x3a0Fa7884dD93f3cd234bBE2A0958Ef04b05E13b', | ||
useDefaultCoreAssets: true, | ||
}), | ||
}, | ||
} |
This file contains 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,6 @@ | ||
const { uniV3Export } = require('../helper/uniswapV3') | ||
|
||
module.exports = uniV3Export({ | ||
pulse: { factory: '0xe50dbdc88e87a2c92984d794bcf3d1d76f619c68', fromBlock: 18942139, } , | ||
base: { factory: '0x7b72C4002EA7c276dd717B96b20f4956c5C904E7', fromBlock: 15754625, } | ||
}) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,58 @@ | ||
const { post } = require('../helper/http') | ||
|
||
const query = ` | ||
query { | ||
vaultManagerMetrics { | ||
nodes { | ||
liquidatingCollateralBrand | ||
totalCollateral | ||
} | ||
} | ||
oraclePrices { | ||
nodes { | ||
typeInAmount | ||
typeOutAmount | ||
typeInName | ||
} | ||
} | ||
boardAuxes { | ||
nodes { | ||
allegedName | ||
decimalPlaces | ||
} | ||
} | ||
} | ||
` | ||
|
||
const coingeckoMapping = { | ||
'stATOM': 'stride-staked-atom', | ||
'stkATOM': 'stkatom', | ||
'ATOM': 'cosmos', | ||
'stOSMO': 'stride-staked-osmo', | ||
'stTIA': 'stride-staked-tia', | ||
} | ||
const decimals = {} | ||
|
||
const tvl = async (api) => { | ||
const { data: { vaultManagerMetrics, boardAuxes } } = await post('https://api.subquery.network/sq/agoric-labs/agoric-mainnet-v2', { query }) | ||
|
||
boardAuxes.nodes.forEach(board => { | ||
decimals[board.allegedName] = 10 ** board.decimalPlaces | ||
}) | ||
|
||
vaultManagerMetrics.nodes.forEach(vault => { | ||
const key = vault.liquidatingCollateralBrand | ||
if (!coingeckoMapping[key]) { | ||
throw new Error(`Unknown coin ${key} (coingecko mapping is missing)`) | ||
} | ||
const decimal = decimals[key] ?? 1e6 | ||
const balance = vault.totalCollateral / decimal | ||
api.addCGToken(coingeckoMapping[key], balance) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
agoric: { | ||
tvl, | ||
}, | ||
} |
This file contains 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
This file contains 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,25 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json'); | ||
const { staking } = require("../helper/staking"); | ||
|
||
// Token addresses | ||
const AIXCB_TOKEN = "0x76C71F1703Fbf19FFdcF3051E1e684Cb9934510f"; | ||
const WETH = ADDRESSES.base.WETH; | ||
|
||
// LP and staking addresses | ||
const AERODROME_LP_TOKEN = "0x19C3c7EEfb070EE00ddE367A9768De1DF52cbE5d"; | ||
const LP_STAKING = "0xEE5C223aD4055beE465244d8Cb344fb22DaDa570"; | ||
const AIXCB_STAKING = "0xF5acA5c3a0B70f847dE4652AC77BD601ccFE8339"; | ||
|
||
async function stakingTvl(api) { | ||
const totalStaked = await api.call({ abi: 'uint256:getTotalStaked', target: AIXCB_STAKING, }); | ||
api.add(AIXCB_TOKEN, totalStaked); | ||
} | ||
|
||
module.exports = { | ||
methodology: 'TVL consists of aixCB tokens staked in the AIXCBStaking contract (getTotalStaked) and Aerodrome vAMM-aixCB/WETH LP tokens staked in the AIXCBLPStaking contract (totalStakedAmount).', | ||
base: { | ||
tvl: () => ({}), | ||
staking: stakingTvl, | ||
pool2: staking(LP_STAKING, AERODROME_LP_TOKEN), | ||
}, | ||
}; |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.