Skip to content

Commit 3eb0929

Browse files
committed
track elys DefiLlama#12731
1 parent 93f39f8 commit 3eb0929

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

projects/elys-dex/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { get } = require('../helper/http')
2+
const { sumTokens2 } = require('../helper/unwrapLPs')
3+
4+
async function tvl(api) {
5+
let key = ''
6+
const pools = []
7+
do {
8+
const { pagination: { next_key }, pool } = await get('https://api.elys.network/elys-network/elys/amm/pool?pagination.count_total=true&pagination.per_page=1000&pagination.key=' + key)
9+
key = next_key
10+
pools.push(...pool)
11+
} while (key)
12+
pools.forEach(pool => {
13+
pool.pool_assets.forEach(({ token: { denom, amount } }) => api.add(denom, amount))
14+
})
15+
16+
return sumTokens2({ api })
17+
}
18+
19+
20+
module.exports = {
21+
elys: { tvl, }
22+
}

projects/helper/chain/cosmos.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const endPoints = {
4545
joltify: "https://lcd.joltify.io",
4646
kopi: "https://rest.kopi.money",
4747
noble: "https://noble-api.polkachu.com",
48+
elys: "https://api.elys.network", // https://api.elys.network/#/Query/ElysAmmPoolAll
4849
};
4950

5051
const chainSubpaths = {

projects/helper/chains.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"elastos",
104104
"elrond",
105105
"elsm",
106+
"elys",
106107
"empire",
107108
"energi",
108109
"energyweb",

projects/helper/tokenMapping.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ coreAssets = JSON.parse(JSON.stringify(coreAssets))
1919

2020

2121
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',
22-
'kopi',
22+
'kopi', 'elys',
2323

2424
]
2525
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',
@@ -41,6 +41,7 @@ const ibcMappings = {
4141
'ibc:DE63D8AC34B752FB7D4CAA7594145EDE1C9FC256AC6D4043D0F12310EB8FC255': { coingeckoId: 'injective-protocol', decimals: 18, },
4242
'ibc:25418646C017D377ADF3202FF1E43590D0DAE3346E594E8D78176A139A928F88': { coingeckoId: 'cosmos', decimals: 6, },
4343
'ibc:D8A36AE90F20FE4843A8D249B1BCF0CCDDE35C4B605C8DED57BED20C639162D0': { coingeckoId: 'tether', decimals: 6, },
44+
'ibc:45D6B52CAD911A15BD9C2F5FFDA80E26AFCB05C7CD520070790ABC86D2B24229': { coingeckoId: 'celestia', decimals: 6, },
4445
}
4546

4647
const fixBalancesTokens = {
@@ -75,6 +76,9 @@ const fixBalancesTokens = {
7576
"0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2": { "coingeckoId": "ethena-staked-usde", "decimals": 18 },
7677
"0x58538e6A46E07434d7E7375Bc268D3cb839C0133": { "coingeckoId": "ethena", "decimals": 18 },
7778
},
79+
elys: {
80+
'uelys': { coingeckoId: 'elys-network', decimals: 6 },
81+
},
7882
}
7983

8084
ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })

0 commit comments

Comments
 (0)