DefiLlama TVL Integration
Introduction
There are two steps required to integrate into the defillama system.
- Add adapter to defillama
- Submit PR like: https://github.com/DefiLlama/DefiLlama-Adapters/commits/d67f57641b931a04afe05affe4c52605b6544e26/projects/macaron-xyz/index.js
Step 1: Add adapter locally
The following steps need to be completed:
- Fork repository: https://github.com/DefiLlama/DefiLlama-Adapters
- Create a new project adapter path under projects, for example: projects/[%PROJECT_TAG%]/index.js
const { sumTokens2, } = require('../helper/unwrapLPs')
async function tvl(api) {
return sumTokens2({ owners: [
'[%CONTRACT_ADDR%]',
], tokens: ['[%TOKEN_ADDR_1%]', '[%TOKEN_ADDR_2%]'], api, }) //wbtc and usdt
}
module.exports = {
btr: { tvl, }
}
- [%PROJECT_TAG%] is the project name
- [%CONTRACT_ADDR%] is the contract address of the project
- [%TOKNE_ADDR_1%]、[%TOKEN_ADDR_2%] are the currency pair address that needs to be calculated
- For future references, if you add another token you can just add it here, you can do like this https://github.com/DefiLlama/DefiLlama-Adapters/pull/10229/files
Step 2: Submit PR
- Submit PR, for example: https://github.com/DefiLlama/DefiLlama-Adapters/commits/d67f57641b931a04afe05affe4c52605b6544e26/projects/macaron-xyz/index.js
Reference
Projects built on bitlayer
Name | Category | Website | Defillama | Project Path |
---|---|---|---|---|
bitsmiley | CDP | https://www.bitsmiley.io/app/alphanet | https://defillama.com/protocol/bitsmiley#information | projects/bitsmiley-io |
macaron | Dexes | https://www.macaron.xyz/#/swap?lang=en | https://defillama.com/protocol/macaron | projects/macaron-xyz |
avalon | Lending | https://app.avalonfinance.xyz/ | https://defillama.com/protocol/avalon-finance#information | projects/avalon-finance |
bitcow | Dexes | https://bitcow.xyz/ | https://defillama.com/protocol/bitcow#information | projects/bitcow |
enzo | Lending | https://app.enzo.finance/ | https://defillama.com/protocol/enzo#information | projects/enzo |
trustin | Lending | https://www.trustin.com/ | https://defillama.com/protocol/trustin-finance?borrowed=false&twitter=true&tvl=false | projects/trustin |