mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 22:43:12 +08:00
[crown-finance] bugfix
This commit is contained in:
@@ -31,7 +31,7 @@ async function getAllTVL(block) {
|
|||||||
for (let i = 0; i < length; i++) calls.push({ params: [i] })
|
for (let i = 0; i < length; i++) calls.push({ params: [i] })
|
||||||
const { output: data } = await sdk.api.abi.multiCall({
|
const { output: data } = await sdk.api.abi.multiCall({
|
||||||
target: contract,
|
target: contract,
|
||||||
abi: abi.poolInfo2,
|
abi: abi.poolInfo2,
|
||||||
calls,
|
calls,
|
||||||
chain, block,
|
chain, block,
|
||||||
})
|
})
|
||||||
@@ -42,14 +42,14 @@ async function getAllTVL(block) {
|
|||||||
data.forEach(({ output }) => {
|
data.forEach(({ output }) => {
|
||||||
const token = output.lpToken.toLowerCase()
|
const token = output.lpToken.toLowerCase()
|
||||||
const amount = output.amount0
|
const amount = output.amount0
|
||||||
if (token === crown) balances.staking[transform(token)] = amount
|
if (token === crown) sdk.util.sumSingleBalance(balances.staking, transform(token), amount)
|
||||||
else tempBalances[token] = amount
|
else sdk.util.sumSingleBalance(tempBalances, token, amount)
|
||||||
lps.push(token)
|
lps.push(token)
|
||||||
})
|
})
|
||||||
|
|
||||||
const pairs = await getLPData({ lps, chain, block })
|
const pairs = await getLPData({ lps, chain, block })
|
||||||
|
|
||||||
const { updateBalances, prices, pairBalances } = await getTokenPrices({ lps: Object.keys(pairs), allLps: true, coreAssets: [ tether ], block, chain, minLPRatio: 0.001 })
|
const { updateBalances, } = await getTokenPrices({ lps: Object.keys(pairs), allLps: true, coreAssets: [tether], block, chain, minLPRatio: 0.001 })
|
||||||
Object.entries(tempBalances).forEach(([token, balance]) => {
|
Object.entries(tempBalances).forEach(([token, balance]) => {
|
||||||
if (pairs[token]) {
|
if (pairs[token]) {
|
||||||
const { token0Address, token1Address } = pairs[token]
|
const { token0Address, token1Address } = pairs[token]
|
||||||
|
|||||||
Reference in New Issue
Block a user