# Table of Contents - [API | Pacifica](#api-pacifica) - [About Us | Pacifica](#about-us-pacifica) - [Close Beta Guide | Pacifica](#close-beta-guide-pacifica) - [Long-Term Vision and Roadmap | Pacifica](#long-term-vision-and-roadmap-pacifica) - [Testnet Guide | Pacifica](#testnet-guide-pacifica) - [Contract Specifications | Pacifica](#contract-specifications-pacifica) - [Overview | Pacifica](#overview-pacifica) - [Oracle Price & Mark Price | Pacifica](#oracle-price-mark-price-pacifica) - [Self-trade Prevention | Pacifica](#self-trade-prevention-pacifica) - [Margin & Leverage | Pacifica](#margin-leverage-pacifica) - [Order Types | Pacifica](#order-types-pacifica) - [Deposits & Withdrawals | Pacifica](#deposits-withdrawals-pacifica) - [Trading Fees | Pacifica](#trading-fees-pacifica) - [Liquidations | Pacifica](#liquidations-pacifica) - [Funding Rates | Pacifica](#funding-rates-pacifica) - [Fund Security | Pacifica](#fund-security-pacifica) - [Points Program | Pacifica](#points-program-pacifica) - [Educators Program | Pacifica](#educators-program-pacifica) - [VIP Program | Pacifica](#vip-program-pacifica) - [Market Maker Program | Pacifica](#market-maker-program-pacifica) - [Referral and Affiliate Program | Pacifica](#referral-and-affiliate-program-pacifica) - [Builder Program | Pacifica](#builder-program-pacifica) - [Pacifica x Extended Trading Competition | Pacifica](#pacifica-x-extended-trading-competition-pacifica) - [Bug Bounty Program | Pacifica](#bug-bounty-program-pacifica) - [REST API | Pacifica](#rest-api-pacifica) - [Markets | Pacifica](#markets-pacifica) - [Get prices | Pacifica](#get-prices-pacifica) - [Get candle data | Pacifica](#get-candle-data-pacifica) - [Audits | Pacifica](#audits-pacifica) - [Get market info | Pacifica](#get-market-info-pacifica) - [Contact Us | Pacifica](#contact-us-pacifica) - [Glossary of Terms | Pacifica](#glossary-of-terms-pacifica) - [Get historical funding | Pacifica](#get-historical-funding-pacifica) - [Get mark price candle data | Pacifica](#get-mark-price-candle-data-pacifica) - [Subaccounts | Pacifica](#subaccounts-pacifica) - [Get recent trades | Pacifica](#get-recent-trades-pacifica) - [Websocket | Pacifica](#websocket-pacifica) - [Brand Assets | Pacifica](#brand-assets-pacifica) - [Get orderbook | Pacifica](#get-orderbook-pacifica) - [Create subaccount | Pacifica](#create-subaccount-pacifica) - [Subaccount fund transfer | Pacifica](#subaccount-fund-transfer-pacifica) - [Account | Pacifica](#account-pacifica) - [List subaccounts | Pacifica](#list-subaccounts-pacifica) - [Get account settings | Pacifica](#get-account-settings-pacifica) - [Tick and lot size | Pacifica](#tick-and-lot-size-pacifica) - [Market symbols | Pacifica](#market-symbols-pacifica) - [Changelog | Pacifica](#changelog-pacifica) - [Get positions | Pacifica](#get-positions-pacifica) - [Error codes | Pacifica](#error-codes-pacifica) - [Request withdrawal | Pacifica](#request-withdrawal-pacifica) - [Update margin mode | Pacifica](#update-margin-mode-pacifica) - [Get account info | Pacifica](#get-account-info-pacifica) - [Update leverage | Pacifica](#update-leverage-pacifica) - [Get funding history | Pacifica](#get-funding-history-pacifica) - [API Config Keys | Pacifica](#api-config-keys-pacifica) - [Rate limits | Pacifica](#rate-limits-pacifica) - [Get account equity history | Pacifica](#get-account-equity-history-pacifica) - [Hardware Wallet | Pacifica](#hardware-wallet-pacifica) - [Error Handling | Pacifica](#error-handling-pacifica) - [API Agent Keys | Pacifica](#api-agent-keys-pacifica) - [Signing | Pacifica](#signing-pacifica) - [Get account balance history | Pacifica](#get-account-balance-history-pacifica) - [Operation Types | Pacifica](#operation-types-pacifica) - [Orders | Pacifica](#orders-pacifica) - [Trading operations | Pacifica](#trading-operations-pacifica) - [Get trade history | Pacifica](#get-trade-history-pacifica) - [Implementation | Pacifica](#implementation-pacifica) - [Subscriptions | Pacifica](#subscriptions-pacifica) - [Last order ID | Pacifica](#last-order-id-pacifica) - [Edit order | Pacifica](#edit-order-pacifica) - [Best bid offer (BBO) | Pacifica](#best-bid-offer-bbo-pacifica) - [Prices | Pacifica](#prices-pacifica) - [Cancel all orders | Pacifica](#cancel-all-orders-pacifica) - [Cancel order | Pacifica](#cancel-order-pacifica) - [Cancel all orders | Pacifica](#cancel-all-orders-pacifica) - [Create market order | Pacifica](#create-market-order-pacifica) - [Orderbook | Pacifica](#orderbook-pacifica) - [Candle | Pacifica](#candle-pacifica) - [Edit order | Pacifica](#edit-order-pacifica) - [Create limit order | Pacifica](#create-limit-order-pacifica) - [Cancel stop order | Pacifica](#cancel-stop-order-pacifica) - [Batch order | Pacifica](#batch-order-pacifica) - [Mark price candle | Pacifica](#mark-price-candle-pacifica) - [Cancel order | Pacifica](#cancel-order-pacifica) - [Get open orders | Pacifica](#get-open-orders-pacifica) - [Account leverage | Pacifica](#account-leverage-pacifica) - [Account margin | Pacifica](#account-margin-pacifica) - [Batch order | Pacifica](#batch-order-pacifica) - [Create position TP/SL | Pacifica](#create-position-tp-sl-pacifica) - [Create stop order | Pacifica](#create-stop-order-pacifica) - [Create limit order | Pacifica](#create-limit-order-pacifica) - [Create market order | Pacifica](#create-market-order-pacifica) - [Get order history by ID | Pacifica](#get-order-history-by-id-pacifica) - [Trades | Pacifica](#trades-pacifica) - [Get order history | Pacifica](#get-order-history-pacifica) - [Account positions | Pacifica](#account-positions-pacifica) - [Account info | Pacifica](#account-info-pacifica) - [Account orders | Pacifica](#account-orders-pacifica) - [Account trades | Pacifica](#account-trades-pacifica) - [Account order updates | Pacifica](#account-order-updates-pacifica) --- # API | Pacifica Welcome to Pacifica's API documentation. We offer complete REST and Websocket APIs to suit your trading needs. The documentation includes clear descriptions, parameter requirements, example responses, and code snippets to help developers quickly implement these endpoints in their applications. You can also use the API via the Pacifica Python SDK: [https://github.com/pacifica-fi/python-sdk](https://github.com/pacifica-fi/python-sdk) For any feedback, suggestions, and additional help with integration into Pacifica's API, please let us know in our [discord API channel](https://discord.com/channels/1325864651816435822/1378723526957334548) ! [PreviousPacifica x Extended Trading Competition](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition) [NextREST API](https://docs.pacifica.fi/api-documentation/api/rest-api) Last updated 6 months ago --- # About Us | Pacifica Pacifica was founded in January 2025 by a team of seasoned founders and builders who recognized the need for a next-generation trading platform that combines exceptional performance with user-first design principles and intelligent automation. Having witnessed the limitations of existing trading platforms - from poor execution speeds and high latency to suboptimal user experiences - we set out to build something different. Pacifica aims to deliver exceptional core trading performance through seamless user experience, enhanced by AI-powered smart trading tools that make sophisticated strategies accessible to everyone. We're not just building faster infrastructure - we're reimagining how trading should feel. Our core team brings together expertise from the world's leading crypto exchanges and protocols (Binance, FTX, Coinbase, NFTperp), top-tier financial institutions (Jane Street, Fidelity), and AI pioneers (OpenAI, DeepMind, ByteDance), with academic foundations from MIT, Stanford, NUS, and other leading institutions. This unique combination of traditional finance expertise, crypto-native experience, and cutting-edge AI capabilities positions us to solve the industry's core challenges: execution speed and quality, seamless user experience, and intelligent automation at scale. Building everything from scratch, we launched our testnet within 3 months and mainnet within 6 months - a testament to our execution speed and technical expertise. We build with best-in-class technical practices while maintaining the principles of transparency and user empowerment that define the future of finance. Pacifica has been self-funded throughout our journey. We haven't raised external capital, ensuring that all value created accrues directly to our users. [NextLong-Term Vision and Roadmap](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap) Last updated 4 months ago --- # Close Beta Guide | Pacifica [PreviousLong-Term Vision and Roadmap](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap) [NextTestnet Guide](https://docs.pacifica.fi/pacifica/testnet-guide) Last updated 1 month ago --- # Long-Term Vision and Roadmap | Pacifica ### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#our-vision) Our Vision Pacifica is building a full-stack decentralized exchange where performance never compromises custody. The end state is a venue where a trader can access every instrument they need, manage risk across a unified margin account, and execute with sub-10ms latency on both desktop and mobile, while builders are free to build on both Pacifica DEX and Pacifica L1. Pacifica builds in the open, with full API access from day one, and a builder program that treats external developers as partners, not threats. The exchange is the foundation and our ecosystem is the opportunity. ### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#what-we-have-achieved) What We Have Achieved Building everything from scratch, we launched mainnet in June 2025 and reached the top spot for perpetual DEX volume on Solana by September. We're a small team and haven't taken outside funding. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FbK3eeVGZfW8U4v2jagBq%252Fimage.png%3Falt%3Dmedia%26token%3D8eb5cd58-0001-409d-878d-49cd7f39ea69&width=768&dpr=4&quality=100&sign=eddd38b8&sv=2) Our architecture separates matching logic from settlement to achieve maximum performance. The matching engine operates off-chain for speed, delivering sub-10ms round trip API latency. Settlement and custody remain fully on-chain, non-custodial and verifiable. Users hold their keys at all times. This hybrid approach captures the performance benefits of centralized infrastructure while preserving the trust guarantees of decentralized settlement. For context, most decentralized exchanges operate in the hundreds of milliseconds, and our latency is competitive with tier-1 centralized exchanges. The full API has been available to all users from day one. Professional traders and market makers can connect freely with the same low-latency infrastructure. We've shipped a complete desktop trading platform with advanced order types, sub-account functionality and AI agent analytics. We've launched a full-fledged builder program to support teams building atop Pacifica’s liquidity. ### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#roadmap) Roadmap Our development is organized in three stages, with our purpose-built Layer 1 chain underpinning the entire stack. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FAc4YFpyP09b63Axlz1ON%252FPacifica%2520Roadmap%2520%289%29.jpg%3Falt%3Dmedia%26token%3Db3a45c98-16e9-4a74-bfef-681f5cb0860e&width=768&dpr=4&quality=100&sign=7e56489c&sv=2) #### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#phase-1-foundation-complete) Phase 1: Foundation (Complete) **Core trading engine:** Perpetual futures with up to 50x leverage, off-chain matching delivering sub-10ms round-trip latency, and on-chain settlement preserving non-custodial guarantees. We built deep liquidity through the market maker program and maintained tight spreads through sophisticated incentive design. Multi-chain integration provides seamless deposits and withdrawals. We're still early, and the results so far validate our development approach. #### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#phase-2-capital-efficiency-in-progress) Phase 2: Capital Efficiency (In Progress) This stage transforms Pacifica from a perpetual venue into a complete trading platform. **Unified Trading Accounts:** A multi-collateral margin system that accepts spot assets as collateral across perpetual and spot positions. BTC, ETH, SOL, and other major assets become fungible collateral within a single margin account. Traders can maintain spot exposure while simultaneously using that collateral to trade derivatives. The system calculates cross-margined risk in real-time, maximizing capital efficiency while maintaining robust liquidation mechanics. No more capital fragmentation across isolated positions. **Lending and Borrowing:** This integrates directly with the unified account system. When a trader's spot collateral is used to open perp positions, the system automatically borrows USD from the lending pool to cover negative USD balances. Interest rates are determined algorithmically based on utilization. For lenders, this creates a native yield opportunity backed by real trading demand rather than inflationary token emissions. The entire system operates transparently on-chain with airtight risk management in place. **Mobile App:** This extends the platform to native iOS and Android applications built for speed and reliability. Full access to perpetuals, spot, and account management with the same low-latency backend infrastructure. Optimized for the constraints of mobile networks while maintaining feature parity with desktop. #### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#phase-3-full-product-suite) Phase 3: Full Product Suite **Spot Trading:** A high-performance spot orderbook that integrates directly with the multi-collateral system. This isn't an afterthought bolted onto a derivatives platform. Spot is a core primitive that enables unified trading accounts and flexible collateral management. The same matching engine architecture that powers our perpetuals ensures institutional-grade execution for spot markets. **RWA and Exotic Derivatives: S**tocks, forex, options contracts, and structured products on-chain. One-touch options, double-no-touch options, and other instruments popular in traditional finance OTC markets become accessible to any trader with an internet connection. These products require sophisticated pricing models and robust risk management. We're building the infrastructure to handle that complexity while maintaining the UX standards that make them easily usable. ### [](https://docs.pacifica.fi/pacifica/long-term-vision-and-roadmap#pacifica-layer-1) Pacifica Layer 1 This is where everything comes together. Our long-term infrastructure strategy is built around a core principle: maximize security and verifiability without sacrificing the high performance that serious traders demand. This requires purpose-built infrastructure at every layer. Pacifica L1 is built on the Substrate framework, chosen for its modular Rust architecture, high flexibility, and ability to customize every layer of the stack, including consensus. We implement Fast HotStuff consensus, an optimized two-phase BFT protocol that achieves O(n) communication complexity through leader-based proposal aggregation. The chain achieves sub-second finality with throughput designed to scale with demand. The runtime supports both native Rust business logic compiled to WASM for maximum performance and EVM/SVM compatibility for ecosystem interoperability. Developers can write in Rust, Solidity, or C++ depending on their performance requirements. Critical exchange logic runs in optimized WASM for maximum efficiency, while EVM/SVM compatibility ensures ecosystem interoperability. **Progressive Decentralization** Security comes in layers, and we're building each one methodically: **Phase 1:** Fund state verifiability through on-chain deposit and withdrawal management. This exists today on Solana. **Phase 2:** Internal state verifiability through Pacifica’s PC-BFT consensus. User positions, open orders, and account balances become transparently verifiable on-chain. **Phase 3:** Execution logic verifiability through zero-knowledge proofs. Matching logic, liquidation calculations, and all core exchange computations become cryptographically provable. Each stage increases the trust guarantees users have in the system while maintaining the performance that makes Pacifica competitive with centralized venues. Exchange performance lives and dies at the infrastructure layer. Generalized blockchains optimize for flexibility. We optimize for one thing: the best trading experience. True decentralization requires infrastructure built for the task. We're building it. [PreviousAbout Us](https://docs.pacifica.fi/) [NextClose Beta Guide](https://docs.pacifica.fi/pacifica/close-beta-guide) Last updated 8 days ago --- # Testnet Guide | Pacifica [PreviousClose Beta Guide](https://docs.pacifica.fi/pacifica/close-beta-guide) [NextOverview](https://docs.pacifica.fi/trading-on-pacifica/overview) Last updated 1 month ago --- # Contract Specifications | Pacifica Pacifica’s perpetual contracts let you seamlessly trade cryptocurrency assets with leverage, without the need for an expiration date. Understanding the specifications of these contracts is crucial for effective trading, risk management, and maximizing your trading potential. Below is a summary of Pacifica’s key contract details. You can explore deeper into each specification through dedicated subpages linked below. ### [](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications#pacifica-contract-specifications) Pacifica Contract Specifications Specification Description Details Contract Type of perpetual contract Linear perpetual Contract Size Size per contract 1 unit of underlying spot asset IMM (Initial Maintenance Margin) Margin required to open a position 1 / (user-selected leverage), dynamically increased when Open Interest sharply rises relative to liquidity MM Maintenance Margin 50% of initial margin fraction Dynamic Margin Adjustment Margin requirement adjustments Yes (triggered by sharp increase in open interest vs. exchange liquidity, super-linear scaling of initial margin) Oracle Price Price used for liquidation & PnL Oracle-based (see Oracle Price) Delivery / Expiration Contract expiry None (continuous with hourly funding payments) Position Limit Maximum allowed position size No explicit limit per user (position size managed by dynamic margining) Account Type Margin management style Per-wallet cross or isolated margin Funding Impact Notional Notional size impacting funding rates 20,000 USDC (BTC, ETH) 6,000 USDC (other assets) Maximum Market Order Value Largest allowed market order $4M (leverage >=50), $1M (leverage 20-50),$500k (leverage 10-20), otherwise $250k Maximum Limit Order Value Largest allowed limit order 10x— maximum market order value ### [](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications#detailed-contract-information) Detailed Contract Information Explore further details for each area: * Trading Pairs: View all available perpetual markets. * [Oracle Price](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) : Understand how Pacifica calculates the oracle-based Mark Price. * * * Use this overview as your quick-reference guide, and dive deeper into each subpage for full explanations. [PreviousOverview](https://docs.pacifica.fi/trading-on-pacifica/overview) [NextOracle Price & Mark Price](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) Last updated 2 months ago --- # Overview | Pacifica Pacifica mainnet currently supports trading of over thirty five perpetual assets. Additional assets will be added based on community demand. * **Margin Systems:** Pacifica supports both Cross-Margin and Isolated-Margin trading. * **Leverage:** Varies by market from 3x to 50x. #### [](https://docs.pacifica.fi/trading-on-pacifica/overview#explore-each-section-for-further-explainations-on) Explore each section for further explainations on: * [Contract Specifications](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications) : Detailed specs of supported assets. * [Oracle Price & Mark Price](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) Breakdown of pricing mechanisms. * [Order Types](https://docs.pacifica.fi/trading-on-pacifica/order-types) : Definitions and trigger conditions. * [Margin & Leverage](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage) : Margin system breakdown. * [Funding Rates](https://docs.pacifica.fi/trading-on-pacifica/funding-rates) : Calculations and methodology. * [Trading Fees](https://docs.pacifica.fi/trading-on-pacifica/trading-fees) : Fee/VIP structures. * [Deposits & Withdrawals](https://docs.pacifica.fi/trading-on-pacifica/deposits-and-withdrawals) : Pacifica currently implements a daily deposit and withdrawal limit. * [Liquidations](https://docs.pacifica.fi/trading-on-pacifica/liquidations) : Multi-tiered liquidation and risk management. _Access to Trading on Pacifica is strictly prohibited for individuals or entities residing in, incorporated in, or operating from, but not limited to, the United States of America, Cuba, the Crimean Peninsula (including Sevastopol), Iran, Afghanistan, Syria, and North Korea (collectively, the "Restricted Jurisdictions"). Access to trading functionality from IP addresses from any Restricted Jurisdiction is programmatically restricted._ [PreviousTestnet Guide](https://docs.pacifica.fi/pacifica/testnet-guide) [NextContract Specifications](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications) Last updated 18 days ago --- # Oracle Price & Mark Price | Pacifica Pacifica’s perpetual contracts use a decentralized Oracle Price to accurately value positions and determine funding rate and is a component of Mark Price. This Oracle Price protects traders by reducing manipulation risks and ensuring market stability. Mark Price is used for liquidations, margin requirements and Unrealized PnL. ### [](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#oracle-price-calculation) Oracle Price Calculation The oracle price is updated every 3 seconds and calculated as a weighted average of prices from major exchanges. CEX Weights Binance 2 OKX 1 Bybit 1 Hyperliquid 1 ### [](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#uses-of-oracle-price-on-pacifica) Uses of Oracle Price on Pacifica The Oracle Price is crucial for several Pacifica exchange operations: * Funding Rates: Calculations rely on the Oracle Price to maintain alignment with spot markets. * Mark Price Calculation: Oracle price serves as a component of Mark Price to prevent market manipulation and ensure the accuracy of settlements. ### [](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#uses-of-mark-price-on-pacifica) Uses of Mark Price on Pacifica The Mark Price is the median value of: 1. Oracle (spot) price 2. The median of best bid, best ask, and last trade on Pacifica 3. Perpetual price from major exchanges The Mark Price is used for: * Liquidation Calculations: By using the median value of the 3 Mark Price components, Pacifica ensures fair and accurate liquidations. * Margin Requirements: Both initial and maintenance margins are determined using the Mark Price. * Unrealized PnL: Open positions are marked-to-market using the Mark Price. ### [](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#transparency-and-reliability) Transparency & Reliability Pacifica provides transparent and verifiable Oracle Prices available directly through our trading interface or via API endpoints, ensuring trust and accountability. * * * For further details or technical questions, refer to our [API documentation](https://docs.pacifica.fi/api-documentation/api) or contact our support via [Contact Us](https://docs.pacifica.fi/other/contact-us) . [PreviousContract Specifications](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications) [NextOrder Types](https://docs.pacifica.fi/trading-on-pacifica/order-types) Last updated 2 months ago --- # Self-trade Prevention | Pacifica When a new order attempts to match with a resting order placed by the same account, the existing order is cancelled, and the new order proceeds as per normal. This makes sure that no trades will happen between orders from the same account. The removed order will be labelled as "Rejected" under the "Status" column in order history. [PreviousOrder Types](https://docs.pacifica.fi/trading-on-pacifica/order-types) [NextMargin & Leverage](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage) Last updated 2 months ago --- # Margin & Leverage | Pacifica Pacifica offers Cross Margin and Isolated Margin modes. Margin mode is selected per trading pair, with Cross Margin as default. _Note: Margin mode cannot be changed for symbols with open positions. Leverage can be increased for symbols with open positions, but cannot be decreased until position is closed._ ### [](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage#cross-margin) Cross Margin Cross margin utilizes your entire account balance to support all open positions. **Account Value Calculation:** Copy account_value = account_cash_balance + pnl Profit and Loss (PnL) for cross-margined positions update continuously as market prices fluctuate, excluding isolated margin positions. ### [](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage#isolated-margin) Isolated Margin Isolated margin assigns a dedicated margin amount to each individual position. ### [](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage#initial-margin-calculation) Initial Margin Calculation Regardless of margin mode, placing an order reserves initial margin based on your entry price, position size, selected leverage. Copy initial_margin = (position_size × entry_price / leverage) #### [](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage#unrealized-pnl-and-transfer-margin-requirements) Unrealized PnL and Withdrawable Balance. Unrealised PnL can be withdrawn from isolated positions or cross-margined account account, but only if uPnL + account balance is at least 10% of the total notional position value of all open positions and meet the initial margin requirement: `withdrawable_balance = account_balance + unrealized_pnl - max(initial_margin_required, 0.1 * total_position_value)` Also, `account_balance` cannot be withdrawn past zero, regardless of uPnL. [PreviousSelf-trade Prevention](https://docs.pacifica.fi/trading-on-pacifica/self-trade-prevention) [NextFunding Rates](https://docs.pacifica.fi/trading-on-pacifica/funding-rates) Last updated 2 months ago --- # Order Types | Pacifica The following order types are available on Pacifica: * **Market:** An order that executes immediately at the best available market prices. Typically used in order to immediately enter or exit a position. * **Limit:** An order that specifies the price at which it will be executed. Limit orders can remain active based on different time-in-force settings (see below). Typically used when execution price matters more than being filled immediately * **Stop Market:** A market order that is placed when a price condition is met. Typically used to take profit or limit losses. * **Stop Limit:** A limit order that is placed when a price condition is met. **Time-In-Force:** All limit orders on Pacifica belong to one of the following TIF options. * **Good-Til-Cancelled (GTC):** The order remains active on the orderbook until it is either filled or cancelled. * **Immediate-or-Cancel (IOC):** The order attempts to match immediately at the specified price (or better). Any portion of the order that cannot is not filled immediately is cancelled. * **Add-Liquidity-Only (ALO):** Also known as **“Post Only,”** this order is added to the order-book only if it would does not immediately match against an existing order. * **Top-of-Book (TOB):** A special order type that allows "ALO (Post Only)" orders which cross the orderbook to be placed at the best bid/ask possible, instead of being cancelled. Best bid refers to lowest ask in orderbook minus one tick. Best ask refers to highest bid in orderbook plus one tick. Note: In order to protect liquidity providers from adverse selection, all market orders, TIF GTC, and TIF IOC orders are subject to a randomized 50-100ms delay. [PreviousOracle Price & Mark Price](https://docs.pacifica.fi/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) [NextSelf-trade Prevention](https://docs.pacifica.fi/trading-on-pacifica/self-trade-prevention) Last updated 26 days ago --- # Deposits & Withdrawals | Pacifica Before trading, you’ll need a compatible DeFi wallet with a Solana address connected to Pacifica, and USDC collateral to fund your trades. Pacifica supports multiple wallet types, including Phantom, Solflare, Backpack, Ledger (via browser extension), and other WalletConnect-compatible wallets. [](https://docs.pacifica.fi/trading-on-pacifica/deposits-and-withdrawals#deposits) Deposits ------------------------------------------------------------------------------------------------ **IMPORTANT:** Pacifica currently limits deposits up to a maximum of $100,000 account equity for security purposes as we scale up Closed Beta. Any additional deposits will be gated from the frontend, and API deposits over these amounts will be in held in pending. **Fees:** Gas fees apply as determined by the network. * * * [](https://docs.pacifica.fi/trading-on-pacifica/deposits-and-withdrawals#withdrawals) Withdrawals ------------------------------------------------------------------------------------------------------ **IMPORTANT:** Pacifica currently limits single account withdrawals up to a maximum of $100,000 every 24 hours for security purposes as we scale up Closed Beta. Any additional deposits will be gated from the frontend, and API deposits over these amounts will be in held in pending. Unrealised PnL can be withdrawn from isolated positions or cross-margined account account. Please see [Margin & Leverage](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage) for full details. Pacifica also enforces a time-based global withdrawal cap as a risk-mitigation mechanism that scales dynamically with withdrawal limits. This is extremely unlikely to interfere with normal user withdrawals. ### [](https://docs.pacifica.fi/trading-on-pacifica/deposits-and-withdrawals#requirements-and-notes) Requirements & Notes * **Minimum Withdrawal:** $1 (withdrawals below this amount will not be processed). * **Withdrawal Fee:** $1 is deducted from each withdrawal request to help cover gas fees. [PreviousLiquidations](https://docs.pacifica.fi/trading-on-pacifica/liquidations) [NextFund Security](https://docs.pacifica.fi/trading-on-pacifica/fund-security) Last updated 16 days ago --- # Trading Fees | Pacifica Your trading volume on Pacifica determines your fee tier. Fees tiers update daily based on an account's volume over the past 14 days. All subaccounts share the same fee tier as the master account. Subaccount volumes count toward the master account total for fee calculations. Tier 14-day Rolling Volume Maker Fee Taker Fee 1 0 0.015% 0.040% 2 \> $5,000,000 0.012% 0.038% 3 \> $10,000,000 0.009% 0.036% 4 \> $25,000,000 0.006% 0.034% 5 \> $50,000,000 0.003% 0.032% VIP 1 \> $100,000,000 0.000% 0.030% VIP 2 \> $250,000,000 0.000% 0.029% VIP 3 \> $500,000,000 0.000% 0.028% Note: * All volume thresholds refer to your total executed trading volume in USD equivalent. * Fees are settled automatically for each trade upon execution. [PreviousFunding Rates](https://docs.pacifica.fi/trading-on-pacifica/funding-rates) [NextLiquidations](https://docs.pacifica.fi/trading-on-pacifica/liquidations) Last updated 1 month ago --- # Liquidations | Pacifica Pacifica employs a robust, three-tiered liquidation process to manage positions that fall below the required maintenance margin. This multi-step approach is designed to minimize market disruption while ensuring that traders’ collateral is used effectively to cover losses. ### [](https://docs.pacifica.fi/trading-on-pacifica/liquidations#liquidation-price-formula) **Liquidation Price Formula:** Liquidation occurs when a user's account equity falls below the maintenance margin of open positions. Maintenance margin is defined as ½ the initial margin requirements on all markets, which is defined by `1 / max_leverage` of the market. Liquidation Price on Pacifica is calculated as follows: Copy liquidation_price = [price - (side * position_margin) / position_size] / (1 - side / max_leverage / 2) Where side = 1 for long, -1 for short positions. Note that the `position_margin` is `account_equity` for cross margin positions; the base `price` should be the current `mark_price` if `account_equity` already includes the unrealized PNL from `entry_price` to the current. ### [](https://docs.pacifica.fi/trading-on-pacifica/liquidations#three-tiered-liquidation-process) Three-Tiered Liquidation Process 1. **Market Liquidation:** When a user's account equity first falls below maintenance margin, but remains above the backstop liquidation threshold (defined as ⅔ of maintenance margin, see below), all open orders (including ones that would otherwise lower the users' exposure) are cancelled, and the user's positions are first liquidated by sending market orders into the orderbook. During a market liquidation, the user's positions are broken up into smaller chunks, each to be placed as an IOC order at slightly above the backstop liquidation price. The chunking strategy is dynamic and based on market leverage: `Small positions (< $2,000*max_leverage): 1 chunk (execute immediately) Large positions (>= $2,000*max_leverage): 5 chunks` `max(0.75%, maintenance_margin_ratio * 0.4)` of the value of positions liquidated in this manner are deducted by the liquidation engine. Positions large enough to be broken into chunks are sent with a small interval between each order (avrg < 1 second). If enough of the position is closed to restore required maintenance margin levels, any remaining unclosed positions and collateral remains with the trader, resulting in a partial liquidation. 2. **Backstop liquidation:** If a user's account equity falls below ⅔ of the maintenance margin, all of the users' open positions, along with remaining collateral is transferred to a Pacifica backstop liquidator. This is to prevent major orderbook disruption/wicks during large market movements. 3. **Auto-Deleveraging:** If a user's account equity falls to below $0 while still maintaining an open position (caused by tier one and tier two liquidations having insufficient liquidity to carry out the liquidations as specified. Pacifica employs Auto-Deleveraging, automatically closing opposing traders’ profitable positions based on risk priority to maintain overall market health. * * * These proactive measures ensure that Pacifica’s liquidation process remains robust and fair, protecting traders from cascading liquidations and maintaining overall market stability. [PreviousTrading Fees](https://docs.pacifica.fi/trading-on-pacifica/trading-fees) [NextDeposits & Withdrawals](https://docs.pacifica.fi/trading-on-pacifica/deposits-and-withdrawals) Last updated 2 months ago --- # Funding Rates | Pacifica Funding fees ensure perpetual contract prices closely track the underlying spot market. Depending on the prevailing funding rate, traders with open positions periodically pay or receive these fees: * Positive Funding Rate: Traders holding long positions pay traders holding short positions. * Negative Funding Rate: Traders holding short positions pay traders holding long positions. Funding rates are updated every hour, calculated based on market conditions from the previous hour. ### [](https://docs.pacifica.fi/trading-on-pacifica/funding-rates#funding-rate-calculation) Funding Rate Calculation Pacifica calculates the funding rate using two components: the Premium Index and a fixed 8-hour Interest Rate (0.01%): Copy funding_rate = (premium_index + clamp(interest_rate - premium_index, -0.05%, 0.05%))/8 **Where:** * **Premium Index** measures the deviation between the Impact Price and the Oracle Price: Copy premium_index = impact_price / oracle_price - 1 * **Impact Price** is determined by the average execution price for a defined Impact Notional from Pacifica’s orderbook: Copy impact_price = max(impact_bid_price - oracle_price, 0) - max(oracle_price - impact_ask_price, 0) The **Impact Notional** values are: Asset Impact Notional (USD) BTC $20,000 Other $6,000 * **Clamp** of +-0.05% keeps funding static for small fluctuations in premium, allowing for a steady funding rate during relatively steady market conditions Pacifica samples and updates the funding rate every **5 seconds** and displays a TWAP of the estimated next 1h funding rate. At the end of each **1-hour interval**, the average funding rate is taken and then applied to open positions, and the funding rate TWAP is reset. Funding fees per hour are capped at ±4%. **Funding payments:** * Long positions: * Positive funding rate: Account Balance reduced (pay fee) * Negative funding rate: Account Balance increased (receive fee) * Short positions: * Positive funding rate: Account Balance reduced (receive fee) * Negative funding rate: Account Balance increased (pay fee) ### [](https://docs.pacifica.fi/trading-on-pacifica/funding-rates#effect-on-isolated-positions-and-liquidations) Effect on Isolated Positions and Liquidations For isolated margin positions, funding payments are deducted from the isolated margin balance and will therefore affect the position's liquidation price. After each funding payout, Pacifica recalculates liquidation prices to reflect the adjusted margin. [PreviousMargin & Leverage](https://docs.pacifica.fi/trading-on-pacifica/margin-and-leverage) [NextTrading Fees](https://docs.pacifica.fi/trading-on-pacifica/trading-fees) Last updated 8 months ago --- # Fund Security | Pacifica In the high-stakes world of decentralized finance, security is the foundation upon which everything else is built. At Pacifica, our mission has always been to build the most powerful and secure perpetual DEX, one that rivals the performance of centralized exchanges without sacrificing the self-custodial ethos that makes DeFi revolutionary. Since our mainnet launch we have processed significant volume, earning the trust of a rapidly growing community of active traders. This trust is our most valuable asset. In order to keep up with the continuously raising stakes of growth, Pacifica is transitioning to a sophisticated hot-cold hybrid security architecture with multi-signature governance. [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#the-inherent-tension-power-vs.-protection) The Inherent Tension: Power vs. Protection -------------------------------------------------------------------------------------------------------------------------------------------------------- The core challenge for any high-performance perpetual DEX is managing the "withdrawal authority", the logic within a smart contract that permits the movement of user funds. To facilitate instant withdrawals, this authority must be readily accessible to the matching engine. However, concentrating this access in a single, always-online endpoint creates systemic risk. Most perpetual DEXs operate with a unified smart contract architecture where all user funds reside in a single upgradeable contract. In these systems, the proxy contract holds user funds and delegates calls to a logic contract. If administrators can upgrade this logic, they possess the ability to modify withdrawal permissions. The contract logic is flexible, but ultimate control rests with whoever holds the admin keys. If the withdrawal authority is compromised, all funds are exposed. Subsequent effects of this are then: if the smart contract has a vulnerability, all funds are at risk, and if admin keys are stolen, the contract logic itself can be upgraded to drain user capital. There's no segmentation, no firebreak, no defense in depth. [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#the-pacifica-protocol-layered-proactive-security) The Pacifica Protocol: Layered, Proactive Security ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- We aim to think beyond this single-point-of-failure paradigm entirely. Our new design creating a multi-layered defense system that is both resilient and non-custodial. This is the culmination of best practices implemented in a transparent, verifiable manner. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#the-hot-wallet-the-engine-of-commerce) The Hot Wallet: The Engine of Commerce This is the operational treasury and represents only a fraction of total funds. The hot wallet is managed by the matching engine, which can execute withdrawals up to the programmatic spending limit without additional approvals. This ensures legitimate user withdrawals remain instantaneous. If compromised through an engine key breach, smart contract exploit, or social engineering attack, an attacker can only access the limited funds in the hot wallet. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#the-cold-vault-the-fortress-of-funds) The Cold Vault: The Fortress of Funds The bulk of user capital resides in the cold vault, secured by a multi-signature smart contract governed by a decentralized council that is geo-distributed across multiple continents. This vault has one primary function: to replenish the hot wallet through programmatic spending limits. We've partnered with Squads Protocol, the leading multi-signature infrastructure securing over $10 billion in assets on Solana. Squads is the first formally verified program on Solana, meaning its code has undergone mathematical proofs of correctness beyond traditional auditing. The multi-signature requirement means multiple independent parties must approve any transaction before it executes, eliminating the single point of failure inherent in traditional single-key wallets. Squads enables time-locked upgrade mechanisms that introduce mandatory delays between proposal and execution, giving users visibility and the ability to exit if they disagree. Role-based access control defines who can propose, approve, and execute transactions. Emergency pause functionality requires multi-party consensus. The cold vault cannot send funds to arbitrary addresses. Its logic is constrained by design, making it technically impossible for any party to redirect funds elsewhere. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#the-unbreakable-chain-of-custody) The Unbreakable Chain of Custody The true innovation lies in the interaction between these two layers, creating a security model that provides both operational efficiency and ironclad protection. When a user requests a withdrawal, the matching engine processes it instantly from the hot wallet. If the hot wallet balance dips below a predefined threshold, a replenishment process is automatically initiated, which requires a consensus-approved transaction from the decentralized multi-sig governing the cold vault. Multiple independent signers must review and approve the transfer, ensuring that no single party can unilaterally move funds from cold storage. The cold vault then sends only the necessary amount to replenish the hot wallet up to its operational limit, never exceeding the predetermined cap. This creates a security guarantee: even in a worst-case scenario where our operational systems are fully compromised, where an attacker gains control of the matching engine, the AWS infrastructure, or even internal access credentials, they can only access the limited funds in the hot wallet. The majority of funds remain safe. Using Squads' programmatic spending limit feature, we can allocate specific withdrawal budgets to the hot wallet without requiring full multi-signature approval for every routine operation. For example, the hot wallet might have a daily limit of $5 million USDC for user withdrawals. Any attempt to exceed this limit automatically triggers multi-signature requirements. The system is self-enforcing; the blockchain itself prevents unauthorized fund movements. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#signer-level-separation-the-technical-advantage) Signer-Level Separation: The Technical Advantage Our architecture implements security at the signer level, creating distinct roles with different permissions and capabilities. The hot signer, controlled by the engine operator, can withdraw up to the Squads wallet's spending limit in a specified time duration. The cold signers, a distributed group of multi-sig members, control reserve funds and have the authority to adjust spending limits through consensus. The upgrade authority is distributed across multi-sig participants, not held by any individual or single organization. This means any single party attempting to compromise the exchange, whether external attacker or rogue insider, can only access the limited funds in the hot wallet. The spending limit acts as a firebreak, containing potential damage and preventing catastrophic loss. Let's examine potential attack scenarios: Attack Vector Single Contract Pacifica Hot/Cold Hybrid Engine compromise All funds exposed Only hot wallet funds exposed Smart contract exploit All funds at risk Only hot wallet funds at risk Admin key compromise Can upgrade to drain all funds Requires multi-sig; spending limits enforced Social engineering Single point of failure Multiple parties must be compromised Inside threat Unilateral access possible Impossible without multi-party collusion [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#why-this-is-a-better-solution) Why This is a Better Solution ------------------------------------------------------------------------------------------------------------------------------- This hot-cold hybrid model doesn't just improve upon existing security practices. It represents a fundamental rethinking of how perpetual DEXs should protect user capital. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#uncompromising-decentralization) Uncompromising Decentralization By vesting control of the cold vault in a decentralized multi-sig, we eliminate any single point of failure's ability to bring down the entire system. The distributed governance model ensures that even if several parties are compromised, the threshold mechanism prevents unauthorized access to the majority of funds. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#verifiable-security-over-blind-trust) Verifiable Security Over Blind Trust Our model allows the community to audit the key facts: the spending limit of the hot wallet and the immutable logic of the cold vault. You don't have to trust us; you can verify the security model on-chain. Every parameter, every threshold, every authorization is recorded on the blockchain and can be independently verified by anyone. Any proposed change to withdrawal authorities or spending limits requires not only multi-signature approval but also a time-locked execution period, giving users visibility into governance decisions and the ability to withdraw their funds if they disagree. ### [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#built-for-scale) Built for Scale This architecture is designed to grow with us. As our TVL expands into the hundreds of millions and even billions, the risk profile remains constant. Whether we're securing $100 million or $10 billion in user funds, the fundamental security guarantees remain unchanged: the hot wallet cap limits exposure, the multi-sig prevents unauthorized cold storage access, and the spending limits act as an automatic circuit breaker. [](https://docs.pacifica.fi/trading-on-pacifica/fund-security#conclusion-security-as-a-first-principle) Conclusion: Security as a First Principle ------------------------------------------------------------------------------------------------------------------------------------------------------ The transition to hot-cold hybrid architecture with multi-signature governance and programmatic spending limits represents more than a technical upgrade. It's a statement that we prioritize long-term security over short-term convenience, and that decentralized finance can meet the highest security standards while exceeding centralized platforms in transparency and verifiability. As we continue scaling toward becoming the leading perpetual DEX, security architecture that protects billions in user funds lays an ironclad foundation. We build for the future. [PreviousDeposits & Withdrawals](https://docs.pacifica.fi/trading-on-pacifica/deposits-and-withdrawals) [NextPoints Program](https://docs.pacifica.fi/points-program) Last updated 28 days ago --- # Points Program | Pacifica The Pacifica Points program launched on Thursday, September 4th at 00:00 UTC. Each week: * Snapshots are taken every Thursday at 00:00 UTC * Distributions occur within 24 hours of each snapshot * Weekly allocation: 10,000,000 points distributed weekly among eligible Pacifica users Earn points by engaging in organic trading activities on Pacifica via GUI or API. Self-trading, sybil or any other manipulative activities will not earn points. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FpSNVwvqS8DYy3kL6zYUt%252FPacif%2520ica%2520Points%2520Program.jpg%3Falt%3Dmedia%26token%3Ddab72128-fcc7-49cf-9a92-7c235c8afdf1&width=768&dpr=4&quality=100&sign=8f716d8e&sv=2) ### [](https://docs.pacifica.fi/points-program#faq) FAQ: #### [](https://docs.pacifica.fi/points-program#what-is-the-pacifica-points-formula) What is the Pacifica Points formula? The formula is dynamic and opaque by design, updated weekly as usage evolves. #### [](https://docs.pacifica.fi/points-program#what-activities-earn-points) What activities earn points? Many activities are tracked by our points program, and attribution for different activities may happen immediately or be applied over-time over several distributions. #### [](https://docs.pacifica.fi/points-program#who-knows-the-details-of-the-points-program) Who knows the details of the points program? Very few Pacifica team members. Only Pacifica's community members are eligible to earn points in order to ensure fairness and prevent abuse. #### [](https://docs.pacifica.fi/points-program#do-people-with-multiple-accounts-have-an-advantage-over-me) Do people with multiple accounts have an advantage over me? No. Discrete or costless actions do not yield rewards in isolation. Having 100 accounts provides no advantage over one. #### [](https://docs.pacifica.fi/points-program#do-early-users-have-an-advantage) Do early users have an advantage? Pacifica's points program is structured to balance both early supporters and long-term contributors fairly. #### [](https://docs.pacifica.fi/points-program#can-i-buy-points) Can I buy points? No. There was no prior allocation and there is no way to purchase points. They can only be earned by trading, providing feedback, and spreading the word. #### [](https://docs.pacifica.fi/points-program#can-i-trade-points-on-secondary-markets) Can I trade points on secondary markets? While Pacifica cannot/will not actively police this, we do not condone any such activity and strongly discourage this for security reasons. [PreviousFund Security](https://docs.pacifica.fi/trading-on-pacifica/fund-security) [NextReferral and Affiliate Program](https://docs.pacifica.fi/referral-and-affiliate-program) Last updated 1 month ago --- # Educators Program | Pacifica The Educators Program rewards community members who create educational content/tutorials about Pacifica. The goal is to help users learn, fill knowledge gaps, and provide high-quality resources for the community. Creators can cover a wide range of topics, including trading features, order types, funding, fees, deposits/withdrawals, points, referral programs, liquidity, roadmap items, APIs, backend systems, as well as security and compliance. Content can take any form: videos, articles, threads, infographics, visual explainers, or localised guides. Submissions must be original, accurate, and provide value to the community. To participate, creators must submit their work through the official form, including a link to the content, a brief description, and proof of authorship: [Submission Form](https://docs.google.com/forms/d/e/1FAIpQLScBsD1kmCKv3eqzxg3Y55BKry1v8S6U4yPHzU1-TjuxN-r2fQ/viewform?usp=dialog) Winning submissions are awarded up to 1,000 points. Selection is based on quality, clarity, accuracy, usefulness, and coverage of topics. Multiple winners may be recognized depending on submission volume. Rewards will be distributed once the team deems a specific topic completed and selects the winners. Available (non-completed) topics are listed in the submission form. The program is ongoing, allowing creators to contribute at any time. Resources, including official brand assets, visuals, and templates, are available to support content creation: [Brand Assets](https://docs.pacifica.fi/other/brand-assets) [PreviousVIP Program](https://docs.pacifica.fi/vip-program) [NextBug Bounty Program](https://docs.pacifica.fi/bug-bounty-program) Last updated 19 days ago --- # VIP Program | Pacifica Want to carry over your trading tier from other exchanges? If you’ve traded on other exchanges, you can verify your past 14 day trading volume and receive the equivalent VIP fee tier on Pacifica for 14 days. How to get started: 1. Open a support ticket on our [Discord](https://discord.gg/pacifica) or text @PacificaTGPortalBot on telegram; let us know you want to verify your volume and join the VIP Program. 2. Our team will guide you through a verification process to prove ownership. 3. Once verified, your external trading volume will be mapped to the appropriate Pacifica VIP tier, and your VIP fee tier will be active for the following 14 days. Notes: * Each Pacifica account can link only one external wallet for this VIP tier match. Enjoy your VIP benefits on Pacifica and thank you for trading with us! [PreviousBuilder Program](https://docs.pacifica.fi/builder-program) [NextEducators Program](https://docs.pacifica.fi/educators-program) Last updated 1 month ago --- # Market Maker Program | Pacifica ### [](https://docs.pacifica.fi/market-maker-program#program-overview) Program Overview The Pacifica Market Making program exists to ensure a healthy marketplace, benefitting traders with tight spreads and deep liquidity. The program aims to foster a fair and open competitive environment, where Liquidity Providers are able to earn rewards proportional to their relative contributions to these goals. In order to assist in liquidity provisioning, MM program participants enjoy the following: * Zero fees on maker fills * Greatly increased rate-limits * Increased deposit caps ### [](https://docs.pacifica.fi/market-maker-program#eligibility) Eligibility All users of Pacifica Exchange are eligible to participate in the Market Making program, opt-in is required in order to set up reporting channels and apply for zero-maker-fee grace periods while ramping up. To qualify for rewards beyond the initial program launch assessment period, an eligible Market Maker must meet the minimum requirement of X% of the Total MakerScore for the relevant period This amount will be determined soon, and is subject to change over time based on liquidity conditions on Pacifica. ### [](https://docs.pacifica.fi/market-maker-program#scoring) Scoring Participants in the Pacifica Market Making program are scored and rewarded based on the following criteria. For full details, please reach out to Pacifica Institutional (see below): * Maker Volume * Pairs Traded * Quote spread and depth * Quote uptime ### [](https://docs.pacifica.fi/market-maker-program#rewards) Rewards After the Market Maker’s score is calculated for each assessment period, trading rewards for the period can be received in the form of points OR cash, and makers can choose a combination of the two. The USD pool available to be distributed each period is calculated as: 20% of total trading fees collected from all market maker counterparties. The Points pool to be distributed each period is 100,000 points (50,000/week) ### [](https://docs.pacifica.fi/market-maker-program#additional-specs) Additional Specs * MM accounts earn points as per the regular points program for all non-maker activity * MM accounts pay regular taker fees based on total trading volume. * MM accounts and subaccounts are ineligible for participation in exchange-wide trading competitions unless otherwise specified. * Weekly reports will be sent summarizing maker performance. * Maker rewards will be sent during points distributions every 14 days. ### [](https://docs.pacifica.fi/market-maker-program#full-details-and-application) Full Details and Application For full Pacifica Market Making Program specs and details, as well as to apply to be part of the program, please reach out to us at [\[email protected\]](https://docs.pacifica.fi/cdn-cgi/l/email-protection#780d161c1d1e11161d1c) or open a ticket at [discord.gg/pacifica](https://discord.gg/pacifica) Note: Pacifica monitors all trading activities closely. We do not tolerate market manipulation or abusive trading activities of any kind. If we suspect a participant to be in violation, we reserve the right to modify or deny their rewards entirely. Pacifica reserves the right to modify aspects of the Market Maker Program based on changing market and liquidity conditions. [PreviousReferral and Affiliate Program](https://docs.pacifica.fi/referral-and-affiliate-program) [NextBuilder Program](https://docs.pacifica.fi/builder-program) Last updated 1 month ago --- # Referral and Affiliate Program | Pacifica ### [](https://docs.pacifica.fi/referral-and-affiliate-program#referrals) Referrals Once you have generated $10,000 in volume, you will be able to generate up to **twenty** referral codes and a referral link on [app.pacifica.fi/referral](https://app.pacifica.fi/referral) , and share them with others to use in order to sign into Pacifica as your referee. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FrS7LHqwants7QBAo83Nr%252FScreenshot%25202025-10-07%2520at%252017.47.14.png%3Falt%3Dmedia%26token%3D6aca35c9-2bfe-4e72-92cd-c7d95a1bf130&width=768&dpr=4&quality=100&sign=c271eb5e&sv=2) Referrers receive 10% of the points generated by their referred users. * Referees will receive a 5% point bonus * Fee and point rewards are automatically credited to the referrer account alongside the weekly points distribution, based on the referred users’ trading activity. * There is no application process required, every user can generate their unique referral link directly from their account dashboard after reaching the $10,000 volume threshold. NOTES: Pacifica's referral portal updates once every 15 minutes. If you have recently reached the $10,000 threshold or have recently referred friends, please wait up to 15 minutes before they appear in your portal. **How do I use a referral code?** When joining Pacifica on a fresh wallet, you will be prompted to deposit. Once depositing, you will then be prompted to enter the invite code. Using a referral code to sign up to Pacifica will attach your account as a referee to the generator of the referral code. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FGHPAozN6WSsUmpNEumyO%252FScreenshot%25202025-10-07%2520at%252017.52.29.png%3Falt%3Dmedia%26token%3Def38f584-ef86-478b-ad79-a1d95741fc20&width=768&dpr=4&quality=100&sign=6fde6877&sv=2) **How do I create a referral link?** At the top part of the referral page, you will see the “Generate Referral Link” button. Once you click it, you will be prompted to enter your preferred referral name. Once you have done that, you will be able to copy and paste the link. This will allow people to join Pacifica as your referral by just clicking it. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FWGNsYKZ7AndyXL5pmxoP%252FScreenshot%25202025-10-07%2520at%252016.59.52.png%3Falt%3Dmedia%26token%3D30a9e3ea-bf5f-444a-ab38-5a59dc45579b&width=768&dpr=4&quality=100&sign=2cbe0fc4&sv=2) **How do I use a referral link?** When joining Pacifica on a fresh wallet, through a referral link you will be prompted to connect your wallet, and then claim the referral code as shown below. Using a referral link to sign up to Pacifica will attach your account as a referee to the generator of the referral link. The referral will directly use up the amount of codes you have available. In order to claim an invite code you must deposit. ![](https://docs.pacifica.fi/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FKjOzkfHNjcglZylpw3iQ%252FScreenshot%25202025-10-07%2520at%252018.23.52.png%3Falt%3Dmedia%26token%3Da198a1bd-5a47-4615-a408-8c73ae7c67a0&width=768&dpr=4&quality=100&sign=a7d036e6&sv=2) ### [](https://docs.pacifica.fi/referral-and-affiliate-program#affiliates) Affiliates Pacifica Affiliates receive fee share **incentives of up to 40%** from their referees. Spots in the Pacifica Affiliate program are limited, and participation is a selective process based on the Pacifica team's discretion. The fee share an affiliate earns from referrals scales with the total volume their referred users generate, allowing affiliates to unlock higher percentages as they bring more value to the platform. If you believe that you have a large trading community that are interested in trading on Pacifica, please open a ticket at [discord.gg/pacifica](https://discord.gg/pacifica) for additional information. #### [](https://docs.pacifica.fi/referral-and-affiliate-program#exceptions-to-referrals-and-affiliate-rewards) Exceptions to Referrals and Affiliate Rewards Referee accounts that become part of Pacifica's market maker program will no longer provide cash reward to their referrers. [PreviousPoints Program](https://docs.pacifica.fi/points-program) [NextMarket Maker Program](https://docs.pacifica.fi/market-maker-program) Last updated 16 days ago --- # Builder Program | Pacifica Pacifica's builder program allows third-party developers (“builders”) to earn fees for orders they send on behalf of the users. These must be **approved by the user** before they can be used on any order. Once approved, the builder may include the code in any supported order creation request. Users can revoke access at any time. Builder codes affect only Pacifica’s order fee logic and are fully verified by the API according to user approval, fee limits, and builder configuration. We’re setting aside **up to a total of 10,000,000 points** over the next **three months** to reward teams building on Pacifica with Builder Program **(November 20th, 2025 → January 20th, 2026)**. **Builder Program Rewards** will be distributed based on each team’s contribution to Pacifica’s growth. To ensure fairness and meaningful impact within the ecosystem, an evaluation process will be conducted. Only teams that make significant contributions to Pacifica’s development will be eligible to receive point rewards. ### [](https://docs.pacifica.fi/builder-program#step-1-request-user-authorization) Step 1: Request User Authorization Request the user to authorize placing orders with your builder code by prompting them to sign an approval request containing your builder code as `builder_code` and the additional fee rate you want to charge as `max_fee_rate`. **Important:** The user's `max_fee_rate` must be greater than or equal to your builder's `fee_rate`. If they set a lower value, orders will be rejected. **Data to be Signed** To approve a builder code, the user signs: Copy { "timestamp": , "expiry_window": 5000, "type": "approve_builder_code", "data": { "builder_code": "YOUR_CODE", "max_fee_rate": "0.001" } } After following the [signing implementation](https://docs.pacifica.fi/api-documentation/api/signing/implementation) , compact and sort this payload recursively to generate the signature. **Complete Payload (After Signing)** Copy { "account": "6ETn....", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA", "timestamp": 1748970123456, "expiry_window": 5000, "builder_code": "YOUR_CODE", "max_fee_rate": "0.001" } **Endpoint:** `POST https://api.pacifica.fi/api/v1/account/builder_codes/approve` **Check User Approvals (Optional)** You can query which builder codes a user has approved: **Endpoint:** `GET https://api.pacifica.fi/api/v1/account/builder_codes/approvals?account=6ETn....` **Response:** Copy [\ {\ "builder_code": "YOUR_CODE",\ "description": "Test Builder Integration",\ "max_fee_rate": "0.001",\ "updated_at": 1748970123456\ }\ ] **Revoke Builder Code Authorization (Optional)** Users can revoke authorization at any time: **Data to be Signed** Copy { "timestamp": 1748970123456, "expiry_window": 5000, "type": "revoke_builder_code", "data": { "builder_code": "YOUR_CODE" } } **Complete Payload (After Signing)** Copy { "account": "6ETnufiec2CxVWTS4u5Wiq33Zh5Y3Qm6Pkdpi375fuxP", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA", "timestamp": 1748970123456, "expiry_window": 5000, "builder_code": "YOUR_CODE" } **Endpoint:** `POST https://api.pacifica.fi/api/v1/account/builder_codes/revoke` ### [](https://docs.pacifica.fi/builder-program#step-2-include-builder-code-in-order-creation-requests) **Step 2: Include Builder Code in Order Creation Requests** All order creation requests may now include your builder code in the `builder_code` parameter. Update the following endpoints: **REST API:** * `POST /api/v1/orders/create_market` * `POST /api/v1/orders/create` * `POST /api/v1/orders/stop/create` * `POST /api/v1/positions/tpsl` **WebSocket:** * `create_market_order` * `create_limit_order` * `create_stop_order` * `set_position_tpsl` **Example: Create Market Order with Builder Code** **Data to be Signed** Copy { "timestamp": 1716200000000, "expiry_window": 30000, "type": "create_market_order", "data": { "symbol": "BTC", "amount": "0.1", "side": "bid", "slippage_percent": "0.5", "reduce_only": false, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "builder_code": "YOUR_CODE" } } **Complete Payload (After Signing)** Copy { "account": "6ETnufiec2CxVWTS4u5Wiq33Zh5Y3Qm6Pkdpi375fuxP", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA", "timestamp": 1716200000000, "expiry_window": 30000, "symbol": "BTC", "amount": "0.1", "side": "bid", "slippage_percent": "0.5", "reduce_only": false, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "builder_code": "YOUR_CODE" } **Endpoint:** `POST https://api.pacifica.fi/api/v1/orders/create_market` **Example: Create Limit Order with Builder Code** **Data to be Signed** Copy { "timestamp": 1716200000000, "expiry_window": 30000, "type": "create_order", "data": { "symbol": "BTC", "amount": "0.1", "side": "bid", "tick_level": 1000, "tif": "gtc", "reduce_only": false, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "builder_code": "YOUR_CODE" } } **Endpoint:** `POST https://api.pacifica.fi/api/v1/orders/create` **Example: Set Position TP/SL with Builder Code** **Data to be Signed** Copy { "timestamp": 1716200000000, "expiry_window": 30000, "type": "set_position_tpsl", "data": { "symbol": "BTC", "side": "bid", "take_profit": { "stop_price": "55000", "limit_price": "54950", "client_order_id": "e36ac10b-58cc-4372-a567-0e02b2c3d479" }, "stop_loss": { "stop_price": "48000", "limit_price": "47950", "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479" }, "builder_code": "YOUR_CODE" } } **Complete Payload (After Signing)** Copy { "account": "6ETnufiec2CxVWTS4u5Wiq33Zh5Y3Qm6Pkdpi375fuxP", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA", "timestamp": 1716200000000, "expiry_window": 30000, "symbol": "BTC", "side": "bid", "take_profit": { "stop_price": "55000", "limit_price": "54950", "client_order_id": "e36ac10b-58cc-4372-a567-0e02b2c3d479" }, "stop_loss": { "stop_price": "48000", "limit_price": "47950", "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479" }, "builder_code": "YOUR_CODE" } **Endpoint:** `POST https://api.pacifica.fi/api/v1/positions/tpsl` **Note:** `builder_code` is provided only at the top level for TP/SL creation, not within individual `take_profit` or `stop_loss` objects. ### [](https://docs.pacifica.fi/builder-program#implementation-notes) Implementation Notes * **Signature Generation:** Follow the standard [signing implementation](https://docs.pacifica.fi/api-documentation/api/signing/implementation) for all requests * **Builder Code Placement:** The `builder_code` must be included in the `data` object when creating the payload to be signed * **Recursive Sorting:** All JSON keys must be recursively sorted alphabetically before creating the compact JSON string * **Timestamps:** All times are in milliseconds * **Expiry Window:** Defaults to 30 seconds (30,000 ms) if not specified * **Backwards Compatibility:** The `builder_code` field is optional on all order creation endpoints * **Validation:** Orders with builder codes will be rejected if: * The builder code doesn't exist * The user hasn't approved the builder code * The user's `max_fee_rate` is less than the builder's `fee_rate` ### [](https://docs.pacifica.fi/builder-program#referral-code-claim) Referral Code Claim Users can claim a referral code to establish a referral relationship with the code's owner. Referral codes can optionally generate and claim access codes automatically, providing both referral tracking and whitelist access in one action. #### [](https://docs.pacifica.fi/builder-program#how-it-works) How It Works **Step 1: Request User Authorization** Request the user to authorize claiming a referral code by prompting them to sign an approval request containing the referral code. **Data to be Signed** Copy { "timestamp": , "expiry_window": 5000, "type": "claim_referral_code", "data": { "code": "YOUR_CODE" } } After following the signing implementation, compact and sort this payload recursively to generate the signature. **Complete Payload (After Signing)** Copy { "account": "6ETn....", "agent_wallet": null, "signature": "5jHM.....", "timestamp": 1748970123456, "expiry_window": 5000, "code": "YOUR_CODE" } **Endpoint: POST /api/v1/referral/code/claim** ### [](https://docs.pacifica.fi/builder-program#error-handling) Error Handling **Common Error Codes:** * `403 Unauthorized`: User hasn't approved the builder code or `max_fee_rate` is too low * `404 Not Found`: Builder code doesn't exist * `400 Bad Request`: Invalid builder code format (must be alphanumeric, max 16 characters) ### [](https://docs.pacifica.fi/builder-program#full-details-and-onboarding) Full Details and Onboarding For more Pacifica Builder Program specs and details, as well as to onboard to the program, please reach out to us at [\[email protected\]](https://docs.pacifica.fi/cdn-cgi/l/email-protection#23564d4746454a4d4647) , open a support ticket on our [Discord](https://discord.gg/pacifica) or text @PacificaTGPortalBot on telegram. [PreviousMarket Maker Program](https://docs.pacifica.fi/market-maker-program) [NextVIP Program](https://docs.pacifica.fi/vip-program) Last updated 11 hours ago --- # Pacifica x Extended Trading Competition | Pacifica Sign-ups are open now: [Here](https://docs.google.com/forms/d/e/1FAIpQLSfCfN0jnQCgNoLOE3C2Wz9RQY1hHZnqYG_uEJk1a4Z9zUzZFQ/viewform) (All participants must register for their activity to be counted). Pacifica and Extended are jointly launching a cross-exchange trading competition, featuring individual leaderboards for each exchange as well as a unified combined leaderboard comparing all registered traders. * * * ### [](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition#competition-structure) Competition Structure Exchange leaderboards, combined leaderboard, and total leaderboards for both exchanges will be available. **Metrics tracked:** * Total Trading Volume * Total PnL (Profit and Loss) A baseline snapshot of each participant is recorded at the time of registration. Only new trading activity generated after sign-up will count toward rankings. Leaderboards refresh automatically every hour. **Leaderboard:** Coming Soon **Sign-up Form:** [Here](https://docs.google.com/forms/d/e/1FAIpQLSfCfN0jnQCgNoLOE3C2Wz9RQY1hHZnqYG_uEJk1a4Z9zUzZFQ/viewform) * * * ### [](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition#combined-rankings) Combined Rankings **Scoring formula:** (Total Volume Rank + Total PnL Rank) / 2 **Combined Leaderboard:** Ranks all Pacifica and Extended traders together using the shared formula to show how individuals compare across both exchanges. **Totals Leaderboard:** Compares the overall performance of Pacifica vs. Extended users by aggregated volume and positive PnL. **Individual Leaderboards:** Shows rankings within each exchange separately based solely on each trader’s post-sign-up activity. * * * ### [](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition#prize-pools) Prize Pools Each exchange contributes: **5% of one week’s point supply** Rewards are distributed to the top traders within each exchanges individual leaderboard, proportional to each individual’s contribution to their exchange’s total score. Each leaderboard will include a visible contribution percentage. Combined leaderboards are for comparative visibility and community engagement. Bonus prizes for those leaderboards are to be revealed at competition end. * * * ### [](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition#timeline) Timeline Start: Dec 8th, 2025, 2pm UTC End: Dec 18th, 2025, 2pm UTC * Day 1: [Joint Pacifica × Extended AMA intro](https://x.com/i/spaces/1BdxYZRYRnNKX?s=20) * Days 1–10: Competition live, Leaderboards published * Day 10+: Final results published, rewards distributed, and recap. Both Pacifica and Extended will coordinate announcement times and community updates throughout the event. * * * ### [](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition#important-notice) Important Notice You must register for your activity to be tracked. All eligible performance begins only after sign-up. * * * ### [](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition#note-on-competition-trading-behaviour) Note on Competition Trading Behaviour To maintain a fair and competitive environment, Pacifica and Extended actively monitor trading behaviour throughout the event. Suspicious or manipulative activity identified during the competition may result in disqualification. All participants are expected to follow fair trading practices at all times. Good luck to all participants. [PreviousBug Bounty Program](https://docs.pacifica.fi/bug-bounty-program) [NextAPI](https://docs.pacifica.fi/api-documentation/api) Last updated 2 days ago --- # Bug Bounty Program | Pacifica Pacifica is committed to maintaining the highest standards of security. We invite security researchers to identify and disclose vulnerabilities in a constructive and responsible manner and help us protect our users, infrastructure, and ecosystem. [](https://docs.pacifica.fi/bug-bounty-program#pacifica-bug-bounty-program-rules) Pacifica Bug Bounty Program Rules ------------------------------------------------------------------------------------------------------------------------ 1. Please submit a clear and detailed report with reproducible steps via email to [\[email protected\]](https://docs.pacifica.fi/cdn-cgi/l/email-protection) or open a ticket on Pacifica's [Discord](https://discord.gg/pacifica) . 2. If we cannot reproduce the issue from your submission, it will not qualify for a reward. 3. Social engineering attacks (e.g., phishing) against Pacifica employees or community members are strictly prohibited. 4. Please make a good faith effort to avoid privacy violations, data loss, service degradation, or interruptions. 5. Actions that negatively impact the availability of Pacifica services (e.g., DoS/DDoS) are not allowed. 6. The bug bounty does not pay-out any attacks that directly disrupt services. **Testnet Guidelines** * If you wish to test asset-related features, please do so on the Pacifica testnet at [https://test-app.pacifica.fi/trade/BTC](https://test-app.pacifica.fi/trade/BTC) using access code `Pacifica` * For testnet only vulnerabilities not reproducible on mainnet, bounty level will be lowered * Not all testnet features are eligible for the program (newly deployed features known by the team to be unstable, for example) * Reach out to the team at [\[email protected\]](https://docs.pacifica.fi/cdn-cgi/l/email-protection) or on [Discord](https://discord.gg/pacifica) for more on using the Pacifica testnet * * * ### [](https://docs.pacifica.fi/bug-bounty-program#bug-bounty-vulnerability-levels) Bug Bounty Vulnerability Levels Level Bounty Critical 10,000-25,000 USDC High 2,500-10,000 USDC Medium 500-2,500 USDC Low 500 USDC **How are the various levels of bugs/vulnerabilities defined?** To ensure consistent triage and fair rewards, vulnerabilities are classified into **Critical, High, Medium, and Low** categories. The following descriptions serve as a guide, and are not exhaustive: #### [](https://docs.pacifica.fi/bug-bounty-program#critical-vulnerabilities) Critical Vulnerabilities Critical issues directly compromise Pacifica’s **core systems, infrastructure, or smart contracts** in ways that could result in the safety of user deposits or core systems on Pacifica being compromised. #### [](https://docs.pacifica.fi/bug-bounty-program#high-risk-vulnerabilities) High-Risk Vulnerabilities High-risk issues compromise system integrity, sensitive data, or critical business logic, but with limited impact relative to Critical Vulnerabilities. #### [](https://docs.pacifica.fi/bug-bounty-program#medium-risk-vulnerabilities) Medium-Risk Vulnerabilities Medium-risk issues impact user accounts, degrade service, or allow targeted exploitation, but do not put the entire system or core contracts at risk. #### [](https://docs.pacifica.fi/bug-bounty-program#low-risk-vulnerabilities) Low-Risk Vulnerabilities Low-risk issues generally require user interaction, have limited impact, or only reveal non-critical information. * * * ### [](https://docs.pacifica.fi/bug-bounty-program#submission-process) Submission Process * Consolidate your findings neatly in writing that includes the following: * A clear description of the bug/issue. * Step-by-step instructions on reproducing the issue on our end. * Proof-of-concept (PoC) or exploit script (if applicable). * Send reports to: [\[email protected\]](https://docs.pacifica.fi/cdn-cgi/l/email-protection) (flag any such reports as \[important\] or \[urgent\]. * Alternatively, reach out to the team on [Discord](https://discord.gg/pacifica) by opening a ticket. * Include impact assessment and suggested remediation steps * Provide screenshots, videos, or other evidence to support your findings if applicable **Important Guidelines:** * If the same vulnerability is reported by multiple researchers, the first complete submission will be rewarded * Submit one vulnerability per report, unless chaining vulnerabilities is necessary to demonstrate real impact. * Multiple vulnerabilities that stem from a single root cause will be treated as one bounty. * Rewards are paid in USDC to the submitter's Pacifica account for responsible disclosure of bugs after assessment by the Pacifica team. * All research must be conducted ethically and responsibly in accordance to the rules of the Pacifica bug bounty program. * * * ### [](https://docs.pacifica.fi/bug-bounty-program#prohibited-activity) Prohibited Activity **The following activities are strictly prohibited, and will result in a report becoming ineligible for the bug bounty and/or further investigation and legal action.** * Direct testing on the Pacifica mainnet in a manner that results in/may result in service disruption or data loss. All attempts must be done on Pacifica Testnet. * Any phishing, social engineering, or physical security attacks. * Denial-of-Service (DoS) or large-scale DDoS attacks. * Testing third-party apps (SSO providers, wallets, browser extensions) outside Pacifica's control. * Violating user privacy or accessing accounts belonging to others without consent. * Public disclosure of vulnerabilities prior to their resolution without consent or authorization. * Threats, ransom demands, or publishing sensitive data without consent. * Exploiting vulnerabilities for personal financial gain beyond bug bounty rewards. * * * ### [](https://docs.pacifica.fi/bug-bounty-program#eligibility) Eligibility * Reports must be submitted to Pacifica team directly via email or Discord. Others are not accepted. * You must comply with KYC verification to be eligible for any bug bounty rewards and to be able to receive USDC payouts on Pacifica. * You must maintain strict confidentiality about discovered vulnerabilities until authorized disclosure. #### [](https://docs.pacifica.fi/bug-bounty-program#the-following-are-not-eligible-for-the-bug-bounty-program) The following are NOT eligible for the bug bounty program: * UI/UX bugs without security implications. * Reports without sufficient detail, reproducible steps, or PoC. * Vulnerabilities requiring highly improbable user actions, unrealistic market conditions or social engineering. * Issues in outdated browsers, plugins, or operating systems not supported by Pacifica. * Vulnerabilities requiring physical access to user devices. * Bugs in third-party libraries or services that don't create direct risk to Pacifica users. * Non-security related bugs such as cosmetic issues or minor functional problems. * Theoretical vulnerabilities without demonstrable security impact. * * * All submissions must meet program requirements to be eligible for rewards. Pacifica reserves full discretion in classifying reported issues and determining payout amounts. By submitting a report, you acknowledge that it becomes the property of Pacifica, and we may use, modify, or disclose the information as necessary to improve the security of our platform. In return, Pacifica is committed to treating researchers with respect and fairness. We will investigate all valid reports promptly, provide clear reasoning behind our classifications, and reward based on the severity of the issue. Most importantly, we will pursue legal action against those who do not conduct research in good faith. [PreviousEducators Program](https://docs.pacifica.fi/educators-program) [NextPacifica x Extended Trading Competition](https://docs.pacifica.fi/campaigns/pacifica-x-extended-trading-competition) Last updated 2 months ago --- # REST API | Pacifica All example API calls use the Pacifica Mainnet URL, but you can make the same requests against Testnet using the the Pacifica Testnet url. Mainnet REST endpoint URL: [https://api.pacifica.fi/api/v1](https://api.pacifica.fi/api/v1) Testnet REST endpoint URL: [https://test-api.pacifica.fi/api/v1](https://test-api.pacifica.fi/api/v1) Requests and responses use JSON. [PreviousAPI](https://docs.pacifica.fi/api-documentation/api) [NextMarkets](https://docs.pacifica.fi/api-documentation/api/rest-api/markets) Last updated 6 months ago --- # Markets | Pacifica [Get market info](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info) [Get prices](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-prices) [Get candle data](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data) [Get mark price candle data](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-mark-price-candle-data) [Get orderbook](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook) [Get recent trades](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades) [Get historical funding](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding) [PreviousREST API](https://docs.pacifica.fi/api-documentation/api/rest-api) [NextGet market info](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info) Last updated 6 months ago --- # Get prices | Pacifica Copy GET /api/v1/info/prices #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-prices#response) Response * Status 200: Success Copy { "success": true, "data": [\ {\ "funding": "0.00010529",\ "mark": "1.084819",\ "mid": "1.08615",\ "next_funding": "0.00011096",\ "open_interest": "3634796",\ "oracle": "1.084524",\ "symbol": "XPL",\ "timestamp": 1759222967974,\ "volume_24h": "20896698.0672",\ "yesterday_price": "1.3412"\ }\ ], "error": null, "code": null } Field Type Description `"funding"` decimal string funding rate paid in the past funding epoch (hour) `"mark"` decimal string Mark price, as defined above `"mid"` decimal string Mid price, defined as the average of the best bid and best ask price `"next_funding"` decimal string estimated funding rate to be paid in the next funding epoch (hour) `"open_interest"` decimal string The current open interest on this symbol (in USD) `"oracle"` decimal string Oracle price, as defined above `"symbol"` string Trading pair symbol `"timestamp"` integer Timestamp in Milliseconds `"volume_24h"` boolean Volume (USD) of this market in the past 24 hours `"yesterday_price"` decimal string Oracle price of this market 24 hours ago (USD) * Status 404: No prices data available * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-prices#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/info/prices", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet market info](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info) [NextGet candle data](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data) Last updated 2 months ago --- # Get candle data | Pacifica Copy /api/v1/kline #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data#query-parameters) Query Parameters Field Type Need Description Example `"symbol"` string required Trading pair symbol `BTC` `"interval"` string required Candlestick interval Valid values: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d `1m` `"start_time"` integer required Start time in milliseconds `1716200000000` `"end_time"` integer optional End time in milliseconds, defaults to current time if not provided `1742243220000` Copy /api/v1/kline?symbol=BTC&interval=1m&start_time=1742243160000&end_time=1742243220000 #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data#response) Response * Status 200: Successfully retrieved candle data Copy { "success": true, "data": [\ {\ "t": 1748954160000,\ "T": 1748954220000,\ "s": "BTC",\ "i": "1m",\ "o": "105376",\ "c": "105376",\ "h": "105376",\ "l": "105376",\ "v": "0.00022",\ "n": 2\ }\ ], "error": null, "code": null } Field Type Description `'t'` number Candle start time `'T'` number Candle end time `'s'` string Symbol `'i'` string Time interval of candles `'o'` decimal string Open price `'c'` decimal string Close price `'h'` decimal string High price `'l'` decimal string Low price `'v'` decimal string Volume `'n'` number Number of trades on Pacifica for specified symbol * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/kline?symbol=BTC&interval=1m&start_time=1742243160000&end_time=1742243220000", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet prices](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-prices) [NextGet mark price candle data](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-mark-price-candle-data) Last updated 11 days ago --- # Audits | Pacifica 2MB [blocksec\_pacifica-fi\_perp\_v1.0\_signed.pdf](https://727612817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO2lcakUmUFILzrKCX989%2Fuploads%2F4yEc1Q6RDoNBR9Pqm6VL%2Fblocksec_pacifica-fi_perp_v1.0_signed.pdf?alt=media&token=c2779e5b-c1f8-47eb-96f2-5eded13c32c1) PDF Download[Open](https://727612817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO2lcakUmUFILzrKCX989%2Fuploads%2F4yEc1Q6RDoNBR9Pqm6VL%2Fblocksec_pacifica-fi_perp_v1.0_signed.pdf?alt=media&token=c2779e5b-c1f8-47eb-96f2-5eded13c32c1) [PreviousChangelog](https://docs.pacifica.fi/api-documentation/changelog) [NextBrand Assets](https://docs.pacifica.fi/other/brand-assets) Last updated 6 months ago --- # Get market info | Pacifica Copy GET /api/v1/info #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info#response) Response * Status 200: Success Copy { "success": true, "data": [\ {\ "symbol": "ETH",\ "tick_size": "0.1",\ "min_tick": "0",\ "max_tick": "1000000",\ "lot_size": "0.0001",\ "max_leverage": 50,\ "isolated_only": false,\ "min_order_size": "10",\ "max_order_size": "5000000",\ "funding_rate": "0.0000125",\ "next_funding_rate": "0.0000125",\ "created_at": 1748881333944\ },\ {\ "symbol": "BTC",\ "tick_size": "1",\ "min_tick": "0",\ "max_tick": "1000000",\ "lot_size": "0.00001",\ "max_leverage": 50,\ "isolated_only": false,\ "min_order_size": "10",\ "max_order_size": "5000000",\ "funding_rate": "0.0000125",\ "next_funding_rate": "0.0000125",\ "created_at": 1748881333944\ },\ ....\ ], "error": null, "code": null } Field Type Description `"symbol"` string Trading pair symbol `"tick_size"` decimal string Tick size. All prices are denominated as a multiple of this. `"min_tick"` decimal string Minimum tick. API submitted price cannot be below this value `"max_tick"` decimal string Maximum tick. API submitted price cannot be above this value `"lot_size"` decimal string Lot size. All order sizes (token denominated) are denominated as a multiple of this. `"max_leverage"` integer Maximum leverage allowed on this symbol when opening positions `"isolated_only"` boolean If the market is set to only allow isolated positions `"min_order_size"` decimal string Minimum order size (denominated in USD) `"max_order_size"` decimal string Maximum order size (denominated in USD) `"funding_rate"` decimal string Funding rate paid in the past funding epoch (hour) `"next_funding_rate"` decimal string Estimated funding rate to be paid in the next funding epoch (hour) `"created_at"` ISO 8601 string Timestamp when the market was listed on Pacifica. Markets are returned oldest first. * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/info", headers={"Accept": "*/*"}, ) data = response.json() [PreviousMarkets](https://docs.pacifica.fi/api-documentation/api/rest-api/markets) [NextGet prices](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-prices) Last updated 10 days ago --- # Contact Us | Pacifica We’re here to help. Whether you have a question about trading, need technical support, or want to share your feedback, feel free to reach out to us through any of the channels below. #### [](https://docs.pacifica.fi/other/contact-us#community) Community Join our active community on Discord or Telegram to connect with fellow traders, ask questions, and stay updated on the latest news. * [Discord](https://discord.gg/dxddmceu4C) #### [](https://docs.pacifica.fi/other/contact-us#socials) Socials Follow us for the latest updates, announcements, and market insights. * [X](https://x.com/pacifica_fi) * * * _We value your input and are committed to ensuring a smooth, secure, and transparent trading experience on Pacifica. Your questions and feedback help us improve!_ [PreviousBrand Assets](https://docs.pacifica.fi/other/brand-assets) [NextGlossary of Terms](https://docs.pacifica.fi/other/glossary-of-terms) Last updated 8 months ago --- # Glossary of Terms | Pacifica **Auto-Deleveraging (ADL):** A last-resort mechanism that automatically reduces the profitable positions of opposing traders to help cover losses in extreme market conditions. **Backstop Liquidation:** A process where, if orderbook liquidity is insufficient to liquidate a position via market orders, the position (and remaining collateral) is transferred to a dedicated vault that systematically closes it. **Collateral:** Funds deposited into your account to secure open positions. **Cross Margin:** A margin mode that uses your entire account balance to support all open positions, improving capital efficiency. **Funding Rate:** A periodic fee, updated every hour, exchanged between long and short positions to keep the perpetual contract price aligned with the underlying spot market. **Impact Price:** The average execution price calculated for a predefined notional amount from the orderbook, used to determine the Premium Index. **Initial Margin:** The required collateral to open a position, calculated as the position size multiplied by the entry price, divided by the leverage. **Isolated Margin:** A margin mode where each position is allocated its own specific collateral, limiting risk to that individual position. **Liquidation:** The forced closure of a position when its margin falls below the required maintenance level. **Maintenance Margin:** The minimum collateral that must be maintained to keep a position open, typically set at half of the initial margin. **Maker Order:** An order that adds liquidity to the order book, such as a resting limit order. **Oracle Price (Mark Price):** An aggregated price calculated from multiple external sources (weighted median from major centralized exchanges or TWAP from decentralized exchanges) used to determine margin requirements, funding fees, and liquidation thresholds. **Premium Index:** A measure of the deviation between the Impact Price and the Oracle Price, used in funding rate calculations. **Taker Order:** An order that removes liquidity by executing against existing orders in the order book. **Time-In-Force (TIF):** The instruction that determines how long an order remains active (e.g., Good-Til-Cancelled, Immediate-or-Cancel, Add-Limit-Only). **TWAP (Time-Weighted Average Price):** A method to calculate an average price over a specific period to mitigate the impact of market volatility on execution. **Withdrawal Controls:** Mechanisms that restrict collateral withdrawals during periods of extreme volatility to ensure open positions remain adequately funded. [PreviousContact Us](https://docs.pacifica.fi/other/contact-us) Last updated 8 months ago --- # Get historical funding | Pacifica Copy GET /api/v1/funding_rate/history #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding#query-parameters) Query Parameters Field Type Need Description Example `"symbol"` string required Market symbol to query `BTC` `"limit"` integer optional Number of records to show (default 100, max 4000) `20` `"cursor"` string optional Cursor pagination to access records. Default to none `1115hVka` Copy /api/v1/funding_rate/history?symbol=BTC&limit=20&cursor=11115hVka #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding#response) Response * Status 200: Successfully retrieved funding history Copy { "success": true, "data": [ \ {\ "oracle_price": "117170.410304",\ "bid_impact_price": "117126",\ "ask_impact_price": "117142",\ "funding_rate": "0.0000125",\ "next_funding_rate": "0.0000125",\ "created_at": 1753806934249\ },\ ... \ ], "next_cursor": "11114Lz77", "has_more": true } Field Type Description `'oracle_price'` decimal string Oracle price used for [funding rate calculation](https://docs.pacifica.fi/trading-on-pacifica/funding-rates) `'bid_impact_price'` decimal string Bid impact price at time of calculation (see funding rate docs) `'ask_impact_price'` decimal string Ask impact price at time of calculation (see funding rate docs) `'funding_rate'` decimal string Last settled funding rate `'next_funding_rate'` decimal string Predicted funding rate for next settlement `'created_at'` integer Timestamp in milliseconds `'next_cursor'` string Next cursor for pagination `'has_more'` boolean True if there exists a `'next_cursor'` * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/funding_rate/history?symbol=BTC", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet recent trades](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades) [NextAccount](https://docs.pacifica.fi/api-documentation/api/rest-api/account) Last updated 1 month ago --- # Get mark price candle data | Pacifica Copy /api/v1/kline/mark #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-mark-price-candle-data#query-parameters) Query Parameters Field Type Need Description Example `"symbol"` string required Trading pair symbol `BTC` `"interval"` string required Candlestick interval Valid values: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d `1m` `"start_time"` integer required Start time in milliseconds `1716200000000` `"end_time"` integer optional End time in milliseconds, defaults to current time if not provided `1742243220000` Copy /api/v1/kline/mark?symbol=BTC&interval=1m&start_time=1742243160000&end_time=1742243220000 #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-mark-price-candle-data#response) Response * Status 200: Successfully retrieved mark price candle data Copy { "success": true, "data": [\ {\ "t": 1764126720000,\ "T": 1764126780000,\ "s": "BTC",\ "i": "1m",\ "o": "87701",\ "c": "87687.303362",\ "h": "87739",\ "l": "87687.303362",\ "v": "0.84106",\ "n": 62\ },\ {\ "t": 1764126780000,\ "T": 1764126840000,\ "s": "BTC",\ "i": "1m",\ "o": "87684.118667",\ "c": "87654",\ "h": "87684.118667",\ "l": "87645",\ "v": "4.5997",\ "n": 91\ }\ ], "error": null, "code": null } Field Type Description `'t'` number Candle start time `'T'` number Candle end time `'s'` string Symbol `'i'` string Time interval of candles `'o'` decimal string Open price `'c'` decimal string Close price `'h'` decimal string High price `'l'` decimal string Low price `'v'` decimal string Volume (always `"0"`) `'n'` number Number of trades on Pacifica in candle duration * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-mark-price-candle-data#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/kline/mark?symbol=BTC&interval=1m&start_time=1742243160000&end_time=1742243220000", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet candle data](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data) [NextGet orderbook](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook) Last updated 10 days ago --- # Subaccounts | Pacifica [Create subaccount](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/create-subaccount) [List subaccounts](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/list-subaccounts) [Subaccount fund transfer](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer) [PreviousRequest withdrawal](https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal) [NextCreate subaccount](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/create-subaccount) --- # Get recent trades | Pacifica Copy GET /api/v1/trades #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades#query-parameters) Query Parameters Field Type Need Description Example `"symbol"` string required Trading pair symbol `BTC` Copy /api/v1/trades?symbol=BTC #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades#response) Response * Status 200: Successfully retrieved recent trades Copy { "success": true, "data": [\ {\ "event_type": "fulfill_taker",\ "price": "104721",\ "amount": "0.0001",\ "side": "close_long",\ "cause": "normal",\ "created_at": 1765006315306\ }\ ], "error": null, "code": null, "last_order_id": 1557404170 } Field Type Description `'event_type'` string `"fulfill_taker"` if maker `"fulfill_maker"` if taker `'price'` decimal string Price in USD at which trade event has occurred `'amount'` decimal string Amount in token denomination for which the trade has occurred for. `'side'` string `"open_long" "open_short" "close_long" "close_short"` `'cause'` string `"normal"` regular user-initiated trading `"market_liquidation"` position was liquidated due to insufficient margin `"backstop_liquidation"` position was liquidated by backstop mechanism `"settlement"` position was closed due to Auto-Deleveraging (ADL) or other settlement `'created_at'` integer Timestamp in milliseconds of trade event `'last_order_id'` integer Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/trades?symbol=BTC", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet orderbook](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook) [NextGet historical funding](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding) Last updated 7 hours ago --- # Websocket | Pacifica Mainnet websocket URL: [wss://ws.pacifica.fi/ws](wss://ws.pacifica.fi/ws) Testnet websocket URL: [wss://test-ws.pacifica.fi/ws](wss://test-ws.pacifica.fi/ws) The API service provides a universal endpoint for websocket streams. The subscribed data will be streamed in the corresponding channel after the connection is established. ### [](https://docs.pacifica.fi/api-documentation/api/websocket#subscription-message) Subscription Message Copy { "method": "subscribe", "params": { ... } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket#unsubscription-message) Unsubscription Message Copy { "method": "unsubscribe", "params": { ... } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket#heartbeat-and-timeout) Heartbeat and Timeout A webscoket connection will be closed if no message is sent for the past 60 seconds, or the connection has been alive for 24 hours. To keep the connection alive without messages in 60 seconds, we can send a heartbeat message Copy { "method": "ping" } and alive connection will respond with Copy { "channel": "pong" } [PreviousGet order history by ID](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id) [NextSubscriptions](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions) Last updated 6 months ago --- # Brand Assets | Pacifica This section provides guidelines for using Pacifica’s brand assets to ensure a consistent and professional presentation across all channels. Whether you are a partner, media outlet, or community member, please follow these guidelines when using our logos, colors, and other visual elements. _Download high-resolution logos and vector files from our:_ [_Brand Assets Repository._](https://drive.google.com/drive/folders/1cpktvx3Ir4OZVjEiyqY3VcY3Y87_PTnb?usp=sharing) [PreviousAudits](https://docs.pacifica.fi/other/audits) [NextContact Us](https://docs.pacifica.fi/other/contact-us) Last updated 8 months ago --- # Get orderbook | Pacifica Copy /api/v1/book #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook#query-parameters) Query Parameters Field Type Need Description Example `"symbol"` string required Trading pair symbol `BTC` `"agg_level"` integer no Aggregation level for price grouping. Defaults to `1` `1` Copy api/v1/book?symbol=BTC #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook#response) Response * Status 200: Successfully retrieved book data Copy { "success": true, "data": { "s": "BTC", "l": [\ [\ {\ "p": "106504",\ "a": "0.26203",\ "n": 1\ },\ {\ "p": "106498",\ "a": "0.29281",\ "n": 1\ }\ ],\ [\ {\ "p": "106559",\ "a": "0.26802",\ "n": 1\ },\ {\ "p": "106564",\ "a": "0.3002",\ "n": 1\ },\ ]\ ], "t": 1751370536325 }, "error": null, "code": null } Field Type Description `'s'` string Symbol `'l'` array Two-dimensional array containing bids (index 0) and asks (index 1). Each index contains up to 10 levels. `'t'` string Response timestamp in milliseconds `'p'` decimal string Price level `'a'` decimal string Total amount at price level `'n'` integer Number of orders at level * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook#code-example-python) Code Example (Python) Copy import requests response = requests.get( "api.pacifica.fi/api/v1/book?symbol=BTC", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet mark price candle data](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-mark-price-candle-data) [NextGet recent trades](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades) Last updated 5 months ago --- # Create subaccount | Pacifica The subaccount creation process follows the below steps. 1. The main account must authorize the creation of a subaccount under its control 2. The subaccount must consent to being controlled by the main account 3. The API server must verify both signatures to prevent unauthorized subaccount creation Valid addresses must be used in order to establish main/subaccount relationships via API: * Neither account can be a subaccount of another account. * The subaccount address needs to be whitelisted (have entered an access code) * The subaccount address cannot have any deposit/trade history Please refer to the [Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/create_subaccount.py) for a comprehensive guide on subaccount creation via API Copy POST /api/v1/account/subaccount/create #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/create-subaccount#request-body) Request Body Field Type Need Description Example `"main_account"` string required Main account wallet address `42trU9A5...` `"subaccount"` string required Subaccount wallet address `69trU9A5...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"main_signature"` string required Main account signature `5j1Vy9Uq...` `"sub_signature"` string required Subaccount signature `4k2Wx8Zq...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "main_account": "42trU9A5...", "subaccount": "69trU9A5...", "main_signature": "5j1Vy9Uq...", "sub_signature": "4k2Wx8Zq...", "timestamp": 1716200000000, "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/create-subaccount#response) Response * Status 200: Subaccount created successfully Copy { "success": true, "data": null, "error": null, "code": null, } * Status 400: Bad request Copy { "success": false, "data": null, "error": "Account already exists: CRTxBM...", "code": 2 } * Status 500: Internal server error [PreviousSubaccounts](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts) [NextList subaccounts](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/list-subaccounts) Last updated 1 month ago --- # Subaccount fund transfer | Pacifica Please refer to the [Python SDK](https://github.com/pacifica-fi/python-sdk/blob/main/rest/transfer_subaccount_fund.py) for a comprehensive guide on subaccount fund transfer via API Copy POST /api/v1/account/subaccount/transfer #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer#request-body) Request Body Field Type Need Description Example `"account"` string required Sender account address `42trU9A5...` `"signature"` string required Sender account signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"to_account"` string required Recipient wallet address `69trU9A5...` `"amount"` decimal string required Transfer amount (in USDC) `420.69` Copy { "account": "AwX6321...", "signature": "65L9qPp...", "timestamp": 1749228826313, "expiry_window": 5000, "to_account": "CRTxBM...", "amount": "420.69" } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer#response) Response * Status 200: Subaccount created successfully Copy Status Code: 200 { "success": true, "data": { "success": true, "error": null }, "error": null, "code": null } * Status 400: Bad request Copy Status Code: 400 { "success": false, "data": null, "error": "Insufficient balance for AwX6321: 420.69 (account value: 336.9100000000000000000000)", "code": 5 } * Status 500: Internal server error [PreviousList subaccounts](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/list-subaccounts) [NextOrders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders) Last updated 6 months ago --- # Account | Pacifica [Get account info](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info) [Get account settings](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings) [Update leverage](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage) [Update margin mode](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode) [Get positions](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions) [Get trade history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history) [Get funding history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-funding-history) [Get account equity history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-equity-history) [Get account balance history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history) [Request withdrawal](https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal) [PreviousGet historical funding](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding) [NextGet account info](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info) Last updated 6 months ago --- # List subaccounts | Pacifica Copy POST /api/v1/account/subaccount/list #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/list-subaccounts#request-body) Request Body Field Type Need Description Example `"account"` string required Main account wallet address `42trU9A5...` `"signature"` string required Main account signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42txU9As...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/list-subaccounts#response) Response * Status 200: Subaccounts listed successfully Copy { "success": true, "data": { "subaccounts": [\ {\ "address": "69txU9As...",\ "balance": "1000.50",\ "pending_balance": "0.00",\ "fee_level": 1,\ "fee_mode": "auto",\ "use_ltp_for_stop_orders": false,\ "created_at": 1716200000000\ }\ ] }, "error": null, "code": null } Field Type Description `'address'` string Current account balance, defined as amount of USD in account before settlement `'balance'` decimal string Subaccount balance in USD `'pending_balance'` decimal string Amount of subaccount balance in pending status (deposit request is successful, waiting on confirmation) `'fee_level'` integer Current fee tier of account, determined by trading volume `'fee_mode'` string `"auto"` by default `'use_ltp_for_stop_orders'` boolean Does this subaccount use last traded price to trigger stop orders? `'created_at'` integer Creation timestamp in milliseconds * Status 400: Bad request Copy { "success": false, "data": null, "error": "Invalid signature format", "code": null } * Status 401: Unauthorized Copy { "success": false, "data": null, "error": "Signature verification failed", "code": null } * Status 403: Forbidden Copy { "success": false, "data": null, "error": "Account not whitelisted", "code": null } [PreviousCreate subaccount](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/create-subaccount) [NextSubaccount fund transfer](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer) Last updated 1 month ago --- # Get account settings | Pacifica Copy GET /api/v1/account/settings #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required Account address `42trU9A5...` Copy /api/v1/account/settings?account=42trU9A5... #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings#response) Response NOTE: Upon account creation, all markets have margin settings default to cross margin and leverage default to max. When querying this endpoint, all markets with default margin and leverage settings on this account will return blank. * Status 200: Successfully retrieved account settings Copy { "success": true, "data": [\ {\ "symbol": "WLFI",\ "isolated": false,\ "leverage": 5,\ "created_at": 1758085929703,\ "updated_at": 1758086074002\ }\ ], "error": null, "code": null } Field Type Description `"symbol"` string Trading pair symbol `"isolated"` boolean If the account is set to isolated margining for this symbol `"leverage"` integer Current leverage set by the user (default to max) `"created_at"` integer Timestamp in milliseconds when these settings were adjusted from their default `"updated_at"` integer Timestamp in milliseconds when these settings were last updated * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/account/settings?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet account info](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info) [NextUpdate leverage](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage) Last updated 2 months ago --- # Tick and lot size | Pacifica Both `'price'` and `'amount'` fields in order related API operations are subject to rounding, needing to be multiples tick and lot size. Generally `tick_size` is determined by the rightmost decimal place of a symbol's current price, and prices generally have five significant figures, with the exception of assets with more than six integer places, where sig.figs = #of integer places. For example: If `'price' = 123.45`, expect `'tick_size' = 0.01` If `'price' = 123456`, expect `'tick_size' = 1` Generally, `lot_size*tick_size = 0.0001 or 0.00001`, based on the market. For the exact implemented `tick_size` and `lot_size` of each market, call the [market info](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info) endpoint to verify. [](https://docs.pacifica.fi/api-documentation/api/tick-and-lot-size#rounding) Rounding ------------------------------------------------------------------------------------------- Pacifica accepts requests containing `'price'` and `'amount'` fields only when they are multiples of `tick_size` and `lot_size` respectively. Any requests with incorrectly rounded `'price'` and `'amount'` fields will return `'"Internal server error","code":500'` For example: BTC has `"tick_size": "1"`, `"lot_size": "0.00001"` A request where `"amount": "0.000005"` will return `Status 500: Internal server error` A request where `"price": "100_000.5"` will return `Status 500: Internal server error` A request where `"amount": "0.00002"` will be accepted A request where `"price": "100_001"` will be accepted [PreviousMarket symbols](https://docs.pacifica.fi/api-documentation/api/market-symbols) [NextError codes](https://docs.pacifica.fi/api-documentation/api/error-codes) Last updated 6 months ago --- # Market symbols | Pacifica For example, `'BTC'` is the expected form in requests, whereas requests with symbol field `'Btc'` or`'btc'` will fail. All markets symbols are capitalized, except for markets with abbreviated numerical prefixes such as `'kBONK'` and `'kPEPE'` , which have the prefix in lower-case. Requests containing symbol fields such as `'KBONK'`, `'kbonk'`, or `'kBonk'` will fail. [PreviousAPI Config Keys](https://docs.pacifica.fi/api-documentation/api/rate-limits/api-config-keys) [NextTick and lot size](https://docs.pacifica.fi/api-documentation/api/tick-and-lot-size) Last updated 1 month ago --- # Changelog | Pacifica ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-12-06) 2025-12-06 **REST API & WS** * Last order ID added \[NEW\] * Added field in multiple REST and WS endpoints as an exchange-wide identifier to order all exchange events ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-11-19) 2025-11-19 **REST API** * Market info endpoint updated \[UPDATE\] * Added `created_at` field to /api/v1/info response showing when each market was listed **WEBSOCKET** * Account positions snapshot \[UPDATE\] * account\_positions websocket endpoint now returns immediate snapshot of current positions upon subscription * Batch orders \[NEW\] * Order batching now supported via websocket * Best bid offer (BBO) \[NEW\] * bbo endpoint now supported via websocket * constantly streams top of book for selected symbol **REST API & WS** * Edit order type added \[NEW\] * Added endpoint in REST and WS to edit price and/or size of existing orders * Mark price candle added \[NEW\] * Added endpoint in REST and WS to show mark price candles * Returns candle data based on mark price instead of traded prices * Batch order speed bump optimization \[UPDATE\] * Speed bump now applied conditionally based on order types in batch * Only applied if batch contains market orders or limit orders with TIF GTC/IOC * Speed bump not applied if batch only contains ALO/TOB orders, cancellations, or TP/SL updates ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-11-12) 2025-11-12 **GENERAL API** * Taker latency increased. \[UPDATE\] * All market orders, TIF GTC, and TIF IOC orders are subject to a ~200ms delay ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-11-10) 2025-11-10 **REST API & WS** * [Top-of-Book (TOB)](https://docs.pacifica.fi/trading-on-pacifica/order-types) TIF order type added \[NEW\] * Useable in: * Frontend GUI under Limit, TIF, TOB (Post Only) * [Create limit order REST API](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order) endpoint * [Batch order REST API](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order) endpoint * [Create limit order websocket](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order) endpoint ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-11-09) 2025-11-09 **GENERAL API** * Taker latency added. \[NEW\] * All market orders, TIF GTC, and TIF IOC orders are subject to a randomized 50-100ms delay ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-10-30) 2025-10-30 **REST API** * Cursor based pagination added for all history endpoints \[UPDATE\] * Offset pagination deprecated ### [](https://docs.pacifica.fi/api-documentation/changelog#id-2025-10-25) 2025-10-25 **REST API** * [List subaccounts](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/list-subaccounts) \[NEW\] * Added a new endpoint to retrieve subaccount information **WEBSOCKET** * [Orderbook websocket](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook) \[UPDATE\] * 'book' websocket update interval improved from 500ms to 100ms [PreviousLast order ID](https://docs.pacifica.fi/api-documentation/api/last-order-id) [NextAudits](https://docs.pacifica.fi/other/audits) Last updated 5 hours ago --- # Get positions | Pacifica Copy GET /api/v1/positions #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required Connected wallet address `42trU9A5...` Copy /api/v1/positions?account=42trU9A5... #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions#response) Response * Status 200: Successfully retrieved account information Copy { "success": true, "data": [\ {\ "symbol": "AAVE",\ "side": "ask",\ "amount": "223.72",\ "entry_price": "279.283134",\ "margin": "0", // only shown for isolated margin\ "funding": "13.159593",\ "isolated": false,\ "created_at": 1754928414996,\ "updated_at": 1759223365538\ }\ ], "error": null, "code": null, "last_order_id": 1557431179 } Field Type Description `"symbol"` string Trading pair symbol `"side"` string Whether the position is long/short `"entry_price"` decimal string Entry price of the position. Takes VWAP if position was opened by multiple trades executed at different prices. `"margin"` decimal string Amount of margin allocated to an isolated position (only shown when isolated) `"funding"` decimal string Funding paid by this position since open `"isolated"` boolean If the position is opened in isolated margin mode `"created_at"` integer Timestamp in milliseconds when these settings were adjusted from their default `"updated_at"` integer Timestamp in milliseconds when these settings were last updated `"last_order_id"` integer Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/positions?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() [PreviousUpdate margin mode](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode) [NextGet trade history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history) Last updated 7 hours ago --- # Error codes | Pacifica ### [](https://docs.pacifica.fi/api-documentation/api/error-codes#http-status-codes-rest-api) HTTP Status Codes (REST API) 400 Bad Request 403 Forbidden: no access code/restricted region 404 Not Found 409 Conflict 422 Business Logic Error - See below 429 Too Many Requests - Rate limit exceeded 500 Internal Server Error 503 Service Unavailable 504 Gateway Timeout ### [](https://docs.pacifica.fi/api-documentation/api/error-codes#business-logic-errors-code-422) Business Logic Errors (Code 422) 0 UNKNOWN 1 ACCOUNT\_NOT\_FOUND 2 BOOK\_NOT\_FOUND 3 INVALID\_TICK\_LEVEL 4 INSUFFICIENT\_BALANCE 5 ORDER\_NOT\_FOUND 6 OVER\_WITHDRAWAL 7 INVALID\_LEVERAGE 8 CANNOT\_UPDATE\_MARGIN 9 POSITION\_NOT\_FOUND 10 POSITION\_TPSL\_LIMIT\_EXCEEDED ### [](https://docs.pacifica.fi/api-documentation/api/error-codes#websocket-error-codes) WebSocket Error Codes 200 SUCCESS\_CODE 400 INVALID\_REQUEST\_CODE 401 INVALID\_SIGNATURE\_CODE 402 INVALID\_SIGNER\_CODE 403 UNAUTHORIZED\_REQUEST\_CODE 420 ENGINE\_ERROR\_CODE 429 RATE\_LIMIT\_EXCEEDED\_CODE 500 UNKNOWN\_ERROR\_CODE [PreviousTick and lot size](https://docs.pacifica.fi/api-documentation/api/tick-and-lot-size) [NextLast order ID](https://docs.pacifica.fi/api-documentation/api/last-order-id) Last updated 5 days ago --- # Request withdrawal | Pacifica Copy POST /api/v1/account/withdraw #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"amount"` string required Amount to withdraw in USDC `100.50` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "amount": "100.50", "agent_wallet": "69trU9A5...", "expiry_window": 30000, } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal#response) Response * Status 200: Success Copy { "success": true } * Status 400: Invalid request parameters * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "amount": "100.50" } response = requests.post( "/api/v1/account/withdraw", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousGet account balance history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history) [NextSubaccounts](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts) Last updated 6 months ago --- # Update margin mode | Pacifica Copy POST /api/v1/account/margin #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode#operation-type-for-signing) Operation Type (for signing) Header Field Type Content "type" string `"update_margin_mode"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"symbol"` string required Trading pair symbol `BTC` `"is_isolated"` boolean required Margin mode (true for isolated, false for cross) `false` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` Copy { "account": "42trU9A5...", "symbol": "BTC", "is_isolated": false, "timestamp": 1716200000000, "expiry_window": 30000, "agent_wallet": "69trU9A5...", "signature": "5j1Vy9Uq..." } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode#response) Response * Status 200: Margin mode updated successfully Copy { "success": true } * Status 400: Invalid request parameters Copy { "error": "Invalid margin mode", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq", "timestamp": 1716200000000, "symbol": "BTC", "is_isolated": false } response = requests.post( "/api/v1/account/margin", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousUpdate leverage](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage) [NextGet positions](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions) Last updated 6 months ago --- # Get account info | Pacifica Copy GET /api/v1/account #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required Account address `42trU9A5...` Copy /api/v1/account?account=42trU9A5... #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info#response) Response * Status 200: Successfully retrieved account information Copy { "success": true, "data": [{\ "balance": "2000.000000",\ "fee_level": 0,\ "account_equity": "2150.250000",\ "available_to_spend": "1800.750000",\ "available_to_withdraw": "1500.850000",\ "pending_balance": "0.000000",\ "total_margin_used": "349.500000",\ "cross_mmr": "420.690000",\ "positions_count": 2,\ "orders_count": 3,\ "stop_orders_count": 1,\ "updated_at": 1716200000000,\ "use_ltp_for_stop_orders": false\ }\ ], "error": null, "code": null } Field Type Description `'balance'` decimal string Current account balance, defined as amount of USD in account before settlement `'fee_level'` integer Current fee tier of account, determined by trading volume `'account_equity'` decimal string Account balance + unrealized PnL `'available_to_spend'` decimal string Amount of account equity that is available to used to margin for open positions and orders `'available_to_withdraw'` decimal string Amount that is available to withdraw out from the exchange `'pending_balance'` decimal string Amount of account balance in pending status (deposit request is successful, waiting on confirmation) `'total_margin_used'` decimal string Amount of account equity currently being used to margin for open positions and orders `'cross_mmr'` decimal string The maintenance margin required under the cross mode `'positions_count'` integer Number of open positions (isolated and cross) `'orders_count'` integer Number of open orders across all markets (excludes stop orders) `'stop_orders_count'` integer Number of open stop orders across markets `'updated_at'` integer Timestamp in milliseconds of last account info update `'use_ltp_for_stop_orders'` boolean If the account uses last traded price to trigger stop orders * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/account?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() [PreviousAccount](https://docs.pacifica.fi/api-documentation/api/rest-api/account) [NextGet account settings](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings) Last updated 1 month ago --- # Update leverage | Pacifica Copy POST /api/v1/account/leverage #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"update_leverage"` Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"symbol"` string required Trading pair symbol `BTC` `"leverage"` integer required New leverage value `10` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` Copy { "account": "42trU9A5...", "symbol": "BTC", "leverage": 10, "timestamp": 1716200000000, "expiry_window": 30000, "agent_wallet": "69trU9A5...", "signature": "5j1Vy9UqY..." } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage#response) Response * Status 200: Leverage updated successfully Copy { "success": true } * Status 400: Invalid request parameters Copy { "error": "Invalid leverage", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "leverage": 10 } response = requests.post( "/api/v1/account/leverage", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousGet account settings](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings) [NextUpdate margin mode](https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode) Last updated 6 months ago --- # Get funding history | Pacifica Copy GET /api/v1/funding/history #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-funding-history#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required Trading pair symbol `42trU9A5...` `"limit"` integer optional Maximum number of records to return default system defined limit `100` `"cursor"` string optional Cursor pagination to access records. Default to none `1115hVka` Copy /api/v1/funding/history?account=42trU9A5...&limit=20&cursor=11115hVka #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-funding-history#response) Response * Status 200: Successfully retrieved funding history Copy { "success": true, "data": [\ {\ "history_id": 2287920,\ "symbol": "PUMP",\ "side": "ask",\ "amount": "39033804",\ "payout": "2.617479",\ "rate": "0.0000125",\ "created_at": 1759222804122\ },\ ...\ ], "next_cursor": "11114Lz77", "has_more": true } Field Type Description `"history_id"` integer History id of trade `"symbol"` string Trading pair symbol `"side"` string If the position resulting in the funding payment was long or short (bid or ask) `"amount"` decimal string Amount (in token denomination) of the position that resulted in the funding payment `"payout"` decimal string Funding paid (in USD) `"rate"` decimal string Funding rate that was used to calculate the payput `"created_at"` integer Timestamp in milliseconds when the funding payment was logged `'next_cursor'` string Next cursor for pagination `'has_more'` boolean True if there exists a `'next_cursor'` * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-funding-history#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/funding/history?account=42trU9A5...&limit=20&cursor=11115hVka", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet trade history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history) [NextGet account equity history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-equity-history) Last updated 1 month ago --- # API Config Keys | Pacifica Pacifica offers API Config Key rate limiting on APIs that allows for more flexible limits. For more information around API Config Key limits, please reach out to us in the [Discord API channel](https://discord.com/channels/1325864651816435822/1378723526957334548) . API Config Keys are generated via REST API. The Python SDK provides examples for how API Config Key can be generated, listed and revoked: [https://github.com/pacifica-fi/python-sdk/blob/main/rest/api\_config\_keys.py](https://github.com/pacifica-fi/python-sdk/blob/main/rest/api_config_keys.py) . Each account can have up to 5 API Config Keys. Copy POST /api/v1/account/api_keys/create POST /api/v1/account/api_keys/revoke POST /api/v1/account/api_keys #### [](https://docs.pacifica.fi/api-documentation/api/rate-limits/api-config-keys#request-body) Request Body: Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` #### [](https://docs.pacifica.fi/api-documentation/api/rate-limits/api-config-keys#response) Response Copy { "data": { "api_key": "AbCdEfGh_2mT8x..." } } Note: API Config Keys are generated with a prefix for fast lookup Format: `"{8_char_prefix}_{base58_encoded_uuid}"` ### [](https://docs.pacifica.fi/api-documentation/api/rate-limits/api-config-keys#using-a-pacifica-api-config-key) Using a Pacifica API Config Key Pacifica's API Config Keys are used to enhance websocket rate-limiting. The default rate for an API Config Key follows the same restrictions as IP-based rate limits. Pacifica API Config Keys are used in the connection header to specify API Config Key rate limiting. Using the Python SDK as an example, * for Websockets, add `extra_headers={"PF-API-KEY": "your_rate_limit_key"}`into `websockets.connect` * for REST APIs, add `"PF-API-KEY": "your_rate_limit_key"` into `headers` with `{"Content-Type": "application/json"}` [PreviousRate limits](https://docs.pacifica.fi/api-documentation/api/rate-limits) [NextMarket symbols](https://docs.pacifica.fi/api-documentation/api/market-symbols) Last updated 2 months ago --- # Rate limits | Pacifica ### [](https://docs.pacifica.fi/api-documentation/api/rate-limits#credit-quotas) Credit Quotas The API config key system allows Pacifica to provision higher rate limits to verified users, ensuring real traders have adequate resources while protecting against abuse. Tier Base Credits/60s Unidentified IP 125 Valid API Config Key 300 These are base quotas and may be increased based on account reputation. ### [](https://docs.pacifica.fi/api-documentation/api/rate-limits#credit-costs) Credit Costs Action Unidentified IP API Config Key Standard request/action 1 1 Order cancellation 0.5 0.5 Heavy GET requests 3–12 1–3 When credits are exhausted, requests return HTTP 429. ### [](https://docs.pacifica.fi/api-documentation/api/rate-limits#websocket-limits) WebSocket Limits * Max 300 concurrent connections per IP * Max 20 subscriptions per channel per connection ### [](https://docs.pacifica.fi/api-documentation/api/rate-limits#checking-your-quota) Checking Your Quota > **Note:** All credit values are multiplied by 10 to support fractional costs (e.g., `r=1200` = 120.0 credits). **REST API** — Response headers: Copy ratelimit: "credits";r=1200;t=32 ratelimit-policy: "credits";q=1250;w=60 **WebSocket** — `rl` field in action responses: Copy {"rl": {"r": 1200, "q": 1250, "t": 32}} Field Description `r` Remaining credits `t` Seconds until refresh `q` Total quota per window `w` Window size in seconds [PreviousAPI Agent Keys](https://docs.pacifica.fi/api-documentation/api/signing/api-agent-keys) [NextAPI Config Keys](https://docs.pacifica.fi/api-documentation/api/rate-limits/api-config-keys) Last updated 10 days ago --- # Get account equity history | Pacifica Copy GET /api/v1/portfolio #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-equity-history#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"time_range"` string required Time range of history: `1d`, `7d`, `14d`, `30d`, `all` `7d` `"start_time"` integer optional Start time in milliseconds `1760271000000` `"end_time"` integer optional End time in milliseconds `1761842220000` `"limit"` integer optional Maximum number of records to return, defaults to 100 `100` Copy /api/v1/portfolio?account=42trU9A5...&time_range=7d #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-equity-history#response) Response * Status 200: Successfully retrieved portfolio history Copy { "success": true, "data": [\ {\ "account_equity": "61046.308885",\ "pnl": "9297.553505",\ "timestamp": 1761177600000\ },\ ...\ ], "error": null, "code": null } Field Type Description `'account_equity'` decimal string Account equity (balance + unrealized PnL) at last update `'PnL'` decimal string PnL of account since creation `'timestamp'` integer Timestamp in milliseconds of last account equity update * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-equity-history#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/portfolio?account=42trU9A5...&time_range=7d", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet funding history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-funding-history) [NextGet account balance history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history) Last updated 1 month ago --- # Hardware Wallet | Pacifica Pacifica supports hardware wallet signature authentication via Ed25519 [off-chain message signing](https://github.com/solana-labs/solana/blob/master/docs/src/proposals/off-chain-message-signing.md) . To use hardware wallet, after constructing the [message bytes](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-7.-convert-to-bytes-and-generate-signature) , prepend it with the `\xffsolana offchain` header together with message length, version information, etc. Then, in the [signature to send](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-8.-build-final-request) , use `hardware` as the `type` : Copy ... "signature": { "type": "hardware", "value": "2V4Y7Mpk...", }, ... For more details, refer to [this example](https://github.com/pacifica-fi/python-sdk/blob/2b5e629eb15d86c1a229df5d1847f5000f113ec9/rest/transfer_subaccount_fund_hardware.py#L27-L47) in the Python SDK. [PreviousError Handling](https://docs.pacifica.fi/api-documentation/api/signing/error-handling) [NextAPI Agent Keys](https://docs.pacifica.fi/api-documentation/api/signing/api-agent-keys) Last updated 6 months ago --- # Error Handling | Pacifica Error Message Potential Causes `"Invalid signature"` * Invalid signature format (not valid base58) * Signature bytes don't form a valid Ed25519 signature * Malformed signature data `"Invalid message"` * Message has expired (timestamp + expiry\_window < current time) * Message cannot be serialized to JSON * Message structure is malformed `"Invalid public key"` * Account address doesn't represent a valid Ed25519 public key * Public key bytes are malformed `"Verification failed"` * Signature doesn't match the message content * Wrong private key was used to sign * Message content was modified after signing While we have provided several different error message types in order to aid debugging, an incorrectly generated signed message is still relatively ambiguous when it comes to troubleshooting the root cause of the issue, making debugging more challenging. As such, the following guide and/or the [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk) , when followed closely, should make signing relatively straightforward to implement. [PreviousOperation Types](https://docs.pacifica.fi/api-documentation/api/signing/operation-types) [NextHardware Wallet](https://docs.pacifica.fi/api-documentation/api/signing/hardware-wallet) Last updated 6 months ago --- # API Agent Keys | Pacifica The signature verification process in both REST API and Websocket allow user generated API Agent Keys (also called "Agent Wallets") to sign on behalf of the original account. This is similar to the API Keys used for most leading exchanges. This way, API users can trade programmably without exposing the private key of the original wallet to the trading program. ### [](https://docs.pacifica.fi/api-documentation/api/signing/api-agent-keys#generate-api-agent-keys) Generate API Agent Keys Agent wallets can be generated on the [frontend](https://app.pacifica.fi/apikey) , or using this [Python SDK example](https://github.com/pacifica-fi/python-sdk/blob/main/rest/api_agent_keys.py#L31-L79) . ### [](https://docs.pacifica.fi/api-documentation/api/signing/api-agent-keys#use-api-agent-keys) Use API Agent Keys For all POST requests, follow these steps in request construction * Still use the original wallet's public key for `account`, * Use API Agent Private Key to sign the message payload to generate `signature`, and * Add `agent_wallet: [AGENT_WALLET_PUBLIC_KEY]` to the request header. As an example, this [Python SDK program](https://github.com/pacifica-fi/python-sdk/blob/main/rest/api_agent_keys.py#L81-L135) uses API Agent Key to place a market order. [PreviousHardware Wallet](https://docs.pacifica.fi/api-documentation/api/signing/hardware-wallet) [NextRate limits](https://docs.pacifica.fi/api-documentation/api/rate-limits) Last updated 2 months ago --- # Signing | Pacifica All POST requests require signing, whereas GET and websocket subscriptions do not. We _strongly_ recommend following the [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk) to generate signatures and submit trading requests. The following example explains the key steps in constructing valid signatures. [PreviousCancel all orders](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-all-orders) [NextImplementation](https://docs.pacifica.fi/api-documentation/api/signing/implementation) Last updated 6 months ago --- # Get account balance history | Pacifica Copy GET /api/v1/account/balance/history #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"limit"` integer optional Maximum number of records to return, defaults to system defined limit `100` `"cursor"` string optional Cursor pagination to access records. Default to none `1115hVka` Copy /api/v1/account/balance/history?account=42trU9A5... #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history#response) Response * Status 200: Successfully retrieved balance history Copy { "success": true, "data": [\ {\ "amount": "100.000000",\ "balance": "1200.000000",\ "pending_balance": "0.000000",\ "event_type": "deposit",\ "created_at": 1716200000000\ }\ ...\ ], "next_cursor": "11114Lz77", "has_more": true } Field Type Description `'amount'` decimal string Amount change to balance after event `'balance'` decimal string Account balance after event `'pending_balance'` decimal string Pending balance after event `'event_type'` string Type of balance event (see below) `'created_at'` integer Timestamp in milliseconds of when the balance event occurred `'next_cursor'` string Next cursor for pagination `'has_more'` boolean True if there exists a `'next_cursor'` Event Type (String) Description `'deposit'` Deposit funds to account `'deposit_release'` Release of previously pending deposit `'withdraw'` Withdrawal of funds from account `'trade'` Trading activity (fees, realized PnL) `'market_liquidation'` Liquidation by market orders `'backstop_liquidation'` Liquidation by backstop liquidator `'adl_liquidation'` Liquidation by auto-deleveraging `'subaccount_transfer'` Transfer between subaccounts `'funding'` Funding payment `'payout'` Payout event (from e.g. affiliate program) * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/portfolio?account/balance/history?account=42trU9A5..." headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet account equity history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-equity-history) [NextRequest withdrawal](https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal) Last updated 1 month ago --- # Operation Types | Pacifica Operation Type API Endpoint `"create_order"` `/api/v1/orders/create` `"create_stop_order"` `/api/v1/orders/stop/create` `"cancel_order"` `/api/v1/orders/cancel` `"cancel_all_orders"` `/api/v1/orders/cancel_all` `"cancel_stop_order"` `/api/v1/orders/stop/cancel` `"update_leverage"` `/api/v1/account/leverage` `"update_margin_mode"` `/api/v1/account/margin` `"set_position_tpsl"` `/api/v1/positions/tpsl` `"withdraw"` `/api/v1/account/withdraw` `"subaccount_initiate"` `/api/v1/account/subaccount/create` `"subaccount_confirm"` `/api/v1/account/subaccount/create` `"create_market_order"` `/api/v1/orders/create_market` `"subaccount_transfer"` `/api/v1/account/subaccount/transfer` `"bind_agent_wallet"` `/api/v1/agent/bind` `"create_api_key"` `/api/v1/account/api_keys/create` `"revoke_api_key"` `/api/v1/account/api_keys/revoke` `"list_api_keys"` `/api/v1/account/api_keys` Note: Pacifica's batch order endpoint does NOT have a corresponding operation type as all individual operations within the batch are signed independently with their own operation types. [PreviousImplementation](https://docs.pacifica.fi/api-documentation/api/signing/implementation) [NextError Handling](https://docs.pacifica.fi/api-documentation/api/signing/error-handling) Last updated 2 months ago --- # Orders | Pacifica [Create market order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order) [Create limit order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order) [Create stop order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order) [Create position TP/SL](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl) [Cancel order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order) [Cancel all orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders) [Cancel stop order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order) [Edit order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order) [Batch order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order) [Get open orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders) [Get order history](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history) [Get order history by ID](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id) [PreviousSubaccount fund transfer](https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer) [NextCreate market order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order) --- # Trading operations | Pacifica [Create market order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-market-order) [Create limit order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order) [Edit order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/edit-order) [Batch order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order) [Cancel order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order) [Cancel all orders](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-all-orders) [PreviousAccount trades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades) [NextCreate market order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-market-order) --- # Get trade history | Pacifica Copy GET /api/v1/trades/history #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"symbol"` string optional Market symbol to filter by `BTC` `"start_time"` integer optional Start time in milliseconds `1625097600000` `"end_time"` integer optional End time in milliseconds `1759215599188` `"limit"` integer optional Maximum number of records to return, defaults to 100 `100` `"cursor"` integer optional Cursor pagination to access records. Default to none `1115hVka` Copy /api/v1/positions/history?account=42trU9A5...&start_time=1625097600000&end_time=1759215599188 #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history#response) Response * Status 200: Successfully retrieved portfolio position history Copy { "success": true, "data": [\ {\ "history_id": 19329801,\ "order_id": 315293920,\ "client_order_id": "acf...",\ "symbol": "LDO",\ "amount": "0.1",\ "price": "1.1904",\ "entry_price": "1.176247",\ "fee": "0",\ "pnl": "-0.001415",\ "event_type": "fulfill_maker",\ "side": "close_short",\ "created_at": 1759215599188,\ "cause": "normal"\ },\ ...\ ], "next_cursor": "11111Z5RK", "has_more": true } Field Type Description `"history_id"` integer History id of trade `"order_id"` integer Order id of order that resulted in the trade `"client_order_id"` UUID CLOID of order that resulted in the trade `"symbol"` string Trading pair symbol `"amount"` decimal string Amount (in token denomination) of the trade event `"price"` decimal string Current price of the specified symbol `"entry_price"` decimal string Price at which the trade event was executed `"fee"` decimal string Fee paid by the trade event `"pnl"` decimal string PnL generated by the trade event `"event_type"` string `"fulfill_taker"` if taker `"fulfill_maker"` if maker `"side"` string `"open_long" "open_short" "close_long" "close_short"` `"created_at"` integer Timestamp in milliseconds when the trade event occurred `"cause"` string `"normal"` regular user-initiated trading `"market_liquidation"` position was liquidated due to insufficient margin `"backstop_liquidation"` position was liquidated by backstop mechanism `"settlement"` position was closed due to Auto-Deleveraging (ADL) or other settlement `'next_cursor'` string Next cursor for pagination `'has_more'` boolean True if there exists a `'next_cursor'` Field Type Description `'event_type'` string `"fulfill_taker"` if maker `"fulfill_maker"` if taker `'side'` string `"open_long" "open_short" "close_long" "close_short"` `'cause'` string `"normal"` regular user-initiated trading `"market_liquidation"` position was liquidated due to insufficient margin `"backstop_liquidation"` position was liquidated by backstop mechanism `"settlement"` position was closed due to Auto-Deleveraging (ADL) or other settlement * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/trades/history?account=42trU9A5...&symbol=BTC&limit=20&cursor=11115hVka", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet positions](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions) [NextGet funding history](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-funding-history) Last updated 19 days ago --- # Implementation | Pacifica ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-1.-setup-and-initialization) 1\. Setup and Initialization: Copy import time import base58 import requests from solders.keypair import Keypair PRIVATE_KEY = "your_private_key_here" # Generate keypair from private key keypair = Keypair.from_bytes(base58.b58decode(PRIVATE_KEY)) public_key = str(keypair.pubkey()) ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-2.-choose-endpoint-and-define-operation-type) 2\. Choose Endpoint and Define Operation Type For this example, we use the order creation endpoint. Refer to [Operation Types](https://docs.pacifica.fi/api-documentation/api/signing/operation-types) for a list of all types and corresponding API endpoints. Copy API_URL = "https://api.pacifica.fi/api/v1/orders/create" operation_type = "create_order" operation_data = { "symbol": "BTC", "price": "100000", "amount": "0.1", "side": "bid", "tif": "GTC", "reduce_only": False, "client_order_id": str(uuid.uuid4()), } ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-3.-create-signature-header) 3\. Create Signature Header Note that all times specified are denoted in milliseconds. The `"expiry_window"` field is optional, and defaults to 30\_000 (30 seconds) if not specified in the header. Copy # Get current timestamp in milliseconds timestamp = int(time.time() * 1_000) signature_header = { "timestamp": timestamp, "expiry_window": 5_000, "type": "create_order", } ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-4.-combine-header-and-payload) 4\. Combine Header and Payload Copy data_to_sign = { **signature_header, "data": operation_data, } In the case of our example, this creates: Copy { "timestamp": 1748970123456, "expiry_window": 5000, "type": "create_order", "data": { "symbol": "BTC", "price": "100000", "amount": "0.1", "side": "bid", "tif": "GTC", "reduce_only": False, "client_order_id": "12345678-1234-1234-1234-123456789abc" } } Note that data must be in same level as other headers. ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-5.-recursively-sort-json-keys) 5\. Recursively Sort JSON Keys Copy def sort_json_keys(value): if isinstance(value, dict): sorted_dict = {} for key in sorted(value.keys()): sorted_dict[key] = sort_json_keys(value[key]) return sorted_dict elif isinstance(value, list): return [sort_json_keys(item) for item in value] else: return value sorted_message = sort_json_keys(data_to_sign) In the case of our example, this creates: Copy { "data": { "amount": "0.1", "client_order_id": "12345678-1234-1234-1234-123456789abc", "price": "100000", "reduce_only": false, "side": "bid", "symbol": "BTC", "tif": "GTC" }, "expiry_window": 5000, "timestamp": 1748970123456, "type": "create_order" } Note that the recursive sorting alphabetically sorts \*all\* levels ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-6.-create-compact-json) 6\. Create Compact JSON Compact JSON string with no whitespace and standardized seperators Copy import json compact_json = json.dumps(sorted_message, separators=(",", ":")) In the case of our example, this creates: Copy {"data":{"amount":"0.1","client_order_id":"12345678-1234-1234-1234-123456789abc","price":"100000","reduce_only":false,"side":"bid","symbol":"BTC","tif":"GTC"},"expiry_window":5000,"timestamp":1748970123456,"type":"create_order"} This ensures that all logically identical messages will always produce \*identical\* signatures ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-7.-convert-to-bytes-and-generate-signature) 7\. Convert to Bytes and Generate Signature Messages are converted to UTF-8 bytes for signing. The signature generated is then converted to Base58 string for transmission. Copy # Convert to UTF-8 bytes message_bytes = compact_json.encode("utf-8") # Sign message bytes using your private key signature = keypair.sign_message(message_bytes) # Convert signature to Base58 string signature_b58 = base58.b58encode(bytes(signature)).decode("ascii") # Expect an output similar to: # "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA" ### [](https://docs.pacifica.fi/api-documentation/api/signing/implementation#id-8.-build-final-request) 8\. Build Final Request Build the header with generated authentication info and combine with operation data (NOT the "data" wrapper!) Copy request_header = { "account": public_key, "agent_wallet": None, "signature": signature_b58, "timestamp": signature_header["timestamp"], "expiry_window": signature_header["expiry_window"], } final_request = { **request_header, **operation_data, # Use the ORIGINAL create order fields } In the case of our example, the final request looks like: Copy { "account": "6ETnufiec2CxVWTS4u5Wiq33Zh5Y3Qm6Pkdpi375fuxP", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ", "timestamp": 1748970123456, "expiry_window": 5000, "symbol": "BTC", "price": "100000", "amount": "0.1", "side": "bid", "tif": "GTC", "reduce_only": false, "client_order_id": "12345678-1234-1234-1234-123456789abc" } [PreviousSigning](https://docs.pacifica.fi/api-documentation/api/signing) [NextOperation Types](https://docs.pacifica.fi/api-documentation/api/signing/operation-types) Last updated 2 months ago --- # Subscriptions | Pacifica [Prices](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices) [Orderbook](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook) [Best bid offer (BBO)](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) [Trades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades) [Candle](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle) [Mark price candle](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/mark-price-candle) [Account margin](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-margin) [Account leverage](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-leverage) [Account info](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-info) [Account positions](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions) [Account orders](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders) [Account order updates](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates) [Account trades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades) [PreviousWebsocket](https://docs.pacifica.fi/api-documentation/api/websocket) [NextPrices](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices) --- # Last order ID | Pacifica ### [](https://docs.pacifica.fi/api-documentation/api/last-order-id#overview) Overview last\_order\_id is an exchange-wide, nonce included in all trading-related API responses. Use it to determine the ordering of events across endpoints without relying on server timestamps. ### [](https://docs.pacifica.fi/api-documentation/api/last-order-id#why-use-it) Why Use It Server-side timestamps can be affected by clock drift. last\_order\_id provides guaranteed sequential ordering across all trading events. ### [](https://docs.pacifica.fi/api-documentation/api/last-order-id#affected-endpoints) Affected Endpoints #### [](https://docs.pacifica.fi/api-documentation/api/last-order-id#rest-api) REST API * [/api/v1/positions](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions) * [/api/v1/trades](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades) * [/api/v1/orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders) #### [](https://docs.pacifica.fi/api-documentation/api/last-order-id#websocket) WebSocket * [bbo](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) (`'i'` field reconciles with `'last_order_id'` / `'li'` elsewhere) * [trades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades) * [account\_positions](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions) * [account\_orders](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders) * [account\_order\_updates](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates) * [account\_trades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades) ### [](https://docs.pacifica.fi/api-documentation/api/last-order-id#notes) Notes * The last\_order\_id is shared across all above endpoints, allowing you to sequence events from different streams relative to each other. * For specific response implementation, check each endpoints' docs above. [PreviousError codes](https://docs.pacifica.fi/api-documentation/api/error-codes) [NextChangelog](https://docs.pacifica.fi/api-documentation/changelog) Last updated 5 hours ago --- # Edit order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/edit-order#request) Request Copy { "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "params": { "edit_order": { "account": "AwX6321...", "signature": "5vnYpt...", "timestamp": 1749223025396, "expiry_window": 5000, "symbol": "BTC", "price": "99500", "amount": "0.002", "order_id": 645953 } } } Field Type Need Description Example `"id"` Full UUID string required Client-defined request ID `660065de-8f32-46ad-ba1e-83c93d3e3966` `"params"` object required Contains action type and action parameters `"edit_order"` `"edit_order"` object required Specifies action type and contains parameters See examples. `"account"` string required User's wallet address `42trU9A5...` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"symbol"` string required Trading pair symbol `BTC` `"price"` string required Order price `99500` `"amount"` string required Order amount `0.002` `"order_id"` integer optional System-defined order ID (needed if no CLOID provided) `645953` `"client_order_id"` Full UUID string optional Client-defined order ID (needed if no OID provided) `f47ac10b-58cc-4372-a567-0e02b2c3d479` ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/edit-order#response) Response Copy { "code": 200, "data": { "I": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "i": 645954, "s": "BTC" }, "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "t": 1749223026150, "type": "edit_order" } Field Type Description `'code'` integer Status code `'data'` object Contains information about placed order `'I'` string CLOID (if original order contained one) `'i'` integer New order ID `'s'` string Symbol `'id'` string Client-defined request ID `'t'` integer Timestamp in milliseconds `'type'` string Specifies action type **Notes:** Editing an order cancels the original and creates a new one. The new order maintains the same side, reduce-only status, and client\_order\_id (if provided), is created with TIF = ALO (Post Only), and receives a new system-assigned order\_id. Edit order is not subject to the taker speedbump. [PreviousCreate limit order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order) [NextBatch order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order) Last updated 11 days ago --- # Best bid offer (BBO) | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo#params) Params Copy { "method": "subscribe", "params": { "source": "bbo", "symbol": "BTC" } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo#stream) Stream Copy { "channel": "bbo", "data": { "s": "BTC", "i": 1234567890, "t": 1764133203991, "b": "87185", "B": "1.234", "a": "87186", "A": "0.567" } } Field Type Description `'s'` string Symbol `'i'` integer Order id `'t'` integer Timestamp in milliseconds `'b'` decimal string Best bid price `'B'` decimal string Best bid amount (in token amount) `'a'` decimal string Best ask price `'A'` decimal string Best ask amount (in token amount) [PreviousOrderbook](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook) [NextTrades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades) Last updated 10 days ago --- # Prices | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices#params) Params Copy { "method": "subscribe", "params": { "source": "prices" } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices#stream) Stream Copy { "channel": "prices", "data": [\ {\ "funding": "0.0000125",\ "mark": "105473",\ "mid": "105476",\ "next_funding": "0.0000125",\ "open_interest": "0.00524",\ "oracle": "105473",\ "symbol": "BTC",\ "timestamp": 1749051612681,\ "volume_24h": "63265.87522",\ "yesterday_price": "955476"\ }\ // ... other symbol prices\ ], } Field Type Description `'funding'` decimal string Funding rate `'mark'` decimal string Mark price `'timestamp'` number Timestamp in milliseconds `'mid'` decimal string Mid price `'next_funding'` decimal string Next funding rate `'open_interest'` decimal string Open interest amount `'oracle'` decimal string Oracle price `'symbol'` string Symbol `'volume_24h'` decimal string 24 hour volume in USD `'yesterday_price'` decimal string Previous day price [PreviousSubscriptions](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions) [NextOrderbook](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook) Last updated 6 months ago --- # Cancel all orders | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/cancel_all_orders.py) provides a comprehensive example on using this endpoint. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-all-orders#request) Request Copy { "id": "4e9b4edb-b123-4759-9250-d19db61fabcb", "params": { "cancel_all_orders": { "account": "AwX6f3...", "signature": "2XP8fz...", "timestamp": 1749221927343, "expiry_window": 5000, "all_symbols": true, "exclude_reduce_only": false } } } Field Type Need Description Example `"id"` Full UUID string required Client-defined request ID `1bb2b72f-f545-4938-8a38-c5cda8823675` `"params"` object required Contains action type and action parameters `"cancel_all_orders"` `"cancel_order"` object required Specifies action type and contains parameters See examples. `"account"` string required User's wallet address `42trU9A5...` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"all_symbols"` boolean required Whether to cancel orders for all symbols `true` `"exclude_reduce_only"` boolean required Whether to exclude reduce-only orders `false` `"symbol"` string required (if `"all_symbols"` is false) Trading pair symbol `BTC` Copy { "code": 200, "data": { "cancelled_count": 10 }, "id": "b86b4f45-49da-4191-84e2-93e141acdeab", "t": 1749221787291, "type": "cancel_all_orders" } Field Type Description `'code'` integer Status code `'data'` object Contains information about placed order `'cancelled_count'` string Number of orders successfully cancelled `'id'` string Same as above request ID `'t'` integer Timestamp in milliseconds `'type'` string Specifies action type [PreviousCancel order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order) [NextSigning](https://docs.pacifica.fi/api-documentation/api/signing) Last updated 6 months ago --- # Cancel order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/cancel_order.py) provides a comprehensive example on using this endpoint. Copy POST /api/v1/orders/cancel #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"cancel_order"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"order_id"` integer required (if no CLOID) Exchange-assigned order ID `123` `"client_order_id"` Full UUID string required (if no OID) Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "order_id": 123, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order#response) Response * Status 200: Order cancelled successfully Copy { "success": true } * Status 400: Bad request Copy { "error": "Order not found", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "order_id": 123 } response = requests.post( "/api/v1/orders/cancel", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() Cancel requests are not affected by any speedbumps. [PreviousCreate position TP/SL](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl) [NextCancel all orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders) Last updated 11 days ago --- # Cancel all orders | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/cancel_all_orders.py) provides a comprehensive example on using this endpoint Copy POST /api/v1/orders/cancel_all #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"cancel_all_orders"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"all_symbols"` boolean required Whether to cancel orders for all symbols `true` `"exclude_reduce_only"` boolean required Whether to exclude reduce-only orders `false` `"symbol"` string required (if all\_symbols is false) Trading pair symbol `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "all_symbols": true, "exclude_reduce_only": false, "symbol": "BTC", "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders#response) Response * Status 200: All orders cancelled successfully Copy { "cancelled_count": 5 } * Status 400: Bad request Copy { "error": "Invalid parameters", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "all_symbols": True, "exclude_reduce_only": False } response = requests.post( "/api/v1/orders/cancel_all", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousCancel order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order) [NextCancel stop order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order) Last updated 6 months ago --- # Create market order | Pacifica Copy POST /api/v1/orders/create_market #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"create_market_order"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"amount"` string required Order amount `0.1` `"side"` string required Order side (bid/ask) `bid` `"slippage_percent"` string required Maximum slippage tolerance in percentage, e.g. "0.5" means 0.5% max slippage `0.5` `"reduce_only"` boolean required Whether the order is reduce-only `false` `"client_order_id"` Full UUID string optional Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"take_profit"` object optional Take profit stop order configuration See next three rows `"stop_price"` string required Stop trigger price `55000` `"limit_price"` string optional Limit price for the triggered order `54950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `e36ac10b-58cc-4372-a567-0e02b2c3d479` `"stop_loss"` object optional Stop loss order configuration See next three rows `"stop_price"` string required Stop trigger price `48000` `"limit_price"` string optional Limit price for the triggered order `47950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `d25ac10b-58cc-4372-a567-0e02b2c3d479` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq", "timestamp": 1716200000000, "symbol": "BTC", "amount": "0.1", "side": "bid", "slippage_percent": "0.5", "reduce_only": false, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "take_profit": { "stop_price": "55000", "limit_price": "54950", "client_order_id": "e36ac10b-58cc-4372-a567-0e02b2c3d479" }, "stop_loss": { "stop_price": "48000", "limit_price": "47950", "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479" }, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order#response) Response * Status 200: Order created successfully Copy { "order_id": 12345 } * Status 400: Bad request Copy { "error": "Invalid order parameters", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "amount": "0.1", "side": "bid", "slippage_percent": 1, "reduce_only": False, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } response = requests.post( "/api/v1/orders/create_market", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() Note: In order to protect liquidity providers from adverse selection, all market orders are subject to a ~200ms delay. [PreviousOrders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders) [NextCreate limit order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order) Last updated 11 days ago --- # Orderbook | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook#params) Params Copy { "method": "subscribe", "params": { "source": "book", "symbol": "SOL", "agg_level": 1 // Aggregation level } } where `agg_level`can be one of `1, 2, 5, 10, 100, 1000`. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook#stream) Stream Copy { "channel": "book", "data": { "l": [\ [\ {\ "a": "37.86",\ "n": 4,\ "p": "157.47"\ },\ // ... other aggegated bid levels\ ],\ [\ {\ "a": "12.7",\ "n": 2,\ "p": "157.49"\ },\ {\ "a": "44.45",\ "n": 3,\ "p": "157.5"\ },\ // ... other aggregated ask levels\ ]\ ], "s": "SOL", "t": 1749051881187 } } The `book` websocket stream updates once every 100ms Field Type Description `'l'` array \[Bids, Asks\] `'a'` decimal string Total amount in aggregation level. `'n'` integer Number of orders in aggregation level. `'p'` decimal string * In bids array, this is highest price in aggregation level. * In asks array, this is lowest price is aggregation level `'s'` string Symbol `'t'` number Timestamp in milliseconds [PreviousPrices](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices) [NextBest bid offer (BBO)](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) Last updated 1 month ago --- # Candle | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle#params) Params Copy { "method": "subscribe", "params": { "source": "candle", "symbol": "SOL", "interval": "1m" } } Where `"interval"` can be `1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d` ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle#stream) Stream Copy { "channel": "candle", "data": { "t": 1749052260000, "T": 1749052320000, "s": "SOL", "i": "1m", "o": "157.3", "c": "157.32", "h": "157.32", "l": "157.3", "v": "1.22", "n": 8 } } Field Type Description `'t'` number Start time (milliseconds) `'T'` number End time (milliseconds) `'s'` string Symbol `'i'` string Candle interval `'o'` decimal string Open price `'c'` decimal string Close price `'h'` decimal string High price `'l'` decimal string Low price `'v'` decimal string Volume `'n'` number Number of trades in this period [PreviousTrades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades) [NextMark price candle](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/mark-price-candle) Last updated 6 months ago --- # Edit order | Pacifica Copy POST /api/v1/orders/edit #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"edit_order"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"price"` string required Order price `50000` `"amount"` string required Order amount `0.1` `"order_id"` integer required (if no CLOID) Exchange assigned order ID `123456789` `"client_order_id"` Full UUID string required (if no OID) Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Note: You must provide either `order_id` OR `client_order_id` but not both. Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "price": "90000", "amount": "0.5", "order_id": 123456789, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order#response) Response * Status 200: Order created successfully Copy { "order_id": 123498765 } * Status 400: Bad request Copy { "success": false, "error": "Order not found", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "price": "90000", "amount": "0.5", "order_id": 123456789 } response = requests.post( "/api/v1/orders/edit", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() **Notes:** Editing an order cancels the original and creates a new one. The new order maintains the same side, reduce-only status, and client\_order\_id (if provided), is created with TIF = ALO (Post Only), and receives a new system-assigned order\_id. Edit order is not subject to the taker speedbump. [PreviousCancel stop order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order) [NextBatch order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order) Last updated 11 days ago --- # Create limit order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/create_order.py) provides a comprehensive example on using this endpoint. Copy POST /api/v1/orders/create #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"create_order"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"price"` string required Order price `50000` `"amount"` string required Order amount `0.1` `"side"` string required Order side (bid/ask) `bid` `"tif"` string required Time in force (`GTC`, `IOC`, `ALO`. `TOB`) `GTC` `"reduce_only"` boolean required Whether the order is reduce-only `false` `"client_order_id"` Full UUID string optional Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"take_profit"` object optional Take profit stop order configuration See next three rows `"stop_price"` string required Stop trigger price `55000` `"limit_price"` string optional Limit price for the triggered order `54950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `e36ac10b-58cc-4372-a567-0e02b2c3d479` `"stop_loss"` object optional Stop loss order configuration See next three rows `"stop_price"` string required Stop trigger price `48000` `"limit_price"` string optional Limit price for the triggered order `47950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `d25ac10b-58cc-4372-a567-0e02b2c3d479` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq", "timestamp": 1716200000000, "symbol": "BTC", "price": "50000", "amount": "0.1", "side": "bid", "tif": "GTC", "reduce_only": false, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "take_profit": { "stop_price": "55000", "limit_price": "54950", "client_order_id": "e36ac10b-58cc-4372-a567-0e02b2c3d479" }, "stop_loss": { "stop_price": "48000", "limit_price": "47950", "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479" }, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order#response) Response * Status 200: Order created successfully Copy { "order_id": 12345 } * Status 400: Bad request Copy { "error": "Invalid order parameters", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "price": "50000", "amount": "0.1", "side": "bid", "tif": "GTC", "reduce_only": False, "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } response = requests.post( "/api/v1/orders/create", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() Note: In order to protect liquidity providers from adverse selection, all TIF GTC, and TIF IOC orders are subject to a ~200ms delay. [PreviousCreate market order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order) [NextCreate stop order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order) Last updated 11 days ago --- # Cancel stop order | Pacifica Copy POST /api/v1/orders/stop/cancel #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"cancel_stop_order"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"order_id"` integer required (if no CLOID) Exchange-assigned order ID `123` `"client_order_id"` Full UUID string required (if no OID) Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "order_id": 123, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order#response) Response * Status 200: Stop order cancelled successfully Copy { "success": true } * Status 400: Bad request Copy { "error": "Stop order not found", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "order_id": 123 } response = requests.post( "/api/v1/orders/stop/cancel", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousCancel all orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders) [NextEdit order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order) Last updated 6 months ago --- # Batch order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/batch_orders.py) provides a comprehensive example on using this endpoint Copy POST /api/v1/orders/batch #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content None \- Batch orders are not signed as a whole, but rather by its individual actions components. #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#request-body) Request Body Field Type Need Description Example `"actions"` array required List of order actions to perform Each action has an "type" field and action-specific "data" See next two rows `"type"` string required Specifies type of action. This is DIFFERENT to the "type" used in signature headers `"Create"` `"Cancel"` (case sensitive) `"data"` object required Contains signed request payloads of individual `"Create"` or `"Cancel"` actions See code block below. Messages and corresponding fields are identical to [create](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order) and [cancel](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order) requests. Copy { "actions":[\ {\ "type":"Create",\ "data":{\ "account":"42trU9A5...",\ "signature":"5UpRZ14Q...",\ "timestamp":1749190500355,\ "expiry_window":5000,\ "symbol":"BTC",\ "price":"100000",\ "reduce_only":false,\ "amount":"0.1",\ "side":"bid",\ "tif":"GTC",\ "client_order_id":"57a5efb1-bb96-49a5-8bfd-f25d5f22bc7e"\ }\ },\ {\ "type":"Cancel",\ "data":{\ "account":"42trU9A5...",\ "signature":"4NDFHyTG...",\ "timestamp":1749190500355,\ "expiry_window":5000,\ "symbol":"BTC",\ "order_id":42069\ }\ }\ ] } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#response) Response * Status 200: Batch operations processed successfully Copy { "success": true, "data": { "results": [\ {\ "success": true,\ "order_id": 470506,\ "error": null\ },\ {\ "success": true,\ }\ ] }, "error": null, "code": null } * Status 400: Bad request Copy { "error": "Invalid batch operation parameters", "code": 400 } * Status 500: Internal server error ### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#notes-on-batch-ordering) Notes on Batch Ordering: #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#speed-bump-latency-protection) Speed Bump (Latency Protection) Batch orders are subject to a conditional ~200ms delay to protect liquidity providers from adverse selection: Speed bump is applied if the batch contains: * Market orders (CreateMarket) * Limit orders with TIF = GTC or IOC Speed bump is NOT applied if the batch only contains: * Add Liquidity Only orders (TIF = ALO) * Top of Book orders (TIF = TOB) * Cancel operations * TP/SL operations #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#signature-requirements) Signature Requirements * Each action in the batch must be individually signed * All signatures must be valid for the batch to process #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order#execution-behavior-and-limits) Execution Behavior and Limits * Maximum 10 actions per batch request * Actions are executed atomically in the order provided * If one action fails, subsequent actions are still attempted [PreviousEdit order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order) [NextGet open orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders) Last updated 10 days ago --- # Mark price candle | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/mark-price-candle#params) Params Copy { "method": "subscribe", "params": { "source": "mark_price_candle", "symbol": "BTC", "interval": "1m" } } Where `"interval"` can be `1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d` ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/mark-price-candle#stream) Stream Copy { "channel": "mark_price_candle", "data": { "t": 1748954160000, "T": 1748954220000, "s": "BTC", "i": "1m", "o": "105376.500000", "c": "105380.250000", "h": "105385.750000", "l": "105372.000000", "v": "0", "n": 0 } } Field Type Description `'t'` number Start time (milliseconds) `'T'` number End time (milliseconds) `'s'` string Symbol `'i'` string Candle interval `'o'` decimal string Open mark price `'c'` decimal string Close mark price `'h'` decimal string High mark price `'l'` decimal string Low mark price `'v'` decimal string Volume (always `"0"`) `'n'` number Number of trades in this period [PreviousCandle](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle) [NextAccount margin](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-margin) Last updated 10 days ago --- # Cancel order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/cancel_order.py) provides a comprehensive example on using this endpoint. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order#request) Request Copy { "id": "1bb2b72f-f545-4938-8a38-c5cda8823675", "params": { "cancel_order": { "account": "AwX6321...", "signature": "4RqbgB...", "timestamp": 1749223343149, "expiry_window": 5000, "symbol": "BTC", "client_order_id": "79f948fd-7556-4066-a128-083f3ea49322" } } } Field Type Need Description Example `"id"` Full UUID string required Client-defined request ID `1bb2b72f-f545-4938-8a38-c5cda8823675` `"params"` object required Contains action type and action parameters `"cancel_order"` `"cancel_order"` object required Specifies action type and contains parameters See examples. `"account"` string required User's wallet address `42trU9A5...` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"symbol"` string required Trading pair symbol `BTC` `"order_id"` integer required (if no CLOID) Exchange-assigned order ID `123` `"client_order_id"` Full UUID string required (if no OID) Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order#response) Response Copy { "code": 200, "data": { "I": "79f948fd-7556-4066-a128-083f3ea49322", "i": null, "s": "BTC" }, "id": "1bb2b72f-f545-4938-8a38-c5cda8823675", "t": 1749223343610, "type": "cancel_order" } Field Type Description `'code'` integer Status code `'data'` object Contains information about placed order `'I'` string CLOID (if provided) `'i'` integer Order ID `'s'` string Symbol `'id'` string Same as above request ID `'t'` integer Timestamp in milliseconds `'type'` string Specifies action type Cancel are not subject to any speedbump. [PreviousBatch order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order) [NextCancel all orders](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-all-orders) Last updated 11 days ago --- # Get open orders | Pacifica Copy GET /api/v1/orders #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required Account address to filter orders `42trU9A5...` Copy /api/v1/orders?account=42trU9A5... #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders#response) Response * Status 200: Successfully retrieved open orders Copy { "success": true, "data": [\ {\ "order_id": 315979358,\ "client_order_id": "add9a4b5-c7f7-4124-b57f-86982d86d479",\ "symbol": "ASTER",\ "side": "ask",\ "price": "1.836",\ "initial_amount": "85.33",\ "filled_amount": "0",\ "cancelled_amount": "0",\ "stop_price": null,\ "order_type": "limit",\ "stop_parent_order_id": null,\ "reduce_only": false,\ "created_at": 1759224706737,\ "updated_at": 1759224706737\ }\ ], "error": null, "code": null, "last_order_id": 1557370337 } Field Type Description `"order_id"` integer Order id assigned to order `"client_order_id"` UUID CLOID of order if assigned by user `"symbol"` string Trading pair symbol `"side"` string Whether the order is a bid or an ask `"price"` decimal string Price set by the order `"initial_amount"` decimal string Amount (in token denomination) of the order placed `"filled_amount"` decimal string Amount (in token denomination) of the order placed that has been filled `"cancelled_amount"` decimal string Amount (in token denomination) of the order placed that has been cancelled `"stop_price"` decimal string Stop price assigned upon order creation for subsequent position if order is filled if specified by user. `"order_type"` string `"limit" "market" "stop_limit" "stop_market" "take_profit_limit" "stop_loss_limit" "take_profit_market" "stop_loss_market"` `"stop_parent_order_id"` integer Order id of stop order attached to original order `"reduce_only"` boolean If the order is reduce only `"created_at"` integer Timestamp in milliseconds when the order was created on Pacifica `"updated_at"` integer Timestamp in milliseconds when the order was last modified (by a fill) `"last_order_id"` integer Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/orders?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() [PreviousBatch order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order) [NextGet order history](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history) Last updated 7 hours ago --- # Account leverage | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-leverage#leverage) Leverage ------------------------------------------------------------------------------------------------------------------ ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-leverage#params) Params Copy { "method": "subscribe", "params": { "source": "account_leverage", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-leverage#stream) Stream Copy { "channel": "account_leverage", "data": { "u": "42trU9A5..." "s": "BTC", "l": "12", "t": 1234567890 } } Field Type Description `'u'` string Account address `'s'` string Symbol `'l'` integer string New leverage `'t'` number Timestamp in milliseconds [PreviousAccount margin](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-margin) [NextAccount info](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-info) Last updated 6 months ago --- # Account margin | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-margin#margin) Margin ------------------------------------------------------------------------------------------------------------ ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-margin#params) Params Copy { "method": "subscribe", "params": { "source": "account_margin", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-margin#stream) Stream Copy { "channel": "account_margin", "data": { "u": "42trU9A5...", "s": "ETH", "i": true, "t": 1234567890 } } Field Type Description `'u'` string Account address `'t'` number Timestamp in milliseconds `'s'` string Symbol `'i'` boolean New margin mode (isolated or not isolated) [PreviousMark price candle](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/mark-price-candle) [NextAccount leverage](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-leverage) Last updated 6 months ago --- # Batch order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/batch_orders.py) provides a comprehensive example on using this endpoint ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order#request) Request Copy { "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "params": { "batch_orders": { "actions": [\ {\ "type": "Create",\ "data": {\ "account": "42trU9A5...",\ "signature": "5UpRZ14Q...",\ "timestamp": 1749190500355,\ "expiry_window": 5000,\ "symbol": "BTC",\ "price": "100000",\ "reduce_only": false,\ "amount": "0.1",\ "side": "bid",\ "tif": "GTC",\ "client_order_id": "57a5efb1-bb96-49a5-8bfd-f25d5f22bc7e"\ }\ },\ {\ "type": "Cancel",\ "data": {\ "account": "42trU9A5...",\ "signature": "4NDFHyTG...",\ "timestamp": 1749190500355,\ "expiry_window": 5000,\ "symbol": "SOL",\ "order_id": 42069\ }\ }\ ] } } } Field Type Need Description Example `"id"` Full UUID string required Client-defined request ID 660065de-8f32-46ad-ba1e-83c93d3e3966 `"actions"` array required List of order actions to perform Each action has an "type" field and action-specific "data" See next two rows `"type"` string required Specifies type of action. This is DIFFERENT to the "type" used in signature headers `"Create"` `"Cancel"` (case sensitive) `"data"` object required Contains signed request payloads of individual `"Create"` or `"Cancel"` actions See code block below. Messages and corresponding fields are identical to [create](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order) and [cancel](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order) requests. #### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order#response) Response * Status 200: Batch operations processed successfully Copy { "code": 200, "data": { "results": [\ {\ "success": true,\ "order_id": 645953,\ "client_order_id": "57a5efb1-bb96-49a5-8bfd-f25d5f22bc7e",\ "symbol": "BTC"\ },\ {\ "success": true,\ "order_id": 645954,\ "symbol": "ETH"\ }\ ] }, "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "t": 1749223025962, "type": "batch_orders" } * Status 400: Bad request Copy { "error": "Invalid batch operation parameters", "code": 400 } * Status 500: Internal server error ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order#notes-on-batch-ordering) Notes on Batch Ordering: #### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order#speed-bump-latency-protection) Speed Bump (Latency Protection) Batch orders are subject to a conditional randomized 50-100ms delay to protect liquidity providers from adverse selection: Speed bump is applied if the batch contains: * Market orders (CreateMarket) * Limit orders with TIF = GTC or IOC Speed bump is NOT applied if the batch only contains: * Add Liquidity Only orders (TIF = ALO) * Top of Book orders (TIF = TOB) * Cancel operations * TP/SL operations #### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order#signature-requirements) Signature Requirements * Each action in the batch must be individually signed * All signatures must be valid for the batch to process #### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order#execution-behavior-and-limits) Execution Behavior and Limits * Maximum 10 actions per batch request * Actions are executed atomically in the order provided * If one action fails, subsequent actions are still attempted [PreviousEdit order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/edit-order) [NextCancel order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order) Last updated 11 days ago --- # Create position TP/SL | Pacifica Copy POST /api/v1/positions/tpsl #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"set_position_tpsl"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"side"` string required Order side (bid/ask) `bid` `"take_profit"` object optional (if there is SL) Take profit stop order configuration See next three rows `"stop_price"` string required Stop trigger price `55000` `"limit_price"` string optional Limit price for the triggered order `54950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `e36ac10b-58cc-4372-a567-0e02b2c3d479` `"stop_loss"` object optional (if there is TP) Stop loss order configuration See next three rows `"stop_price"` string required Stop trigger price `48000` `"limit_price"` string optional Limit price for the triggered order `47950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `d25ac10b-58cc-4372-a567-0e02b2c3d479` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "side": "bid", "take_profit": { "stop_price": "55000", "limit_price": "54950", "client_order_id": "e36ac10b-58cc-4372-a567-0e02b2c3d479" }, "stop_loss": { "stop_price": "48000", "limit_price": "47950", "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479" }, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl#response) Response * Status 200: Take profit and stop loss set successfully Copy { "success": true } * Status 400: Bad request Copy { "error": "Position not found", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "side": "bid", "take_profit": { "stop_price": "55000", "limit_price": "54950" }, "stop_loss": { "stop_price": "48000", "limit_price": "47950" } } response = requests.post( "/api/v1/positions/tpsl", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousCreate stop order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order) [NextCancel order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order) Last updated 3 months ago --- # Create stop order | Pacifica Copy POST /api/v1/orders/stop/create #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"create_stop_order"` #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order#request-body) Request Body Field Type Need Description Example `"account"` string required User's wallet address `42trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"symbol"` string required Trading pair symbol `BTC` `"side"` string required Order side (bid/ask) `bid` `"reduce_only"` boolean required Whether the order is reduce-only `false` `"stop_order"` object required Stop order configuration See next four rows `"stop_price"` string required Stop trigger price `48000` `"limit_price"` string optional Limit price for the triggered order `47950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `d25ac10b-58cc-4372-a567-0e02b2c3d479` `"amount"` string required Order amount `0.1` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` Copy { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "side": "long", "reduce_only": true, "stop_order": { "stop_price": "48000", "limit_price": "47950", "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479", "amount": "0.1" }, "agent_wallet": "69trU9A5...", "expiry_window": 30000 } #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order#response) Response * Status 200: Stop order created successfully Copy { "order_id": 12345 } * Status 400: Bad request Copy { "error": "Invalid stop order parameters", "code": 400 } * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order#code-example-python) Code Example (Python) Copy import requests payload = { "account": "42trU9A5...", "signature": "5j1Vy9Uq...", "timestamp": 1716200000000, "symbol": "BTC", "side": "long", "reduce_only": True, "stop_order": { "stop_price": "48000", "limit_price": "47950", "amount": "0.1" } } response = requests.post( "/api/v1/orders/stop/create", json=payload, headers={"Content-Type": "application/json"} ) data = response.json() [PreviousCreate limit order](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order) [NextCreate position TP/SL](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl) Last updated 11 days ago --- # Create limit order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order#request) Request Copy { "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "params": { "create_order": { "account": "AwX6321...", "signature": "5vnYpt...", "timestamp": 1749223025396, "expiry_window": 5000, "symbol": "BTC", "price": "100000.00", "reduce_only": false, "amount": "0.001", "side": "bid", "tif": "GTC", "client_order_id": "79f948fd-7556-4066-a128-083f3ea49322" } } } Field Type Need Description Example `"id"` Full UUID string required Client-defined request ID `660065de-8f32-46ad-ba1e-83c93d3e3966` `"params"` object required Contains action type and action parameters `"create_order"` `"create_order"` object required Specifies action type and contains parameters See examples. `"account"` string required User's wallet address `42trU9A5...` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"symbol"` string required Trading pair symbol `BTC` `"price"` string required Order price `50000` `"reduce_only"` boolean required Whether the order is reduce-only `false` `"amount"` string required Order amount `0.1` `"side"` string required Order side (bid/ask) `bid` `"tif"` string required Time in force (`GTC`, `IOC`, `ALO`, `TOB`) `GTC` `"client_order_id"` Full UUID string optional Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"take_profit"` object optional Take profit stop order configuration See next three rows `"stop_price"` string required (if `"take_profit"` exists) Stop trigger price `55000` `"limit_price"` string optional Limit price for the triggered order `54950` `"client_order_id"` string Full UUID string Client-defined order ID for the stop order `e36ac10b-58cc-4372-a567-0e02b2c3d479` `"stop_loss"` object optional Stop loss order configuration See next three rows `"stop_price"` string required (if `"stop_loss"` exists) Stop trigger price `48000` `"limit_price"` string optional Limit price for the triggered order `47950` `"client_order_id"` string Full UUID string Client-defined order ID for the stop order `d25ac10b-58cc-4372-a567-0e02b2c3d479` ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order#response) Response Copy { "code": 200, "data": { "I": "79f948fd-7556-4066-a128-083f3ea49322", "i": 645953, "s": "BTC" }, "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "t": 1749223025962, "type": "create_order" } Field Type Description `'code'` integer Status code `'data'` object Contains information about placed order `'I'` string CLOID (if provided) `'i'` integer Order ID `'s'` string Symbol `'id'` string Client-defined request ID `'t'` integer Timestamp in milliseconds `'type'` string Specifies action type Note: In order to protect liquidity providers from adverse selection, all TIF GTC, and TIF IOC orders are subject to a ~200ms delay. [PreviousCreate market order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-market-order) [NextEdit order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/edit-order) Last updated 11 days ago --- # Create market order | Pacifica The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-market-order#request) Request Copy { "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "params": { "create_market_order": { "account": "AwX6321...", "signature": "5vnYpt...", "timestamp": 1749223025396, "expiry_window": 5000, "symbol": "BTC", "reduce_only": false, "amount": "0.001", "side": "bid", "slippage_percent": "0.5", "client_order_id": "79f948fd-7556-4066-a128-083f3ea49322" } } } Field Type Need Description Example `"id"` Full UUID string required Client-defined request ID `660065de-8f32-46ad-ba1e-83c93d3e3966` `"params"` object required Contains action type and action parameters `"create_order"` `"create_market_order"` object required Specifies action type and contains parameters See examples. `"account"` string required User's wallet address `42trU9A5...` `"agent_wallet"` string optional Agent wallet address `69trU9A5...` `"signature"` string required Cryptographic signature `5j1Vy9Uq...` `"timestamp"` integer required Current timestamp in milliseconds `1716200000000` `"expiry_window"` integer optional Signature expiry in milliseconds `30000` `"symbol"` string required Trading pair symbol `BTC` `"reduce_only"` boolean required Whether the order is reduce-only `false` `"amount"` string required Order amount `0.1` `"side"` string required Order side (bid/ask) `bid` `"slippage_percent"` string required Maximum allowed slippage in percentage, e.g. "0.5" means 0.5% max slippage `0.5` `"client_order_id"` Full UUID string optional Client-defined order ID `f47ac10b-58cc-4372-a567-0e02b2c3d479` `"take_profit"` object optional Take profit stop order configuration See next three rows `"stop_price"` string required (if `"take_profit"` exists) Stop trigger price `55000` `"limit_price"` string optional Limit price for the triggered order `54950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `e36ac10b-58cc-4372-a567-0e02b2c3d479` `"stop_loss"` object optional Stop loss order configuration See next three rows `"stop_price"` string required (if `"stop_loss"` exists) Stop trigger price `48000` `"limit_price"` string optional Limit price for the triggered order `47950` `"client_order_id"` Full UUID string optional Client-defined order ID for the stop order `d25ac10b-58cc-4372-a567-0e02b2c3d479` ### [](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-market-order#response) Response Copy { "code": 200, "data": { "I": "79f948fd-7556-4066-a128-083f3ea49322", "i": 645953, "s": "BTC" }, "id": "660065de-8f32-46ad-ba1e-83c93d3e3966", "t": 1749223025962, "type": "create_market_order" } Field Type Description `'code'` integer Status code `'data'` object Contains information about placed order `'I'` string CLOID (if provided) `'i'` integer Order ID `'s'` string Symbol `'id'` string Client-defined request ID `'t'` integer Timestamp in milliseconds `'type'` string Specifies action type Note: In order to protect liquidity providers from adverse selection, all market orders are subject to a ~200ms delay. [PreviousTrading operations](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations) [NextCreate limit order](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order) Last updated 11 days ago --- # Get order history by ID | Pacifica Copy GET /api/v1/orders/history_by_id #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id#query-parameters) Query Parameters Field Type Need Description Example `"order_id"` integer required Order ID to retrieve history for `13753364` Copy /api/v1/orders/history_by_id?order_id=13753364 #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id#response) Response * Status 200: Successfully retrieved open orders Copy { "success": true, "data": [\ {\ "history_id": 641452639,\ "order_id": 315992721,\ "client_order_id": "ade1aa6...",\ "symbol": "XPL",\ "side": "ask",\ "price": "1.0865",\ "initial_amount": "984",\ "filled_amount": "0",\ "cancelled_amount": "984",\ "event_type": "cancel",\ "order_type": "limit",\ "order_status": "cancelled",\ "stop_price": null,\ "stop_parent_order_id": null,\ "reduce_only": false,\ "created_at": 1759224895038\ },\ {\ "history_id": 641452513,\ "order_id": 315992721,\ "client_order_id": "ade1aa6...",\ "symbol": "XPL",\ "side": "ask",\ "price": "1.0865",\ "initial_amount": "984",\ "filled_amount": "0",\ "cancelled_amount": "0",\ "event_type": "make",\ "order_type": "limit",\ "order_status": "open",\ "stop_price": null,\ "stop_parent_order_id": null,\ "reduce_only": false,\ "created_at": 1759224893638\ }\ ], "error": null, "code": null } Field Type Description `"history_id"` integer History ID assigned to the order `"order_id"` integer Order ID assigned to order `"client_order_id"` UUID CLOID of order if assigned by user `"symbol"` string Trading pair symbol `"side"` string Whether the order is a bid or an ask `"price"` decimal string Price set by the order `"initial_amount"` decimal string Amount (in token denomination) of the order placed `"filled_amount"` decimal string Amount (in token denomination) of the order placed that was filled `"cancelled_amount"` decimal string Amount (in token denomination) of the order placed that was cancelled `"event_type"` decimal string Make if user was on maker side. Take if on taker. `"order_type"` string `"limit" "market" "stop_limit" "stop_market" "take_profit_limit" "stop_loss_limit" "take_profit_market" "stop_loss_market"` `"order_status"` string `"open" "partially_filled" "filled" "cancelled" "rejected"` `"stop_price"` decimal string Stop price assigned upon order creation for subsequent position if order is filled if specified by user. `"stop_parent_order_id"` integer Order id of stop order attached to original order `"reduce_only"` boolean If the order is reduce only `"created_at"` integer Timestamp in milliseconds when the order was created on Pacifica * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/orders/history_by_id?order_id=13753364", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet order history](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history) [NextWebsocket](https://docs.pacifica.fi/api-documentation/api/websocket) Last updated 2 months ago --- # Trades | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades#params) Params Copy { "method": "subscribe", "params": { "source": "trades", "symbol": "SOL" } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades#stream) Stream Copy { "channel": "trades", "data": [\ {\ "u": "42trU9A5...",\ "h": 80062522,\ "s": "BTC",\ "a": "0.00001",\ "p": "89471",\ "d": "close_short",\ "tc": "normal",\ "t": 1765018379085,\ "li": 1559885104\ }\ ] } Field Type Description `'u'` string Account address `'h'` integer History ID `'s'` string Symbol `'a'` decimal string Amount `'p'` decimal string Price `'d'` string Trade side `open_long` `open_short` `close_long` `close_short` `'tc'` string Trade cause `normal` `market_liquidation` `backstop_liquidation` `settlement` `'t'` number Timestamp in milliseconds `'li'` number Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. [PreviousBest bid offer (BBO)](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) [NextCandle](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle) Last updated 6 hours ago --- # Get order history | Pacifica Copy GET /api/v1/orders/history #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history#query-parameters) Query Parameters Field Type Need Description Example `"account"` string required Account address to filter orders `42trU9A5...` `"limit"` integer optional Maximum number of records to return, default to 100 `100` `"cursor"` string optional Cursor pagination to access records. Default to none `1115hVka` Copy /api/v1/orders/history?account=42trU9A5...&limit=100 #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history#response) Response * Status 200: Successfully retrieved order history Copy { "success": true, "data": [\ {\ "order_id": 315992721,\ "client_order_id": "ade",\ "symbol": "XPL",\ "side": "ask",\ "initial_price": "1.0865",\ "average_filled_price": "0",\ "amount": "984",\ "filled_amount": "0",\ "order_status": "open",\ "order_type": "limit",\ "stop_price": null,\ "stop_parent_order_id": null,\ "reduce_only": false,\ "reason": null,\ "created_at": 1759224893638,\ "updated_at": 1759224893638\ },\ ...\ ], "next_cursor": "1111Hyd74", "has_more": true } Field Type Description `"order_id"` integer Order id assigned to order `"client_order_id"` UUID CLOID of order if assigned by user `"symbol"` string Trading pair symbol `"side"` string Whether the order is a bid or an ask `"price"` decimal string Price set by the order `"initial_price"` decimal string Amount (in token denomination) of the order placed `"average_filled_price"` decimal string VWAP of price at which the order was filled at `"amount"` decimal string Amount (in token denomination) of the order placed `"filled_amount"` decimal string Amount (in token denomination) of the order placed that was filled `"order_status"` string `"open" "partially_filled" "filled" "cancelled" "rejected"` `"order_type"` string `"limit" "market" "stop_limit" "stop_market" "take_profit_limit" "stop_loss_limit" "take_profit_market" "stop_loss_market"` `"stop_price"` decimal string Stop price assigned upon order creation for subsequent position if order is filled if specified by user. `"stop_parent_order_id"` integer Order id of stop order attached to original order `"reduce_only"` boolean If the order is reduce only `"reason"` string Provides reason for an order being `"cancelled"` or `"rejected"`: `"cancel" "force_cancel" "expired" "post_only_rejected" "self_trade_prevented"` `"created_at"` integer Timestamp in milliseconds when the order was created on Pacifica `"updated_at"` integer Timestamp in milliseconds when any of the order was last modified `'next_cursor'` string Next cursor for pagination `'has_more'` boolean True if there exists a `'next_cursor'` * Status 400: Invalid request parameters * Status 401: Unauthorized access * Status 500: Internal server error #### [](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history#code-example-python) Code Example (Python) Copy import requests response = requests.get( "/api/v1/orders/history?account=42trU9A5...&limit=100", headers={"Accept": "*/*"}, ) data = response.json() [PreviousGet open orders](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders) [NextGet order history by ID](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id) Last updated 1 month ago --- # Account positions | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions#params) Params Copy { "method": "subscribe", "params": { "source": "account_positions", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions#initialization-snapshot) Initialization Snapshot Upon subscription, the `account positions` websocket immediately returns a snapshot of all current positions, then begins streams all changes made to an account's positions. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions#stream) Stream Copy { "channel": "subscribe", "data": { "source": "account_positions", "account": "BrZp5..." } } // this is the initialization snapshot { "channel": "account_positions", "data": [\ {\ "s": "BTC",\ "d": "bid",\ "a": "0.00022",\ "p": "87185",\ "m": "0",\ "f": "-0.00023989",\ "i": false,\ "l": null,\ "t": 1764133203991\ }\ ], "li": 1559395580 } // this shows the position being increased by an order filling { "channel": "account_positions", "data": [\ {\ "s": "BTC",\ "d": "bid",\ "a": "0.00044",\ "p": "87285.5",\ "m": "0",\ "f": "-0.00023989",\ "i": false,\ "l": "-95166.79231",\ "t": 1764133656974\ }\ ], "li": 1559412952 } // this shows the position being closed { "channel": "account_positions", "data": [], "li": 1559438203 } Field Type Description `'s'` string Symbol `'d'` string Position side (bid, ask) `'a'` decimal string Position amount `'p'` decimal string Average entry price `'m'` decimal string Position margin `'f'` decimal string Position funding fee `'i'` bool Is position isolated? `'l'` decimal string Liquidation price in USD (null if not applicable) `'t'` number Timestamp in milliseconds `'li'` number Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. [PreviousAccount info](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-info) [NextAccount orders](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders) Last updated 7 hours ago --- # Account info | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-info#leverage) Leverage -------------------------------------------------------------------------------------------------------------- ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-info#params) Params Copy { "method": "subscribe", "params": { "source": "account_info", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-info#stream) Stream Copy { "channel": "account_info", "data": { "ae": "2000", "as": "1500", "aw": "1400", "b": "2000", "f": 1, "mu": "500", "cm": "400", "oc": 10, "pb": "0", "pc": 2, "sc": 2, "t": 1234567890 } } Field Type Description `'ae'` string Account equity `'as'` string Available to spend `'aw'` string Availale to withdraw `'b'` string Account balance `'f'` integer Account fee tier `'mu'` string Total margin used `'cm'` string Maintenance margin required in cross mode `'oc'` integer Orders count `'pb'` string Pending balance `'pc'` integer Positions count `'sc'` integer Stop order count `'t'` number Timestamp in milliseconds [PreviousAccount leverage](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-leverage) [NextAccount positions](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions) Last updated 1 month ago --- # Account orders | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders#params) Params Copy { "method": "subscribe", "params": { "source": "account_orders", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders#stream) Stream Copy { "channel": "account_orders", "data": [\ {\ "i": 1559506586,\ "I": null,\ "s": "BTC",\ "d": "bid",\ "p": "80000",\ "a": "0.00013",\ "f": "0",\ "c": "0",\ "t": 1765016203314,\ "st": null,\ "ot": "limit",\ "sp": null,\ "ro": false\ }\ ], "li": 1559525416 } Field Type Description `'i'` integer Order ID `'I'` Full UUID string Client order ID `'s'` string Symbol `'d'` string Side: \[`bid`, `ask`\] `'p'` decimal string Average filled price `'a'` decimal string Original amount `'f'` decimal string Filled amount `'c'` decimal string Cancelled amount `'t'` integer Timestamp (milliseconds) `'st'` string Stop type (TP/SL) `'ot'` string Order type \[`market`, `limit`\] `'sp'` string Stop price `'ro'` bool Reduce only `'li'` integer Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. [PreviousAccount positions](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions) [NextAccount order updates](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates) Last updated 7 hours ago --- # Account trades | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades#params) Params Copy { "method": "subscribe", "params": { "source": "account_trades", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades#stream) Stream Copy { "channel": "account_trades", "data": [\ {\ "h": 80063441,\ "i": 1559912767,\ "I": null,\ "u": "BrZp5bidJ3WUvceSq7X78bhjTfZXeezzGvGEV4hAYKTa",\ "s": "BTC",\ "p": "89477",\ "o": "89505",\ "a": "0.00036",\ "te": "fulfill_taker",\ "ts": "close_long",\ "tc": "normal",\ "f": "0.012885",\ "n": "-0.022965",\ "t": 1765018588190,\ "li": 1559912767\ }\ ] } Field Type Description `'h'` integer History ID `'i'` integer Order ID `'I'` Full UUID string Client order ID `'u'` sting Account address `'s'` string Symbol `'p'` decimal string Price `'o'` decimal string Entry price `'a'` decimal string Trade amount `'te'` string `'fulfill_maker'` - provided liquidity `'fulfill_taker'` - took liquidity `'ts'` string Trade side `'tc'` string `'normal'` - Regular trade `'market_liquidation'` - liquidated by market order `'backstop_liquidation'` - liquidated by backstop liquidator `'settlement'` - ADL/settlement `'f'` decimal string Trade fee `'n'` decimal string PnL `'t'` number Timestamp in milliseconds `'li'` number Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. [PreviousAccount order updates](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates) [NextTrading operations](https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations) Last updated 6 hours ago --- # Account order updates | Pacifica Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection. ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates#params) Params Copy { "method": "subscribe", "params": { "source": "account_order_updates", "account": "42trU9A5..." } } ### [](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates#stream) Stream Copy { "channel": "account_order_updates", "data": [\ {\ "i": 1559665358,\ "I": null,\ "u": "BrZp5bidJ3WUvceSq7X78bhjTfZXeezzGvGEV4hAYKTa",\ "s": "BTC",\ "d": "bid",\ "p": "89501",\ "ip": "89501",\ "lp": "89501",\ "a": "0.00012",\ "f": "0.00012",\ "oe": "fulfill_limit",\ "os": "filled",\ "ot": "limit",\ "sp": null,\ "si": null,\ "r": false,\ "ct": 1765017049008,\ "ut": 1765017219639,\ "li": 1559696133\ }\ ] } Field Type Description `'i'` integer Order ID `'I'` Full UUID string Client order ID `'u'` base58 encoded address Account `'s'` string Symbol `'d'` string Side: \[`bid`, `ask`\] `'p'` decimal string Average filled price `'ip'` decimal string Initial price `'lp'` decimal string Last filled price `'a'` decimal string Original amount `'f'` decimal string Filled amount `'oe'` string Order event (see below) `'os'` string Order status (see below) `'ot'` string Order type (see below) `'sp'` string Stop price `'si'` string Stop parent order ID `'r'` bool Reduce only `'ct'` integer Created at time (milliseconds) `'ut'` integer Updated at time (milliseconds) `'li'` integer Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. Field Value Description `'oe'` `make` Order placed on book `stop_created` Stop order created `fulfill_market` User filled by market order `fulfill_limit` User filled others limit order `adjust` Order modified `stop_parent_order_filled` Parent order filled `stop_triggered` Stop order activated `stop_upgrade` Stop order upgraded `cancel` User cancelled `force_cancel` Cancelled by system `expired` Time expired `post_only_rejected` Cannot execute ALO `self_trade_prevented` Cannot execute self-trade `'os'` `open` Active on orderbook `partially_filled` Partially filled `filled` Completely filled `cancelled` Cancelled `rejected` Rejected `'ot'` `limit` Limit `market` Market [PreviousAccount orders](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders) [NextAccount trades](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades) Last updated 7 hours ago ---