Skip to content

Commit

Permalink
add Bitdrome adapter (DefiLlama#11230)
Browse files Browse the repository at this point in the history
* add Bitdrome adapter

* code refactor

---------

Co-authored-by: g1nt0ki <[email protected]>
  • Loading branch information
2 people authored and tlatkdgus1 committed Nov 25, 2024
1 parent e733536 commit 4aa7a33
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions projects/bitdrome/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
async function tvl(api) {
const TwoPoolFactory = '0x634FB7F07BDb77281c64a57F69E1EB19583E727a'
const pools = await api.fetchList({ lengthAbi: 'pool_count', itemAbi: 'pool_list', target: TwoPoolFactory })
const tokens = await api.multiCall({ target: TwoPoolFactory, calls: pools, abi: 'function get_coins(address _pool) view returns (address[2])' })
const ownerTokens = tokens.map((v, i) => [v, pools[i]])
return api.sumTokens({ ownerTokens })
}

module.exports = {
bevm: {
tvl
}
}

0 comments on commit 4aa7a33

Please sign in to comment.