mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-04-29 13:25:30 +08:00
track mantra amm #12972
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
"biggest-files": "find ./projects -name '*.js' -not -path './projects/helper/*' -not -path './projects/curve/*' -not -path './projects/sigmao/*' -exec du -sh {} \\; | sort -rh | head -n 100",
|
||||
"check-bitcoin-duplicates": "node utils/scripts/checkBTCDupsv2.js",
|
||||
"string-timestamp": "node utils/scripts/stringTimestamp.js",
|
||||
"sort-chains": "node projects/helper/getChainList.js",
|
||||
"postinstall": "echo 'run \"npm update @defillama/sdk\" if you want lastest sdk changes' "
|
||||
},
|
||||
"author": "",
|
||||
|
||||
@@ -45,6 +45,7 @@ const endPoints = {
|
||||
joltify: "https://lcd.joltify.io",
|
||||
kopi: "https://rest.kopi.money",
|
||||
noble: "https://noble-api.polkachu.com",
|
||||
mantra: "https://api.mantrachain.io",
|
||||
elys: "https://api.elys.network", // https://api.elys.network/#/Query/ElysAmmPoolAll
|
||||
pryzm: "https://api.pryzm.zone"
|
||||
};
|
||||
@@ -313,7 +314,7 @@ async function sumTokens({ balances, owners = [], chain, owner, tokens, blacklis
|
||||
.for(owners)
|
||||
.process(async (owner, i) => {
|
||||
await getBalance2({ balances, owner, chain, tokens, blacklistedTokens, api, })
|
||||
if (chain === 'osmosis' && owners.length > 100)
|
||||
if (chain === 'osmosis' && owners.length > 100)
|
||||
await sleep(3000)
|
||||
});
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
"alephium",
|
||||
"algorand",
|
||||
"alv",
|
||||
"ancient8",
|
||||
"apechain",
|
||||
"aptos",
|
||||
"arbitrum",
|
||||
"arbitrum_nova",
|
||||
"assetchain",
|
||||
"ancient8",
|
||||
"archway",
|
||||
"area",
|
||||
"apechain",
|
||||
"assetchain",
|
||||
"astar",
|
||||
"astrzk",
|
||||
"aura",
|
||||
@@ -34,10 +34,10 @@
|
||||
"bitcoincash",
|
||||
"bitgert",
|
||||
"bitindi",
|
||||
"bitkub",
|
||||
"bitrock",
|
||||
"bittensor",
|
||||
"bittorrent",
|
||||
"bitkub",
|
||||
"blast",
|
||||
"bob",
|
||||
"boba",
|
||||
@@ -49,8 +49,8 @@
|
||||
"bouncebit",
|
||||
"bsc",
|
||||
"bsquared",
|
||||
"btr",
|
||||
"btn",
|
||||
"btr",
|
||||
"bytomsidechain",
|
||||
"callisto",
|
||||
"candle",
|
||||
@@ -90,8 +90,8 @@
|
||||
"degen",
|
||||
"dexalot",
|
||||
"dexit",
|
||||
"dfs",
|
||||
"dfk",
|
||||
"dfs",
|
||||
"doge",
|
||||
"dogechain",
|
||||
"dsc",
|
||||
@@ -115,11 +115,11 @@
|
||||
"equilibrium",
|
||||
"era",
|
||||
"ergo",
|
||||
"etlk",
|
||||
"ethereum",
|
||||
"ethereumclassic",
|
||||
"ethf",
|
||||
"ethpow",
|
||||
"etlk",
|
||||
"etn",
|
||||
"europa",
|
||||
"everscale",
|
||||
@@ -133,8 +133,8 @@
|
||||
"fraxtal",
|
||||
"fsc",
|
||||
"ftn",
|
||||
"functionx",
|
||||
"fuel",
|
||||
"functionx",
|
||||
"fuse",
|
||||
"fusion",
|
||||
"genesys",
|
||||
@@ -146,8 +146,8 @@
|
||||
"gravity",
|
||||
"gravitybridge",
|
||||
"grove",
|
||||
"harmony",
|
||||
"ham",
|
||||
"harmony",
|
||||
"heco",
|
||||
"hedera",
|
||||
"heiko",
|
||||
@@ -199,10 +199,11 @@
|
||||
"lukso",
|
||||
"lung",
|
||||
"manta",
|
||||
"massa",
|
||||
"manta_atlantic",
|
||||
"mantle",
|
||||
"mantra",
|
||||
"map",
|
||||
"massa",
|
||||
"matchain",
|
||||
"mayachain",
|
||||
"meer",
|
||||
@@ -278,8 +279,8 @@
|
||||
"quicksilver",
|
||||
"radixdlt",
|
||||
"rari",
|
||||
"real",
|
||||
"rbn",
|
||||
"real",
|
||||
"reef",
|
||||
"regen",
|
||||
"rei",
|
||||
@@ -312,7 +313,6 @@
|
||||
"sonic",
|
||||
"sophon",
|
||||
"sora",
|
||||
"swellchain",
|
||||
"stacks",
|
||||
"stafi",
|
||||
"staking",
|
||||
@@ -324,6 +324,7 @@
|
||||
"stride",
|
||||
"sui",
|
||||
"svm",
|
||||
"swellchain",
|
||||
"sx",
|
||||
"syscoin",
|
||||
"taiko",
|
||||
@@ -365,6 +366,7 @@
|
||||
"xdc",
|
||||
"xlayer",
|
||||
"xpla",
|
||||
"xsat",
|
||||
"zeniq",
|
||||
"zeta",
|
||||
"zilliqa",
|
||||
@@ -374,6 +376,5 @@
|
||||
"zklink",
|
||||
"zksync",
|
||||
"zora",
|
||||
"zyx",
|
||||
"xsat"
|
||||
]
|
||||
"zyx"
|
||||
]
|
||||
@@ -19,7 +19,7 @@ coreAssets = JSON.parse(JSON.stringify(coreAssets))
|
||||
|
||||
|
||||
const ibcChains = ['ibc', 'terra', 'terra2', 'crescent', 'osmosis', 'kujira', 'stargaze', 'juno', 'injective', 'cosmos', 'comdex', 'umee', 'orai', 'persistence', 'fxcore', 'neutron', 'quasar', 'chihuahua', 'sei', 'archway', 'migaloo', 'secret', 'aura', 'xpla', 'bostrom', 'joltify', 'nibiru',
|
||||
'kopi', 'elys', "pryzm"
|
||||
'kopi', 'elys', "pryzm", "mantra",
|
||||
|
||||
]
|
||||
const caseSensitiveChains = [...ibcChains, 'solana', 'tezos', 'ton', 'algorand', 'aptos', 'near', 'bitcoin', 'waves', 'tron', 'litecoin', 'polkadot', 'ripple', 'elrond', 'cardano', 'stacks', 'sui', 'ergo', 'mvc', 'renec', 'doge', 'stellar', 'massa',
|
||||
@@ -92,6 +92,9 @@ const fixBalancesTokens = {
|
||||
crossfi: {
|
||||
[ADDRESSES.null]: { coingeckoId: 'crossfi-2', decimals: 18 },
|
||||
[ADDRESSES.crossfi.WXFI]: { coingeckoId: 'crossfi-2', decimals: 18 },
|
||||
},
|
||||
mantra: {
|
||||
uom: { coingeckoId: 'mantra-dao', decimals: 6 },
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
36
projects/mantra-amm/index.js
Normal file
36
projects/mantra-amm/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const { queryContract } = require("../helper/chain/cosmos");
|
||||
|
||||
const chain = 'mantra'
|
||||
const mantraPoolManager = 'mantra1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjqagspfm'
|
||||
|
||||
/**
|
||||
* Get all pools in the DEX
|
||||
* @returns {Promise<Array<{pool_info: {pool_identifier: string, asset_denoms: string[], lp_denom: string, asset_decimals: number[], assets: Array<{denom: string, amount: string}>}, total_share: {denom: string, amount: string}}>>}
|
||||
*/
|
||||
async function getDexPools() {
|
||||
const response = await queryContract({
|
||||
chain,
|
||||
contract: mantraPoolManager,
|
||||
data: {
|
||||
pools: {}
|
||||
}
|
||||
})
|
||||
return response.pools
|
||||
}
|
||||
|
||||
async function tvl(api) {
|
||||
const allPools = await getDexPools()
|
||||
allPools.forEach(pool => {
|
||||
pool.pool_info.assets.forEach(asset => {
|
||||
api.add(asset.denom, asset.amount)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
timetravel: false,
|
||||
methodology: "Counts the liquidity on MANTRA Chain AMM pools",
|
||||
mantra: {
|
||||
tvl
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user