Skip to content

Instantly share code, notes, and snippets.

@patcito
Last active January 21, 2026 20:57
Show Gist options
  • Select an option

  • Save patcito/caf5f4fdfd94a7da0dad0419002b3787 to your computer and use it in GitHub Desktop.

Select an option

Save patcito/caf5f4fdfd94a7da0dad0419002b3787 to your computer and use it in GitHub Desktop.
Flying Tulip API - Strategy Info & Time Series Endpoints Documentation

Flying Tulip API - Endpoints Documentation

TL;DR - What Each Metric Means

Metric What It Is Endpoint Field
Total FT Value FT currently held in PUTs, in USD GET /tge/metrics data.ft_allocation.chains[].value_usd
Total Investment Sum of all collateral tokens currently invested GET /tge/metrics data.collateral_supply.chains[].assets[].value_usd
All Time Yield Cumulative yield claimed from strategies (ever) GET /tge/metrics data.strategy_allocation.entries[].yield_claimed

Quick Examples

# Get current snapshot of all metrics
curl https://api.flyingtulip.com/tge/metrics

# Get FT value history (for charts)
curl "https://api.flyingtulip.com/tge/metrics/series?metric=ft_allocation&period=1w"

# Get TVL history (for charts)  
curl "https://api.flyingtulip.com/tge/metrics/series?metric=collateral_supply&asset=0x29219dd400f2bf60e5a23d13be72b486d4038894&period=1w"

# Get yield history (for charts)
curl "https://api.flyingtulip.com/tge/metrics/series?metric=strategy_allocation&field=yield_claimed&strategy=0x06c0eeafe8ea72882b24d05d509d6d1733cb4a3a&chainId=146&period=1w"

1. Current Metrics Snapshot

Endpoint

GET /tge/metrics

Response Structure

{
  "code": 200,
  "success": true,
  "data": {
    "ft_allocation": {
      "recorded_at": "2026-01-21T21:00:00Z",
      "chains": [
        {
          "chain_id": 0,
          "amount": "1043975586795977678800000",
          "decimals": 18,
          "scope": "total",
          "value_usd": "1490000000",
          "value_decimals": 8
        }
      ]
    },
    "collateral_supply": {
      "recorded_at": "2026-01-21T21:00:00Z",
      "chains": [
        {
          "chain_id": 0,
          "assets": [
            {
              "asset_address": "0x29219dd400f2bf60e5a23d13be72b486d4038894",
              "amount": "14311635",
              "decimals": 6,
              "scope": "total",
              "value_usd": "1399641418",
              "value_decimals": 8
            }
          ]
        }
      ]
    },
    "strategy_allocation": {
      "recorded_at": "2026-01-21T21:00:00Z",
      "entries": [
        {
          "chain_id": 146,
          "strategy_address": "0x06c0eeafe8ea72882b24d05d509d6d1733cb4a3a",
          "wrapper_address": "0x62ebd646734d0faddd2c70391910b38bec2ede2d",
          "asset_address": "0x29219dd400f2Bf60E5a23d13Be72B486D4038894",
          "allocated_amount": "3447663",
          "allocated_decimals": 6,
          "yield_claimed": "0",
          "yield_decimals": 6
        }
      ]
    }
  }
}

How to Read Values

// Total FT Value in USD (divide by 10^8)
const ftValueUsd = Number(data.ft_allocation.chains[0].value_usd) / 1e8;

// Total Investment in USD (sum all assets, divide by 10^8)
const totalInvestmentUsd = data.collateral_supply.chains[0].assets
  .reduce((sum, a) => sum + Number(a.value_usd), 0) / 1e8;

// All Time Yield (divide by 10^decimals)
const yieldClaimed = data.strategy_allocation.entries
  .reduce((sum, e) => sum + Number(e.yield_claimed) / Math.pow(10, e.yield_decimals), 0);

2. Time Series (Historical Data for Charts)

Base Endpoint

GET /tge/metrics/series

Parameters

Parameter Required Description
metric Yes ft_allocation, collateral_supply, or strategy_allocation
period No 1d, 1w, 1m, 3m, 6m, 1y, all (default: 1d)
asset For collateral_supply Asset contract address
strategy For strategy_allocation Strategy or wrapper address
field For strategy_allocation allocated or yield_claimed
chainId For strategy_allocation Chain ID (e.g., 146 for Sonic)

2.1 FT Value History

GET /tge/metrics/series?metric=ft_allocation&period=1w
{
  "data": {
    "metric": "ft_allocation",
    "field": "amount",
    "period": "1w",
    "points": [
      { "timestamp": "2026-01-14T21:15:00Z", "value": "133858126082678800000", "decimals": 18 }
    ]
  }
}

2.2 Total Investment (TVL) History

GET /tge/metrics/series?metric=collateral_supply&asset=0x29219dd400f2bf60e5a23d13be72b486d4038894&period=1w
{
  "data": {
    "metric": "collateral_supply",
    "field": "amount",
    "period": "1w",
    "points": [
      { "timestamp": "2026-01-14T21:15:00Z", "value": "12785949", "decimals": 6 }
    ]
  }
}

2.3 All Time Yield History

GET /tge/metrics/series?metric=strategy_allocation&field=yield_claimed&strategy=0x06c0eeafe8ea72882b24d05d509d6d1733cb4a3a&chainId=146&period=1w
{
  "data": {
    "metric": "strategy_allocation",
    "field": "yield_claimed",
    "period": "1w",
    "points": [
      { "timestamp": "2026-01-14T21:15:00Z", "value": "0", "decimals": 6 }
    ]
  }
}

3. Strategy Info in PUT Dashboard

Endpoint

GET /status/put/dashboard

New Fields in vaultInfo

{
  "vaultInfo": {
    "strategyName": "Flying Tulip Aave USDC",
    "strategies": [
      {
        "address": "0x06C0eeafE8EA72882b24D05d509D6d1733CB4A3A",
        "name": "Flying Tulip Aave USDC",
        "deployed": "10999999",
        "deployedFormatted": "11.00"
      }
    ]
  }
}

TypeScript Interface

interface StrategyInfo {
  address: string;
  name: string;
  deployed: string;
  deployedFormatted: string;
}

interface VaultInfo {
  // ... existing fields ...
  strategyName?: string;
  strategies?: StrategyInfo[];
}

4. Frontend Chart Example

// Fetch and format for chart library
async function getFTValueChart(period = '1w') {
  const res = await fetch(`/tge/metrics/series?metric=ft_allocation&period=${period}`);
  const { data } = await res.json();
  
  return data.points.map(p => ({
    date: new Date(p.timestamp),
    value: Number(p.value) / Math.pow(10, p.decimals)
  }));
}

Notes

  • All amounts are strings to preserve precision
  • value_usd fields have 8 decimals (divide by 1e8)
  • Time series data is bucketed in 15-minute intervals
  • Data is updated every 15 minutes by background jobs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment