MCPcopy Index your code
hub / github.com/DefiLlama/DefiLlama-Adapters

github.com/DefiLlama/DefiLlama-Adapters @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
6,667 symbols 16,995 edges 4,591 files 196 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Defillama Adapters

Follow this guide to create an adapter and submit a PR with it.

Also, don't hesitate to send a message on our discord if we're late to merge your PR.

This repo is for TVL adapters. For other metrics such as volume, fees, revenue, aggregators, open-interest, active-users, etc. submit the PR to DefiLlama/dimension-adapters.

  1. PLEASE PLEASE enable "Allow edits by maintainers" while putting up the PR.
  2. Once your adapter has been merged, it takes time to show on the UI. No need to notify us on Discord.
  3. TVL must be computed from blockchain data (reason: https://github.com/DefiLlama/DefiLlama-Adapters/discussions/432), if you have trouble with creating the adapter, please hop onto our discord, we are happy to assist you.
  4. For updating listing info Please send a mail to metadata@defillama.com
  5. Do not edit/push pnpm-lock.yaml or pnpm-workspace.yaml files as part of your changes, that messes up our CI.
  6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

Getting listed

Please send answers to questions there https://github.com/DefiLlama/DefiLlama-Adapters/blob/main/pull_request_template.md when creating a PR.

Agent skill

This repo includes an agent skill at skills/adapter-author/ for AI-assisted DefiLlama TVL adapter authoring. It helps coding agents validate whether a request belongs in DefiLlama-Adapters, choose existing adapter patterns, implement TVL adapters in repo style, run node test.js, and prepare PR metadata. See skills/adapter-author/SKILL.md for usage.

Work in progress

This is a work in progress. DefiLlama aims to be transparent, accurate, and open source.

If you have any suggestions, want to contribute or want to chat, please join our discord and drop a message.

Testing adapters

node test.js projects/pangolin/index.js
# Add a timestamp at the end to run the adapter at a historical timestamp
node test.js projects/aave/v3.js 1729080692
# or using YYYY-MM-DD
node test.js projects/aave/v3.js 2024-10-16

Changing RPC providers

If you want to change RPC providers because you need archive node access or because the default ones don't work well enough you can do so by creating an .env file and filling it with the env variables to overwrite:

ETHEREUM_RPC="..."
BSC_RPC="..."
POLYGON_RPC="..."

The name of each rpc is {CHAIN-NAME}_RPC, and the name we use for each chain can be found here. If you run into issues with a chain make sure to update the sdk with npm update @defillama/sdk.

Adapter rules

  • Never add extra npm packages, if you need a chain-level package for your chain, ask us, and we'll consider it, but we can't accept any npm package that is project-specific

Core symbols most depended-on inside this repo

sumTokens2
called by 1212
projects/helper/solana.js
toString
called by 673
projects/colony/clyVesting.js
sumTokensExport
called by 498
projects/helper/solana.js
getLogs
called by 321
projects/helper/cache/getLogs.js
getConfig
called by 308
projects/izumi/api.js
get
called by 304
projects/helper/http.js
getUniTVL
called by 230
projects/helper/cache/uniswap.js
publicKey
called by 202
projects/helper/utils/solana/layouts/layout-base.js

Shape

Function 6,545
Method 78
Class 44

Languages

TypeScript100%

Modules by API surface

projects/helper/unwrapLPs.js38 symbols
projects/helper/utils/solana/layouts/lido.js35 symbols
projects/helper/custom-scripts/metadao/index.js35 symbols
projects/helper/solana.js32 symbols
projects/helper/chain/sui.js31 symbols
projects/overpass/index.js29 symbols
projects/yield-ai/index.js26 symbols
projects/basedbid/index.js25 symbols
projects/solv-protocol-funds/index.js24 symbols
projects/helper/utils.js24 symbols
projects/stakedao/index.js23 symbols
projects/helper/chain/ton.js22 symbols

For agents

$ claude mcp add DefiLlama-Adapters \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page