API REFERENCE

Build on Perconaries.

REST and WebSocket endpoints for market data, account state, and order placement. Public endpoints require no authentication. Authenticated endpoints use Solana wallet signatures.

https://api.perconaries.com/v1

Authentication.

Public endpoints (market data) require no authentication. Private endpoints (account, orders) require an X-Signature header containing an Ed25519 signature of the request body, signed by the trader's Solana wallet. Include X-Public-Key and X-Timestamp headers. Requests older than 30 seconds are rejected.

Rate limits.

100 requests per second per IP for public endpoints. 50 per second per public key for authenticated endpoints. Burst capacity of 2x for 5 seconds. WebSocket: 5 concurrent connections per IP. Returns 429 with a Retry-After header when exceeded.

Markets.

Public market data endpoints. No authentication required.

GET/v1/markets

List all markets with current mark, OI, funding, max leverage.

{
  "markets": [
    {
      "symbol": "BONK-PERP",
      "mark": 0.0000218,
      "index": 0.0000217,
      "open_interest": 8723421.50,
      "volume_24h": 42103882.10,
      "funding_8h": 0.00011,
      "max_leverage": 50,
      "tier": 1
    }
  ]
}
GET/v1/markets/{symbol}

Single market details including mark, index, OI, volume, funding, and tier.

GET/v1/markets/{symbol}/candles?interval=1m&limit=100

OHLCV candles for the specified market and interval.

GET/v1/markets/{symbol}/trades?limit=50

Recent trades for the specified market.

GET/v1/markets/{symbol}/orderbook?depth=20

Order book snapshot at the specified depth.

Account.

Authenticated endpoints for account state.

GET/v1/account

Account summary: equity, margin used, free collateral, current H ratio applied.

{
  "equity_usdc": 12483.22,
  "free_collateral_usdc": 8201.10,
  "margin_used_usdc": 4282.12,
  "h_current": 1.0,
  "epoch": 41
}
GET/v1/account/positions

Open positions with entry price, size, unrealized PnL, and liquidation price.

GET/v1/account/fills

Recent fills with timestamp, price, size, and side.

GET/v1/account/withdrawals

Withdrawal history with H applied per row.

Orders.

Authenticated endpoints for order management.

POST/v1/orders

Place an order. Supports market and limit types.

{
  "symbol": "WIF-PERP",
  "side": "long",
  "size": 1000,
  "leverage": 10,
  "type": "market"
}
DELETE/v1/orders/{id}

Cancel a specific order by ID.

DELETE/v1/orders

Cancel all orders, optionally filtered by symbol query parameter.

GET/v1/orders

List open orders.

WebSocket streams.

Connect to wss://stream.perconaries.com/v1. Subscribe with a JSON message. Public streams need no auth. Private streams require the same signed handshake as authenticated REST.

Available streams:

  • markets — All market updates, 100ms throttled.
  • markets.{symbol}.trades — Trade prints.
  • markets.{symbol}.orderbook — Incremental order book.
  • account — Account state changes (private).
  • account.positions — Position updates (private).
  • account.fills — Fill notifications (private).
  • risk — Live H ratio and per-side A/K state. Public.
{
  "op": "subscribe",
  "channels": ["markets.BONK-PERP.trades", "risk"]
}

Errors.

CodeMeaning
400Malformed request
401Invalid or missing signature
403Action not permitted in current market state (e.g. DrainOnly)
404Market or resource not found
409Order conflicts with existing state
429Rate limit exceeded
503Market in ResetPending phase, retry after epoch advances

SDKs.

TypeScript

npm install @perconaries/sdkGitHub

Rust

cargo add perconariesGitHub

Python

pip install perconariesGitHub