Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pacifica-fi/docs-migrate/llms.txt

Use this file to discover all available pages before exploring further.

Pacifica offers a full-featured REST and WebSocket API covering every trading operation on the platform — order placement and cancellation, position management, account configuration, market data subscriptions, and more. Whether you are building an automated trading system or integrating market data into a dashboard, the API gives you complete, low-latency access to Pacifica’s perpetual and spot markets.

Base URLs

All API traffic should be directed to the following endpoints. The testnet environment is functionally identical to production and is the recommended place to validate integrations before going live.
EnvironmentRESTWebSocket
Productionhttps://api.pacifica.fiwss://ws.pacifica.fi/ws
Testnethttps://test-api.pacifica.fiwss://test-ws.pacifica.fi/ws
Testnet uses real signing logic but holds no real funds. Run end-to-end tests against testnet before connecting a production wallet.

Quick Navigation

Authentication

Learn how Ed25519 signatures are constructed and submitted with every POST request.

Rate Limits

Understand the credit-based rolling window, fee-tier quotas, and API config keys.

REST API

Full reference for every REST endpoint across orders, positions, markets, and accounts.

WebSocket API

Real-time subscriptions and trading operations over persistent WebSocket connections.

Python SDK

The official Pacifica Python SDK wraps every REST and WebSocket operation and handles signature construction automatically. Using the SDK is strongly recommended — it eliminates the most common source of integration errors.
pip install pacifica-sdk
For feedback, integration help, and API questions, join the Discord API channel.

What the API Supports

The Pacifica API exposes the full surface of the exchange:
  • Order management — create limit and market orders, stop orders, batch orders, TP/SL, edit open orders, and cancel
  • Position management — query open positions, set TP/SL levels, update leverage and margin mode
  • Account operations — deposit, withdraw, subaccount creation and transfer, unified margin settings
  • Market data — order book snapshots, recent trades, candles (standard and mark-price), BBO, market info
  • Vaults (Lakes) — create and manage liquidity vaults with whitelist/blacklist controls
  • WebSocket streaming — real-time order updates, trade fills, position snapshots, account info

Market Symbols

Symbols passed to the API are case-sensitive. The canonical form uses all-caps for most assets. A small number of markets use a lower-case k prefix to indicate a scaled unit.
FormatExampleValid?
All capsBTC, ETH, SOL
Lower-case k-prefixkBONK, kPEPE
Mixed caseBtc, btc, KBONK
Requests with incorrectly cased symbol fields will be rejected. Always use the exact symbol string returned by the /api/v1/info market info endpoint.

Tick and Lot Size

Every market has a tick_size (minimum price increment) and a lot_size (minimum quantity increment). Both price and amount fields in order-related endpoints must be exact multiples of the respective size — the API does not round for you. The general rule of thumb is that tick size tracks the rightmost significant decimal of the current price (prices have roughly five significant figures), and lot_size × tick_size ≈ 0.0001 or 0.00001 depending on the market.
BTC:  tick_size = "1",       lot_size = "0.00001"
ETH:  tick_size = "0.1",     lot_size = "0.0001"
Fetch the exact tick_size and lot_size for each market from the GET /api/v1/info endpoint before placing orders. Submitting a price or amount that is not a valid multiple returns a 500 Internal Server Error.

Last Order ID

last_order_id is an exchange-wide monotonically increasing nonce returned in all trading-related responses. It allows you to sequence events from different endpoints — REST and WebSocket — without relying on server timestamps, which can be affected by clock drift. Endpoints that include last_order_id:

REST Endpoints

  • GET /api/v1/positions
  • GET /api/v1/trades
  • GET /api/v1/orders

WebSocket Streams

  • bbo
  • trades
  • account_positions
  • account_orders
  • account_order_updates
  • account_trades
The last_order_id values are comparable across all of the above, making it straightforward to merge event streams and detect gaps or ordering inversions in your application.

Changelog Highlights

The API is actively developed. Notable recent additions include:
  • Vaults (Lakes) — full vault management API under /api/v1/lake/* (2026-05-04)
  • Spot assets — bridge info, spot balances, unified margin collateral, auto-lending (2026-04-23)
  • Batch order enhancementsCreateMarket, Edit, SetPositionTpsl, CancelStopOrder actions added (2026-04-23)
  • Builder codebuilder_code parameter on all order creation endpoints for fee attribution (2026-04-23)
  • VIP rate limit increases — higher quotas for VIP1–VIP3 tiers (2026-02-19)
  • Fee-tier rate limits — main + subaccount rate limits enforced based on fee tier (2026-02-05)
  • Last order ID — exchange-wide event sequencing nonce added across REST and WebSocket (2025-12-06)
  • Top-of-Book (TOB) order type — available on limit orders via REST and WebSocket (2025-11-10)

Build docs developers (and LLMs) love