Components of TVL - Measures the size of a DeFi protocol

  1. DEX TVL
{ 
  dailyPools { 
    nodes { 
      timestamp token0 {id} token1 {id} feeRateUSD dailyTradeVolumeUSD totalTVL txCount updateAtBlock {id}  
    } 
  } 
}
  1. LP Token Staking TVL
substrate.query(module='Rewards',storage_function='PoolInfos', block_hash = hash)
  1. Bridge TVL
substrate.query(module='Tokens',storage_function='TotalIssuance', params = [{'Token': 'KSM'}], block_hash = hash)
substrate.query(module='Tokens',storage_function='TotalIssuance', params = [{'Token': 'LKSM'}], block_hash = hash)
  1. Liquid Staking TVL
substrate.query(module='Homa',storage_function='TotalStakingBonded', block_hash = hash)
  1. Stablecoin TVL
{ 
  dailyCollaterals { 
    nodes { 
      collateral {id} depositAmount debitAmount depositVolumeUSD debitVolumeUSD
      depositChangedUSD debitChangedUSD debitExchangeRate timestamp txCount 
    } 
  } 
}
  1. Crowdloan TVL
substrate.query(module='Tokens',storage_function='TotalIssuance', params = [{'LiquidCrowdloan': 13}], block_hash = hash)

Alternative Measures of Size (What do we do for non-DeFi protocols?)

  1. Market cap
  • Total issuance of native token multiplied by price
  1. Fees in USD
  • Transaction fees converted into USD