Spock Analytics
  • Introduction
  • The Spock Thesis
  • Spock Analytics
    • Explore: The Data Warehouse for DApps
    • Probe: Strategic Data Reports
    • Engage: Improve User Conversion and Retention
  • Spock API
    • Build Custom Campaigns Using On-chain Data
    • Decipher Web3 Wallets Landscape
  • Guides
    • Maximize NFT Lending: Strategies For NFTFi DApps
    • 10x NFT Borrower Engagement: Strategies For NFTFi DApps
    • Offer Gas Refunds to Newly Converted Users
    • Boost Your Liquidity Providers Conversion Rate
    • Increase Transaction Submissions by 15% Using Probe
  • Configuration
    • Onboarding
    • Contracts
    • SDK
      • API Reference
      • Supporting Wallets
      • NPM Package
      • Example Application
      • SDK Code
    • Adapter
      • Transformers
      • TVL Extractors
      • How to code an adapter?
      • Functions we have written so you don't have to
        • Multicall
        • Sum Balances
      • GitHub repo
  • Pricing
    • Explore & Probe
    • Engage
    • Pricing Calculations & FAQs
  • Data Catalog
    • Wallet
    • Global
    • This Protocol
    • Session
    • Other Protocols
    • Transaction
Powered by GitBook
On this page
  1. Configuration
  2. Adapter

TVL Extractors

TVL extractors are the functions that calculate the balances of assets locked in a protocol.

Structure

The structure of the TVL extractor is inspired by Defillama and Defipluse TVL adapters. The additional thing Spock is providing is the ability to archive syncing the TVL from the day of the protocol launch.

Currently, Spock has two categories for TVL.

  1. TVL => Assets locked by users in a protocol.

  2. Staking => Protocol native tokens locked in the staking contract.

type TvlExtractor = {
  category: TVL_Category;
  extractor: (chain: Chain, block: number, timestamp: number, cache?: LogsCache) => Promise<Record<string, string>>;
  startBlock: number;
};

Property
Type
Description

category

required

Category in which the TVL is classified

extractor

required

A function that calculates and returns balances of assets locked in a protocol

startBlock

required

Block number from which the syncing of the TVL wll start

PreviousTransformersNextHow to code an adapter?

Last updated 1 year ago