Blockchain project analytics setup (DefiLlama)

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1 servicesAll 1306 services
Blockchain project analytics setup (DefiLlama)
Simple
from 1 business day to 3 business days
FAQ
Blockchain Development Services
Blockchain Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1218
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    853
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1047
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    825

Blockchain project analytics setup (DefiLlama)

DefiLlama is the primary TVL (Total Value Locked) aggregator in DeFi. Protocol without listing on DefiLlama is essentially invisible to institutional investors and analysts who use platform as primary source. Getting listed is not marketing—it's technical task: write TypeScript adapter that can calculate your protocol TVL at any historical moment.

How DefiLlama adapters work

Repository DefiLlama/DefiLlama-Adapters accepts pull requests. Each adapter—TypeScript module exporting tvl() function taking chain and block parameters, returning object with tokens and amounts.

// Simplified adapter structure
async function tvl(api: ChainApi) {
  // Get contract balances
  const balance = await api.call({
    abi: 'erc20:balanceOf',
    target: tokenAddress,
    params: [protocolVaultAddress],
  })
  api.add(tokenAddress, balance)
}

module.exports = {
  ethereum: { tvl },
  arbitrum: { tvl },
}

DefiLlama periodically calls this function, passing block number—adapter must work correctly for any historical block, not just current.

Typical complexities when writing adapter

Dynamic contract addresses

If protocol uses factory pattern (like Uniswap: one factory creates thousands of pairs), adapter can't hardcode addresses. Must get list of all created contracts from events or via getAllPairs() in factory, then aggregate TVL across each.

const pairsCount = await api.call({ abi: 'uint256:allPairsLength', target: factory })
const pairs = await api.multiCall({
  abi: 'function allPairs(uint256) returns (address)',
  target: factory,
  calls: Array.from({ length: Number(pairsCount) }, (_, i) => ({ params: [i] })),
})

api.multiCall batches calls via Multicall3—hundreds of contracts in one RPC request. Without batching factory with 10,000 pairs unrealistic to index.

Double-counting TVL

If protocol uses Aave or Compound under the hood—tokens in these protocols already counted in their TVL. Adding same tokens to own adapter—double counting, which DefiLlama marks as error and downgrades. Either count only native positions or explicitly mark doublecounted: true in config.

Data verification

After PR merge DefiLlama may spend several days verifying data correctness. Alerts arise if TVL jumps ±50% between blocks without explanation—means adapter incorrectly handles some edge case (e.g., balances before/after pool initialization).

Metrics beyond TVL

In parallel with DefiLlama listing set up subgraph on The Graph for more detailed analytics: trading volume, unique user count, transaction history. Subgraph—foundation for protocol's own dashboard and third-party analytics platforms (Dune Analytics works separately, via direct node queries).

For Dune—write SQL queries on decoded transaction data. DefiLlama and Dune complement each other: first—for aggregated TVL, second—for detailed on-chain analysis.

Timeline estimates

Write and merge adapter for one network—1-2 days technical work plus 2-7 days DefiLlama review. Multichain adapter with factory support—2-3 days development. Subgraph setup in parallel—adds 2-4 days.

Cost calculated individually.