> ## 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 Feed

> Retrieve historical TVL data by exchange over time

## Overview

Returns historical TVL (Total Value Locked) data for a token across different exchanges over time. Use this to build TVL trend charts and analyze liquidity changes.

## Path Parameters

<ParamField path="tokenAddress" type="string" required>
  Token contract address (hex format)
</ParamField>

## Query Parameters

<ParamField query="startDate" type="string" required>
  Start date (ISO 8601 format)
</ParamField>

<ParamField query="endDate" type="string" required>
  End date (ISO 8601 format)
</ParamField>

<ParamField query="resolution" type="string" default="1H">
  Data point frequency: `1`, `5`, `15`, `1H`, `4H`, `1D`, `1W`
</ParamField>

## Response

Returns an array of TVL data points by exchange (`ExchangeDataPoint`).

<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
</ResponseField>

<ResponseField name="date" type="string" required>
  ISO 8601 timestamp
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/exchange-tvl/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D"
  ```

  ```typescript TypeScript theme={null}
  const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
  const endDate = new Date();
  const startDate = new Date(endDate.getTime() - 7 * 24 * 60 * 60 * 1000);

  const params = new URLSearchParams({
    startDate: startDate.toISOString(),
    endDate: endDate.toISOString(),
    resolution: '1D'
  });

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

  const tvlData = await response.json();

  // Group by exchange
  const byExchange = tvlData.reduce((acc, item) => {
    if (!acc[item.exchange]) acc[item.exchange] = [];
    acc[item.exchange].push(item);
    return acc;
  }, {});

  Object.entries(byExchange).forEach(([exchange, data]) => {
    console.log(`${exchange}: ${data.length} data points`);
  });
  ```

  ```python Python theme={null}
  import requests
  from datetime import datetime, timedelta

  token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'
  end_date = datetime.now()
  start_date = end_date - timedelta(days=7)

  params = {
      'startDate': start_date.isoformat() + 'Z',
      'endDate': end_date.isoformat() + 'Z',
      'resolution': '1D'
  }

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

  tvl_data = response.json()
  print(f"Fetched {len(tvl_data)} TVL data points")
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "exchange": "JediSwap",
      "value": 5234567.89,
      "valueUsd": 12750000,
      "date": "2024-02-13T00:00:00Z"
    },
    {
      "exchange": "Ekubo",
      "value": 3456789.12,
      "valueUsd": 8420000,
      "date": "2024-02-13T00:00:00Z"
    },
    {
      "exchange": "JediSwap",
      "value": 5345678.90,
      "valueUsd": 13020000,
      "date": "2024-02-14T00:00:00Z"
    },
    {
      "exchange": "Ekubo",
      "value": 3567890.12,
      "valueUsd": 8690000,
      "date": "2024-02-14T00:00:00Z"
    }
  ]
  ```
</ResponseExample>
