> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avnu.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Get TVL by Exchanges

> Retrieve TVL (Total Value Locked) distribution across exchanges

## Overview

Get current or historical TVL data showing how liquidity is distributed across different DEXs and AMMs. Essential for understanding market depth and optimal routing strategies.

## Request

<ParamField path="tokenAddress" type="string" required>
  Token contract address
</ParamField>

<ParamField query="date" type="string">
  ISO 8601 date for historical TVL (defaults to current)
</ParamField>

## Response

<ResponseField name="exchange" type="string" required>
  Exchange/DEX name
</ResponseField>

<ResponseField name="value" type="number" required>
  TVL in token amount
</ResponseField>

<ResponseField name="valueUsd" type="number" required>
  TVL in USD value
</ResponseField>

<ResponseField name="date" type="string" required>
  ISO 8601 date-time for this TVL snapshot
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://starknet.impulse.avnu.fi/v3/tokens/0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8/exchange-tvl"
  ```

  ```typescript TypeScript theme={null}
  // Get current TVL distribution for USDC
  const tokenAddress = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8';

  const response = await fetch(
    `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/exchange-tvl`
  );

  const tvlData = await response.json();

  // Display liquidity distribution
  const totalTvl = tvlData.reduce((sum, item) => sum + item.valueUsd, 0);
  console.log(`Total TVL: $${totalTvl.toLocaleString()}`);
  console.log(`Distributed across ${tvlData.length} exchanges:\n`);

  tvlData.sort((a, b) => b.valueUsd - a.valueUsd).forEach(item => {
    const share = (item.valueUsd / totalTvl) * 100;
    const bar = '█'.repeat(Math.floor(share / 2));
    console.log(`${item.exchange.padEnd(15)} ${bar} ${share.toFixed(1)}% ($${item.valueUsd.toLocaleString()})`);
  });
  ```

  ```python Python theme={null}
  import requests
  import matplotlib.pyplot as plt

  token_address = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'

  response = requests.get(
      f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/exchange-tvl'
  )

  tvl_data = response.json()

  # Create pie chart of TVL distribution
  exchanges = [item['exchange'] for item in tvl_data]
  values = [item['valueUsd'] for item in tvl_data]
  total_tvl = sum(values)

  plt.pie(values, labels=exchanges, autopct='%1.1f%%')
  plt.title(f'TVL Distribution - Total: ${total_tvl:,.0f}')
  plt.show()
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "exchange": "JediSwap",
      "value": 5234567.89,
      "valueUsd": 5235802.45,
      "date": "2024-02-14T12:00:00Z"
    },
    {
      "exchange": "10kSwap",
      "value": 3456789.12,
      "valueUsd": 3458234.67,
      "date": "2024-02-14T12:00:00Z"
    },
    {
      "exchange": "MySwap",
      "value": 2345678.90,
      "valueUsd": 2346789.34,
      "date": "2024-02-14T12:00:00Z"
    },
    {
      "exchange": "SithSwap",
      "value": 1234567.89,
      "valueUsd": 1235432.10,
      "date": "2024-02-14T12:00:00Z"
    }
  ]
  ```
</ResponseExample>
