DeFi Llama
  • List your project
    • DefiLlama and our methodology
    • How to list a DeFi project
    • How to add a new Blockchain
    • How to write an SDK adapter
    • Functions we've written so you don't have to
      • Staking and Pool2
      • Fork helpers
      • General EVM contract calls
    • What to include as TVL?
    • How to update a project
    • How to write dimensions adapters
    • Emissions dashboard
      • Protocol Files
      • Emission Sections
      • Testing
    • Oracles TVS
  • analysts
    • Data Definitions
    • Custom columns
  • Chainlist
    • How to change Ethereum's RPC
    • Add a new RPC endpoint
  • FAQs
    • Frequently Asked Questions
  • Coin Prices API
  • Pricing
Powered by GitBook
On this page

Was this helpful?

  1. List your project
  2. Functions we've written so you don't have to

Staking and Pool2

PreviousFunctions we've written so you don't have toNextFork helpers

Last updated 3 years ago

Was this helpful?

The stakings and pool2 functions make it really simple to add any native token TVL.

const { stakings } = require("../helper/staking");
const { pool2s } = require("../helper/pool2");

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.)

const { stakingPricedLP } = require("../helper/staking");

DefiLlama-Adapters/index.js at main · DefiLlama/DefiLlama-AdaptersGitHub
Example Stakings Adapter
DefiLlama-Adapters/corgiswap.js at main · DefiLlama/DefiLlama-AdaptersGitHub
Example Price From LP Adapter
Logo
Logo