๐ŸŒ REST API

REST API

Direct HTTP integration for custom integrations or languages without an SDK.

Base URL: https://api.vaea.fi

โ„น๏ธ Note
If you're using the TypeScript, Rust, or Python SDK, you don't need the REST API โ€” the SDK handles everything. Use the API for custom integrations or unsupported languages.

GET /v1/capacity

Returns real-time borrowing capacity for all 27 supported tokens.

bash
curl https://api.vaea.fi/v1/capacity

// Response:
{
  "updated_at": "2026-03-28T20:00:00Z",
  "tokens": [
    {
      "symbol": "SOL",
      "mint": "So11111111111111111111111111111111111111112",
      "decimals": 9,
      "max_amount": 50000,
      "route_type": "direct",
      "source_protocol": "Marginfi",
      "swap_protocol": null,
      "status": "available"
    },
    {
      "symbol": "mSOL",
      "mint": "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
      "decimals": 9,
      "max_amount": 12000,
      "route_type": "synthetic",
      "source_protocol": "Marginfi",
      "swap_protocol": "Sanctum",
      "status": "available"
    }
  ]
}

GET /v1/quote

Get a fee quote with full cost breakdown.

bash
curl "https://api.vaea.fi/v1/quote?token=SOL&amount=1000&source=sdk"

// Response:
{
  "token": "SOL",
  "amount": 1000,
  "route_type": "direct",
  "source_protocol": "Marginfi",
  "fee_breakdown": {
    "source_fee": 0,
    "swap_in_fee": 0,
    "swap_out_fee": 0,
    "vaea_fee": 0.3,
    "total_fee_sol": 0.3,
    "total_fee_usd": 24.9,
    "total_fee_pct": 0.03
  }
}

POST /v1/build

Build flash loan instructions server-side. Returns base64-encoded instructions.

bash
curl -X POST https://api.vaea.fi/v1/build \
  -H "Content-Type: application/json" \
  -d '{"token":"SOL","amount":1000,"payer":"YOUR_PUBKEY","source":"sdk"}'

// Response:
{
  "prefix_instructions": [
    {
      "program_id": "HoYiwkNB7a3gmZXEkTqLkborNDc976vKEUAzBm8YpK5E",
      "data": "BASE64_ENCODED...",
      "accounts": [
        { "pubkey": "...", "is_signer": true, "is_writable": true }
      ]
    }
  ],
  "suffix_instructions": [ ... ],
  "lookup_tables": ["DjncKSi9KqtnFx6hFYa7ARmwJ7B4Y7UH3XpR2XEuXNJr"],
  "estimated_fee_lamports": 300000
}

parseApiInstruction()

SDK helper to convert API response instructions into native TransactionInstruction:

typescript
import { parseApiInstruction } from '@vaea/flash';

// Convert /v1/build response to native instructions
const buildResponse = await fetch('https://api.vaea.fi/v1/build', { ... });
const data = await buildResponse.json();

const prefixIxs = data.prefix_instructions.map(parseApiInstruction);
const suffixIxs = data.suffix_instructions.map(parseApiInstruction);

// Sandwich: prefix + your logic + suffix
const allIxs = [...prefixIxs, myArbIx, ...suffixIxs];

GET /v1/health

bash
curl https://api.vaea.fi/v1/health

// Response:
{
  "status": "ok",
  "components": {
    "redis": { "status": "ok" },
    "scanner": { "status": "ok", "cache_age_ms": 1200 },
    "program": { "program_id": "HoYiwkNB7a3gmZXEkTqLkborNDc976vKEUAzBm8YpK5E" }
  },
  "sources": {
    "Marginfi": { "status": "available", "available_sol": 50000 },
    "Kamino": { "status": "available", "available_sol": 30000 }
  }
}

Rate Limits

PlanRequests/minBurst
Free10010/sec
Pro1,00050/sec
EnterpriseUnlimitedUnlimited
๐Ÿ’ก Tip
For 100+ req/min, use executeLocal() in Turbo Mode โ€” it doesn't call the API at all, so no rate limit applies.