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.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.
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.| Environment | REST | WebSocket |
|---|---|---|
| Production | https://api.pacifica.fi | wss://ws.pacifica.fi/ws |
| Testnet | https://test-api.pacifica.fi | wss://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.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-casek prefix to indicate a scaled unit.
| Format | Example | Valid? |
|---|---|---|
| All caps | BTC, ETH, SOL | ✅ |
| Lower-case k-prefix | kBONK, kPEPE | ✅ |
| Mixed case | Btc, btc, KBONK | ❌ |
Tick and Lot Size
Every market has atick_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.
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/positionsGET /api/v1/tradesGET /api/v1/orders
WebSocket Streams
bbotradesaccount_positionsaccount_ordersaccount_order_updatesaccount_trades
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 enhancements —
CreateMarket,Edit,SetPositionTpsl,CancelStopOrderactions added (2026-04-23) - Builder code —
builder_codeparameter 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)