MCPcopy Index your code
hub / github.com/DefiLlama/defillama-sdk

github.com/DefiLlama/defillama-sdk @v5.0.218

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.0.218 ↗ · + Follow
365 symbols 1,098 edges 73 files 0 documented · 0% updated 2d ago★ 731 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sdk

npm i
npm run build
npm t
npm run format

Publish

bash patchAndPublish.sh

Keys

POLYGON_RPC="https://..."
ETHEREUM_RPC="https://..."
BSC_RPC="https://..."

Chain RPC PR

Before putting up a PR for new chain, check if we already support it here: https://unpkg.com/@defillama/sdk@latest/build/providers.json

Everytime we publish a new sdk version, we automically pull latest list from chainlist.org and include it.

Extension points exported contracts — how you extend this code

Counter (Interface)
(no doc)
src/abi/rpcCall.ts
WriteCacheOptions (Interface)
(no doc)
src/util/cache.ts
ReadCacheOptions (Interface)
(no doc)
src/util/cache.ts
GetTransactionOptions (Interface)
(no doc)
src/util/transactions.ts
TimestampBlock (Interface)
(no doc)
src/util/blocks.ts
StreamingMetrics (Interface)
(no doc)
src/util/indexer.streaming.test.ts

Core symbols most depended-on inside this repo

add
called by 101
src/ChainApi.ts
getBalances
called by 86
src/ChainApi.ts
getEnvValue
called by 49
src/util/env.ts
debugLog
called by 36
src/util/debugLog.ts
log
called by 33
src/ChainApi.ts
sumSingleBalance
called by 30
src/util/common.ts
addUSDValue
called by 27
src/ChainApi.ts
getChainKeyFromLabel
called by 24
src/util/chainUtils/index.ts

Shape

Function 268
Method 82
Interface 9
Class 6

Languages

TypeScript100%

Modules by API surface

src/ChainApi.ts45 symbols
src/Balances.ts33 symbols
src/util/LlamaProvider.ts26 symbols
src/util/cache.ts24 symbols
src/util/blocks.ts23 symbols
src/util/common.ts21 symbols
src/util/indexer.ts16 symbols
src/util/env.ts15 symbols
src/util/indexer.streaming.test.ts14 symbols
src/util/index.ts10 symbols
src/abi/index.ts10 symbols
src/util/logs.ts9 symbols

For agents

$ claude mcp add defillama-sdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page