DeFi Llama
Search…
Staking and Pool2
The stakings and pool2 functions make it really simple to add any native token TVL.
1
const { stakings } = require("../helper/staking");
2
const { pool2s } = require("../helper/pool2");
Copied!
DefiLlama-Adapters/index.js at main · DefiLlama/DefiLlama-Adapters
GitHub
Example Stakings Adapter
If your protocol token isn't on GitHub, you can estimate the USD value of the token using stakingPriceLP. This function will use uniV2 pool weights we determine the value of the staked tokens. (NB: there must be a Uni V2 pool with your coin in, which has significant liquidity. Otherwise the price oracle will be unreliable and vulnerable to manipulation.)
1
const { stakingPricedLP } = require("../helper/staking");
Copied!
DefiLlama-Adapters/corgiswap.js at main · DefiLlama/DefiLlama-Adapters
GitHub
Example Price From LP Adapter
Copy link