gregat docs

API Reference

gregat provides a free, public JSON API. No authentication or API key required. Base URL:

https://gregat.com

GET /api/quote

Fetch price quotes from all venues (CEX + DEX) for a trading pair.

Parameters

ParamTypeRequiredDescription
pairstringYesTrading pair, e.g. BTC/USDT

Example Request

curl https://gregat.com/api/quote?pair=SOL/USDT

Example Response

{
  "pair": "SOL/USDT",
  "quotes": [
    {
      "venue": "Raydium (Solana)",
      "type": "dex",
      "askPrice": "85.05",
      "bidPrice": "85.05",
      "askSize": "7540207",
      "bidSize": "7540207",
      "midPrice": 85.05,
      "spreadBps": 0,
      "timestamp": 1773228010866
    },
    {
      "venue": "Binance",
      "type": "cex",
      "askPrice": "85.20",
      "bidPrice": "85.19",
      "askSize": "127.22",
      "bidSize": "664.10",
      "midPrice": 85.195,
      "spreadBps": 1.17,
      "timestamp": 1773228010832
    }
  ],
  "timestamp": 1773228011263
}

Response Fields

FieldTypeDescription
pairstringThe requested trading pair
quotesarraySorted by best ask price (lowest first)
quotes[].venuestringExchange or DEX name with chain
quotes[].typestring"cex" or "dex"
quotes[].askPricestringBest ask price
quotes[].bidPricestringBest bid price
quotes[].askSizestringSize at ask (CEX) or liquidity USD (DEX)
quotes[].bidSizestringSize at bid (CEX) or liquidity USD (DEX)
quotes[].midPricenumberMidpoint price
quotes[].spreadBpsnumberSpread in basis points (0 for DEX)
quotes[].errorstring?Error message if venue failed
timestampnumberResponse generation time (ms epoch)

GET /api/quote/pairs

List all available trading pairs.

Example

curl https://gregat.com/api/quote/pairs

{
  "pairs": [
    "BTC/USDT", "ETH/USDT", "SOL/USDT",
    "DOGE/USDT", "XRP/USDT", "ADA/USDT",
    "AVAX/USDT", "LINK/USDT", "DOT/USDT",
    "NEAR/USDT", "SUI/USDT", "PEPE/USDT"
  ]
}

Self-Hosting

gregat is open source. Deploy your own instance with custom fees.

1. Clone and install

git clone https://github.com/alexiuz/gregat.git
cd gregat
pnpm install
pnpm build

2. Configure

Edit gregat.toml:

[fees]
wallet = "your-wallet-address"
bps = 30  # 0.30% platform fee

[cex.binance]
enabled = true
base_url = "https://api.binance.com"

# Add or remove exchanges as needed

3. Run

# API server
PORT=3737 node packages/server/dist/index.js

# Static frontend (deploy anywhere)
# Built files in packages/client/dist/