# Table of Contents - [About Us | Pacifica](#about-us-pacifica) - [Long-Term Vision and Roadmap | Pacifica](#long-term-vision-and-roadmap-pacifica) - [Testnet Guide | Pacifica](#testnet-guide-pacifica) - [Overview | Pacifica](#overview-pacifica) - [Close Beta Guide | Pacifica](#close-beta-guide-pacifica) - [Self-Trade Prevention | Pacifica](#self-trade-prevention-pacifica) - [Deposits & Withdrawals | Pacifica](#deposits-withdrawals-pacifica) - [Order Types | Pacifica](#order-types-pacifica) - [Margin & Leverage | Pacifica](#margin-leverage-pacifica) - [Pre-Markets | Pacifica](#pre-markets-pacifica) - [Contract Specifications | Pacifica](#contract-specifications-pacifica) - [Oracle Price & Mark Price | Pacifica](#oracle-price-mark-price-pacifica) - [Fund Security | Pacifica](#fund-security-pacifica) - [Liquidations | Pacifica](#liquidations-pacifica) - [Connectivity | Pacifica](#connectivity-pacifica) - [Trading Fees | Pacifica](#trading-fees-pacifica) - [Trade outcomes | Pacifica](#trade-outcomes-pacifica) - [Deposit/Withdrawal | Pacifica](#deposit-withdrawal-pacifica) - [Pacifica Hackathon | Pacifica](#pacifica-hackathon-pacifica) - [Funding Rates | Pacifica](#funding-rates-pacifica) - [VIP Program | Pacifica](#vip-program-pacifica) - [Points Program | Pacifica](#points-program-pacifica) - [Referral and Affiliate Program | Pacifica](#referral-and-affiliate-program-pacifica) - [Market Maker Program | Pacifica](#market-maker-program-pacifica) - [Why was I liquidated at a different price to what was previously shown? | Pacifica](#why-was-i-liquidated-at-a-different-price-to-what-was-previously-shown-pacifica) - [Educators Program | Pacifica](#educators-program-pacifica) - [Why was I Liquidated? | Pacifica](#why-was-i-liquidated-pacifica) - [My TP/SL was not triggered despite crossing the price level on the chart | Pacifica](#my-tp-sl-was-not-triggered-despite-crossing-the-price-level-on-the-chart-pacifica) - [My TP/SL didn’t close my position at the exact price I set. | Pacifica](#my-tp-sl-didn-t-close-my-position-at-the-exact-price-i-set-pacifica) - [My TP/SL did not execute properly | Pacifica](#my-tp-sl-did-not-execute-properly-pacifica) - [My TP/SL did not close my position as the price kept moving in a single direction. | Pacifica](#my-tp-sl-did-not-close-my-position-as-the-price-kept-moving-in-a-single-direction-pacifica) - [How do TP/SL limit orders work? | Pacifica](#how-do-tp-sl-limit-orders-work-pacifica) - [Bug Bounty Program | Pacifica](#bug-bounty-program-pacifica) - [Builder Program | Pacifica](#builder-program-pacifica) - [Markets | Pacifica](#markets-pacifica) - [REST API | Pacifica](#rest-api-pacifica) - [API | Pacifica](#api-pacifica) - [Account | Pacifica](#account-pacifica) - [Audits | Pacifica](#audits-pacifica) - [Get account settings | Pacifica](#get-account-settings-pacifica) - [Contact Us | Pacifica](#contact-us-pacifica) - [Update leverage | Pacifica](#update-leverage-pacifica) - [Subaccounts | Pacifica](#subaccounts-pacifica) - [Update margin mode | Pacifica](#update-margin-mode-pacifica) - [Brand Assets | Pacifica](#brand-assets-pacifica) - [Get account info | Pacifica](#get-account-info-pacifica) - [Glossary of Terms | Pacifica](#glossary-of-terms-pacifica) - [Orders | Pacifica](#orders-pacifica) - [Websocket | Pacifica](#websocket-pacifica) - [Get market info | Pacifica](#get-market-info-pacifica) - [Signing | Pacifica](#signing-pacifica) - [Get positions | Pacifica](#get-positions-pacifica) - [Changelog | Pacifica](#changelog-pacifica) - [Get trade history | Pacifica](#get-trade-history-pacifica) - [Get prices | Pacifica](#get-prices-pacifica) - [Get account equity history | Pacifica](#get-account-equity-history-pacifica) - [Get recent trades | Pacifica](#get-recent-trades-pacifica) - [Orderbook | Pacifica](#orderbook-pacifica) - [Tick and lot size | Pacifica](#tick-and-lot-size-pacifica) - [API FAQ | Pacifica](#api-faq-pacifica) - [Market symbols | Pacifica](#market-symbols-pacifica) - [List subaccounts | Pacifica](#list-subaccounts-pacifica) - [Get funding history | Pacifica](#get-funding-history-pacifica) - [Get account balance history | Pacifica](#get-account-balance-history-pacifica) - [Request withdrawal | Pacifica](#request-withdrawal-pacifica) - [Last order ID | Pacifica](#last-order-id-pacifica) - [API Agent Keys | Pacifica](#api-agent-keys-pacifica) - [API Config Keys | Pacifica](#api-config-keys-pacifica) - [Error codes | Pacifica](#error-codes-pacifica) - [Delayed account_positions | Pacifica](#delayed-account-positions-pacifica) - [Rate limits | Pacifica](#rate-limits-pacifica) - [Batch order | Pacifica](#batch-order-pacifica) - [Get candle data | Pacifica](#get-candle-data-pacifica) - [Get mark price candle data | Pacifica](#get-mark-price-candle-data-pacifica) - [Trades | Pacifica](#trades-pacifica) - [Get orderbook | Pacifica](#get-orderbook-pacifica) - [Subscriptions | Pacifica](#subscriptions-pacifica) - [Cancel order | Pacifica](#cancel-order-pacifica) - [Create limit order | Pacifica](#create-limit-order-pacifica) - [Create subaccount | Pacifica](#create-subaccount-pacifica) - [Account margin | Pacifica](#account-margin-pacifica) - [Create market order | Pacifica](#create-market-order-pacifica) - [Get historical funding | Pacifica](#get-historical-funding-pacifica) - [Prices | Pacifica](#prices-pacifica) - [Trading operations | Pacifica](#trading-operations-pacifica) - [Create stop order | Pacifica](#create-stop-order-pacifica) - [403 CloudFront | Pacifica](#403-cloudfront-pacifica) - [Account info | Pacifica](#account-info-pacifica) - [Create limit order | Pacifica](#create-limit-order-pacifica) - [Get order history by ID | Pacifica](#get-order-history-by-id-pacifica) - [Account trades | Pacifica](#account-trades-pacifica) - [Cancel stop order | Pacifica](#cancel-stop-order-pacifica) - [Best bid offer (BBO) | Pacifica](#best-bid-offer-bbo-pacifica) - [Edit order | Pacifica](#edit-order-pacifica) - [Candle | Pacifica](#candle-pacifica) - [Mark price candle | Pacifica](#mark-price-candle-pacifica) - [Get open orders | Pacifica](#get-open-orders-pacifica) - [Create position TP/SL | Pacifica](#create-position-tp-sl-pacifica) - [Batch order | Pacifica](#batch-order-pacifica) - [Account positions | Pacifica](#account-positions-pacifica) - [Get order history | Pacifica](#get-order-history-pacifica) - [Error Handling | Pacifica](#error-handling-pacifica) - [Hardware Wallet | Pacifica](#hardware-wallet-pacifica) - [Account leverage | Pacifica](#account-leverage-pacifica) - [Implementation | Pacifica](#implementation-pacifica) - [Edit order | Pacifica](#edit-order-pacifica) - [Operation Types | Pacifica](#operation-types-pacifica) - [Cancel all orders | Pacifica](#cancel-all-orders-pacifica) - [Create market order | Pacifica](#create-market-order-pacifica) - [Cancel all orders | Pacifica](#cancel-all-orders-pacifica) - [Subaccount fund transfer | Pacifica](#subaccount-fund-transfer-pacifica) - [Cancel order | Pacifica](#cancel-order-pacifica) - [Account order updates | Pacifica](#account-order-updates-pacifica) --- # 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 Roadmapchevron-right](https://pacifica.gitbook.io/docs/pacifica/long-term-vision-and-roadmap) Last updated 1 month ago --- # Long-Term Vision and Roadmap | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/~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=3&quality=100&sign=63b7b9af&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. ### [hashtag](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/~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=3&quality=100&sign=82019c9b&sv=2) #### [hashtag](https://pacifica.gitbook.io/docs/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. #### [hashtag](https://pacifica.gitbook.io/docs/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. #### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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 Uschevron-left](https://pacifica.gitbook.io/docs) [NextClose Beta Guidechevron-right](https://pacifica.gitbook.io/docs/pacifica/close-beta-guide) Last updated 4 months ago * [Our Vision](https://pacifica.gitbook.io/docs/pacifica/long-term-vision-and-roadmap#our-vision) * [What We Have Achieved](https://pacifica.gitbook.io/docs/pacifica/long-term-vision-and-roadmap#what-we-have-achieved) * [Roadmap](https://pacifica.gitbook.io/docs/pacifica/long-term-vision-and-roadmap#roadmap) * [Pacifica Layer 1](https://pacifica.gitbook.io/docs/pacifica/long-term-vision-and-roadmap#pacifica-layer-1) --- # Testnet Guide | Pacifica [PreviousClose Beta Guidechevron-left](https://pacifica.gitbook.io/docs/pacifica/close-beta-guide) [NextOverviewchevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/overview) Last updated 5 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. #### [hashtag](https://pacifica.gitbook.io/docs/trading-on-pacifica/overview#explore-each-section-for-further-explainations-on) Explore each section for further explainations on: * [Contract Specifications](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications) : Detailed specs of supported assets. * [Oracle Price & Mark Price](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) Breakdown of pricing mechanisms. * [Order Types](https://pacifica.gitbook.io/docs/trading-on-pacifica/order-types) : Definitions and trigger conditions. * [Margin & Leverage](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage) : Margin system breakdown. * [Funding Rates](https://pacifica.gitbook.io/docs/trading-on-pacifica/funding-rates) : Calculations and methodology. * [Trading Fees](https://pacifica.gitbook.io/docs/trading-on-pacifica/trading-fees) : Fee/VIP structures. * [Deposits & Withdrawals](https://pacifica.gitbook.io/docs/trading-on-pacifica/deposits-and-withdrawals) : Pacifica currently implements a daily deposit and withdrawal limit. * [Liquidations](https://pacifica.gitbook.io/docs/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 Guidechevron-left](https://pacifica.gitbook.io/docs/pacifica/testnet-guide) [NextContract Specificationschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications) Last updated 1 month ago --- # Close Beta Guide | Pacifica [PreviousLong-Term Vision and Roadmapchevron-left](https://pacifica.gitbook.io/docs/pacifica/long-term-vision-and-roadmap) [NextTestnet Guidechevron-right](https://pacifica.gitbook.io/docs/pacifica/testnet-guide) Last updated 5 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 Typeschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/order-types) [NextMargin & Leveragechevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage) Last updated 3 months 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. [hashtag](https://pacifica.gitbook.io/docs/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. * * * [hashtag](https://pacifica.gitbook.io/docs/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 & Leveragearrow-up-right](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. ### [hashtag](https://pacifica.gitbook.io/docs/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. [PreviousLiquidationschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/liquidations) [NextFund Securitychevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security) Last updated 4 months ago * [Deposits](https://pacifica.gitbook.io/docs/trading-on-pacifica/deposits-and-withdrawals#deposits) * [Withdrawals](https://pacifica.gitbook.io/docs/trading-on-pacifica/deposits-and-withdrawals#withdrawals) * [Requirements & Notes](https://pacifica.gitbook.io/docs/trading-on-pacifica/deposits-and-withdrawals#requirements-and-notes) --- # 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. [PreviousPre-Marketschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/pre-markets) [NextSelf-Trade Preventionchevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/self-trade-prevention) Last updated 5 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._ ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage#isolated-margin) Isolated Margin Isolated margin assigns a dedicated margin amount to each individual position. ### [hashtag](https://pacifica.gitbook.io/docs/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) #### [hashtag](https://pacifica.gitbook.io/docs/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 Preventionchevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/self-trade-prevention) [NextFunding Rateschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/funding-rates) Last updated 2 months ago * [Cross Margin](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage#cross-margin) * [Isolated Margin](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage#isolated-margin) * [Initial Margin Calculation](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage#initial-margin-calculation) --- # Pre-Markets | Pacifica When Pacifica lists pre-markets that are not on other major exchanges, the oracle references Pacifica's mark price instead of external sources. An EMA is also applied to prevent oracle manipulation. This, combined with Pacifica's price band mechanic (+-30% of mark price) prevents extreme manipulation of pre-market perps. Once other major venues begin listing the same market, their pricing will be added to Pacifica's oracle reference in order to further strengthen its robustness. Additionally, Pacifica exercise strict open interest caps in pre-market pairs to prevent abnormal trading activity and market manipulation. [PreviousOracle Price & Mark Pricechevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) [NextOrder Typeschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/order-types) Last updated 3 months 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. ### [hashtag](https://pacifica.gitbook.io/docs/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 ### [hashtag](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/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. [PreviousOverviewchevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/overview) [NextOracle Price & Mark Pricechevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price) Last updated 3 months ago * [Pacifica Contract Specifications](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications#pacifica-contract-specifications) * [Detailed Contract Information](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications#detailed-contract-information) --- # 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. ### [hashtag](https://pacifica.gitbook.io/docs/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 USDT denominated prices from major exchanges. CEX Weights Binance 2 OKX 1 Bybit 1 Hyperliquid 1 ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/api-documentation/api) or contact our support via [Contact Us](https://pacifica.gitbook.io/docs/other/contact-us) . [PreviousContract Specificationschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications) [NextPre-Marketschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/pre-markets) Last updated 2 months ago * [Oracle Price Calculation](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#oracle-price-calculation) * [Uses of Oracle Price on Pacifica](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#uses-of-oracle-price-on-pacifica) * [Uses of Mark Price on Pacifica](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#uses-of-mark-price-on-pacifica) * [Transparency & Reliability](https://pacifica.gitbook.io/docs/trading-on-pacifica/contract-specifications/oracle-price-and-mark-price#transparency-and-reliability) --- # 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. [hashtag](https://pacifica.gitbook.io/docs/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. [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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 [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. [hashtag](https://pacifica.gitbook.io/docs/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 & Withdrawalschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/deposits-and-withdrawals) [NextPacifica Hackathonchevron-right](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon) Last updated 5 months ago * [The Inherent Tension: Power vs. Protection](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#the-inherent-tension-power-vs.-protection) * [The Pacifica Protocol: Layered, Proactive Security](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#the-pacifica-protocol-layered-proactive-security) * [The Hot Wallet: The Engine of Commerce](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#the-hot-wallet-the-engine-of-commerce) * [The Cold Vault: The Fortress of Funds](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#the-cold-vault-the-fortress-of-funds) * [The Unbreakable Chain of Custody](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#the-unbreakable-chain-of-custody) * [Signer-Level Separation: The Technical Advantage](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#signer-level-separation-the-technical-advantage) * [Why This is a Better Solution](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#why-this-is-a-better-solution) * [Uncompromising Decentralization](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#uncompromising-decentralization) * [Verifiable Security Over Blind Trust](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#verifiable-security-over-blind-trust) * [Built for Scale](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#built-for-scale) * [Conclusion: Security as a First Principle](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security#conclusion-security-as-a-first-principle) --- # 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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. \*Due to their experimental/volatile nature, Pacifica's backstop liquidator does not take on positions from the following markets: `URNM, GOLD, SILVER, PAXG, CL, COPPER, NATGAS, EURUSD, USDJPY, NVDA, TSLA, PLTR, SP500, GOOGL, CRCL, HOOD, MEGA, BP` * * * These proactive measures ensure that Pacifica’s liquidation process remains robust and fair, protecting traders from cascading liquidations and maintaining overall market stability. [PreviousTrading Feeschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/trading-fees) [NextDeposits & Withdrawalschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/deposits-and-withdrawals) Last updated 14 days ago * [Liquidation Price Formula:](https://pacifica.gitbook.io/docs/trading-on-pacifica/liquidations#liquidation-price-formula) * [Three-Tiered Liquidation Process](https://pacifica.gitbook.io/docs/trading-on-pacifica/liquidations#three-tiered-liquidation-process) --- # Connectivity | Pacifica If you’re experiencing issues connecting your wallet to Pacifica - such as a repeated “Connect Wallet” loop, failed transaction signing, or your wallet extension not loading - try the troubleshooting steps below. * * * ### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#troubleshooting-steps) Troubleshooting Steps #### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#id-1.-update-wallet-extension) 1\. Update Wallet Extension Ensure your wallet extension is updated to the latest version and enabled in your browser. * Open your browser’s extension manager. * Confirm wallet is enabled. * Update to the latest version if available. #### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#id-2.-hard-refresh-and-clear-cache) 2\. Hard Refresh and Clear Cache Perform a hard refresh of your browser: * **Windows:** `Ctrl + Shift + R` * **Mac:** `Cmd + Shift + R` If the issue persists, clear your browser cache and reload the page. #### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#id-3.-disconnect-and-reconnect-wallet) 3\. Disconnect and Reconnect Wallet In wallet: 1. Go to **Settings → Trusted Apps**. 2. Remove Pacifica from the trusted list. 3. Refresh Pacifica and reconnect your wallet. #### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#id-4.-verify-network-solana-mainnet) 4\. Verify Network (Solana Mainnet) Pacifica's deposit/withdrawal operates on Solana. * Ensure your wallet is is connected to **Solana Mainnet**. * If necessary, switch to Devnet or Testnet and then switch back to Mainnet to reset the connection. * Confirm you are not connected to an unsupported cluster. #### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#id-5.-disable-other-wallet-extensions) 5\. Disable Other Wallet Extensions If you have multiple Solana wallet extensions installed, temporarily disable the others and attempt to reconnect using Phantom only. ### [hashtag](https://pacifica.gitbook.io/docs/support/connectivity#additional-steps) Additional Steps If the above does not resolve the issue: * Try opening Pacifica in an incognito/private browser window (with Phantom enabled). * Restart your browser. * Restart your device. If you continue to experience issues, please contact support and include: * Browser and version * Phantom version * Operating system * Screenshot of the error message * Whether you are on desktop or mobile [PreviousPacifica Hackathonchevron-left](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon) [NextDeposit/Withdrawalchevron-right](https://pacifica.gitbook.io/docs/support/deposit-withdrawal) Last updated 1 month ago * [Troubleshooting Steps](https://pacifica.gitbook.io/docs/support/connectivity#troubleshooting-steps) * [Additional Steps](https://pacifica.gitbook.io/docs/support/connectivity#additional-steps) --- # 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. This week **(March 24th - March 31st)**, trading **RWA (Real World Assets)** on Pacifica comes with a **50% discount on all fees**. That means, for the duration of the promotion, both **Maker and Taker fees are cut in half**. **Promotion Details:** * **Start:** Tuesday, Mar 24th at 01:00 UTC * **End:** Tuesday, Mar 31st at 01:00 UTC **During this campaign, these are the RWA market fees:** Tier 14-day Rolling Volume Maker Fee Taker Fee 1 0 0.0075% 0.020% 2 \> $5,000,000 0.006% 0.019% 3 \> $10,000,000 0.0045% 0.018% 4 \> $25,000,000 0.003% 0.017% 5 \> $50,000,000 0.0015% 0.016% VIP 1 \> $100,000,000 0.000% 0.015% VIP 2 \> $250,000,000 0.000% 0.0145% VIP 3 \> $500,000,000 0.000% 0.014% These fees apply to **all RWA markets**, including: _PLATINUM, URNM, GOLD, SILVER, PAXG, CL, COPPER, NATGAS, EURUSD, USDJPY, NVDA, TSLA, PLTR, SP500, GOOGL, CRCL, HOOD_ Note: * All volume thresholds refer to your total executed trading volume in USD equivalent. * Fees are settled automatically for each trade upon execution. [PreviousFunding Rateschevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/funding-rates) [NextLiquidationschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/liquidations) Last updated 16 days ago --- # Trade outcomes | Pacifica [Why was I Liquidated?chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/why-was-i-liquidated) [My TP/SL did not execute properlychevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly) [PreviousDeposit/Withdrawalchevron-left](https://pacifica.gitbook.io/docs/support/deposit-withdrawal) [NextWhy was I Liquidated?chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/why-was-i-liquidated) --- # Deposit/Withdrawal | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/support/deposit-withdrawal#deposits) Deposits **Supported asset:** * Please deposit USDC on **Solana** only Deposits sent via any other network or token (e.g., Ethereum, Arbitrum, USDT, SOL) will not be credited. **Minimum deposit:** * 10 USDC Deposits below 10 USDC will not be automatically credited. You may send additional USDC to the same address to reach the minimum. Deposits are usually credited within minutes, but may be delayed due to: * Solana network congestion * RPC instability * Temporary infrastructure load Always verify the transaction on a Solana block explorer before contacting support. * * * ### [hashtag](https://pacifica.gitbook.io/docs/support/deposit-withdrawal#withdrawals) Withdrawals Withdrawals are processed via **USDC on Solana** only. Your Solana wallet must: * Have a valid USDC token account If you encounter an error, ensure there is a **non-zero amount of USDC** already in your wallet to initialize the token account, then retry. Withdrawal delays may occur during periods of Solana network congestion. * * * ### [hashtag](https://pacifica.gitbook.io/docs/support/deposit-withdrawal#important) Important We highly recommend depositing and withdrawing directly through the Pacifica front-end to avoid errors. Before sending funds: * Double-check the network (Solana) * Confirm the token is USDC * Consider sending a small test transaction for large transfers If issues persist, contact support with your transaction signature (TXID) and relevant details. [PreviousConnectivitychevron-left](https://pacifica.gitbook.io/docs/support/connectivity) [NextTrade outcomeschevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes) Last updated 1 month ago * [Deposits](https://pacifica.gitbook.io/docs/support/deposit-withdrawal#deposits) * [Withdrawals](https://pacifica.gitbook.io/docs/support/deposit-withdrawal#withdrawals) * [Important](https://pacifica.gitbook.io/docs/support/deposit-withdrawal#important) --- # Pacifica Hackathon | Pacifica ![Page cover](https://pacifica.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FI77utZbXIIHrjqjeiqrR%252FScreenshot%25202026-02-25%2520at%252022.09.09.png%3Falt%3Dmedia%26token%3D6d027f5d-9dec-40e9-8174-ef2bfd5fe6c6&width=1248&dpr=3&quality=100&sign=41937a5f&sv=2)![Page cover](https://pacifica.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FI77utZbXIIHrjqjeiqrR%252FScreenshot%25202026-02-25%2520at%252022.09.09.png%3Falt%3Dmedia%26token%3D6d027f5d-9dec-40e9-8174-ef2bfd5fe6c6&width=1248&dpr=3&quality=100&sign=41937a5f&sv=2) #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#overview) Overview The Pacifica Hackathon is a one month, online event designed to bring together developers, quants, and builders to create innovative applications on Pacifica’s perpetuals infrastructure. Participants can compete individually or in teams of up to five members, exploring multiple tracks ranging from trading automation to DeFi composability. The hackathon is ideal for algorithmic traders, DeFi developers, data engineers, product builders, students, and hackathon enthusiasts seeking to leverage Pacifica’s APIs and builder tools. **Registration:** [https://forms.gle/1FP2EuvZqYiP7Tiy7arrow-up-right](https://forms.gle/1FP2EuvZqYiP7Tiy7) #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#timeline) Timeline Dates Period Description **Feb 25th** Announcement The hackathon opens with a welcome AMA and a walkthrough of the Pacifica API. Participants form teams and familiarize themselves with available resources. **Mar 16th to Apr 16th** Start / Dev Period Teams actively build their projects. Weekly office hours will be available. Additional asynchronous support is available via Discord. **Apr 16th** Submission Deadline All teams must finalize their projects and submit the required materials, including code, demo videos, and documentation. This is the final opportunity to ensure projects are complete. **Post Submissions** Demo Day Teams present their projects to the judging panel. Judges evaluate submissions based on innovation, technical execution, user experience, potential impact, and presentation. Winners are announced as the event ends. * Teams are encouraged to plan development in stages: early prototyping, core functionality and testing, and polishing, demo prep, and submission. * Attendance at the kickoff and demo day is strongly recommended for all participants. #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#tracks) Tracks 1. Trading Applications & Bots - Algorithmic trading, execution optimisation 2. Analytics & Data - Market intelligence, PnL tracking, risk dashboards 3. Social & Gamification - Leaderboards, copy trading, competitions 4. DeFi Composability - Building on top of Pacifica's perps infrastructure **Project Ideas by Track:** [Linkarrow-up-right](https://docs.google.com/document/d/1olkc-BkxzOF7oXP-RC4H1feMre1TFcZ-Pg0SsxRZyec/edit?usp=sharing) #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#team-rules) Team Rules * Participants can join **solo or in teams of up to 5 members**. * Teams must **register** via the [official formarrow-up-right](https://forms.gle/1FP2EuvZqYiP7Tiy7) and join **Discord** for communication. * Team members are recommended to **attend the kickoff** and **demo day**. * Teams are responsible for [submittingarrow-up-right](https://forms.gle/zYm9ZBH1SoUE9t9o7) **their own work** by the deadline. * Teams can **change members** only during the first half of the hackathon. * Teams MUST use **Pacifica API and/or Builder Code** to build their projects. * All work presented in the hackathon **must be created during the hackathon period**. Pre-built projects or prior work are not eligible. * Submissions must reflect **work performed by the registered team members**; external code or contributions must be clearly acknowledged. #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#judging-criteria) Judging Criteria Submissions will be evaluated by a panel during the demo day according to the following criteria: * **Innovation**: Novelty and creative use of Pacifica’s infrastructure. * **Technical Execution**: Code quality, API integration, and overall development rigor. * **User Experience**: Polish, usability, and intuitive design. * **Potential Impact**: Likelihood that traders or users would adopt the solution. * **Presentation**: Clarity and effectiveness of the demo. #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#submission-guidelines) Submission Guidelines Teams must submit their projects by the 16th of April using the [official submission form.arrow-up-right](https://forms.gle/zYm9ZBH1SoUE9t9o7) Here is a detailed submission guideline to help you on your submission: [Guide Linkarrow-up-right](https://docs.google.com/document/d/1zhXM0-WIwuhM8l_A2Q8WeQpVvHSTU9UAzgLJyxxt3-k/edit?usp=sharing) #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#developer-resources) Developer Resources * Builder Program: [https://docs.pacifica.fi/builder-programarrow-up-right](https://docs.pacifica.fi/builder-program) * API Documentation: [https://docs.pacifica.fi/api-documentation/apiarrow-up-right](https://docs.pacifica.fi/api-documentation/api) * Pacifica Python SDK: [https://github.com/pacifica-fi/python-sdkarrow-up-right](https://github.com/pacifica-fi/python-sdk) * Pacifica Discord API Channel: [Channel Linkarrow-up-right](https://discord.com/channels/1325864651816435822/1378723526957334548) * Pacifica Testnet: [https://test-app.pacifica.fi/arrow-up-right](https://test-app.pacifica.fi/) (Use code "Pacifica") Technical support will be provided via the dedicated discord [Builder Channelarrow-up-right](https://discord.com/channels/1325864651816435822/1466029551498035241) . Additionally, you can open a support ticket on our [Discordarrow-up-right](http://discord.gg/pacifica) or text @PacificaTGPortalBot on telegram for more help. Furthermore, part of the team will be available every week during the hackathon for **office hours**; these will be hosted in the discord [Hackathon Stagearrow-up-right](https://discord.com/channels/1325864651816435822/1466029925218914396) . Please refer to our [discordarrow-up-right](https://discord.com/channels/1325864651816435822/1325865579474849866) / [telegramarrow-up-right](https://t.me/PacificaTGA) announcements channel to learn more. #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#sponsor-tools) Sponsor Tools Participants in the Pacifica Hackathon will have access to a selection of sponsor-provided tools to enhance their projects: * Fuul: [https://www.fuul.xyz/arrow-up-right](https://www.fuul.xyz/) * Rhinofi: [https://rhino.fiarrow-up-right](https://rhino.fi/) * Privy: [https://www.privy.io/arrow-up-right](https://www.privy.io/) * Elfa AI: [https://www.elfa.ai/arrow-up-right](https://elfaai.notion.site/Elfa-x-Pacifica-Powering-Hackathon-Teams-with-Social-Intelligence-317a7efd0810807293c9f40049dd8c0a) #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#prizes-and-rewards) Prizes and Rewards ![](https://pacifica.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252FzKd8mtRLHZzn7gfGCQi8%252FScreenshot%25202026-03-01%2520at%252017.10.38.png%3Falt%3Dmedia%26token%3D848df313-c118-46f0-bdfe-71b58fb770a6&width=768&dpr=3&quality=100&sign=9e3fd6e&sv=2) The Pacifica Hackathon offers a total of $15,000 in cash rewards and 100,000 points distributed across the Grand Prize, Track Winners, and Special Awards. The **Grand Prize - Best Overall** will be awarded to one winner, who will receive $5,000 and 30,000 points. This winner is also considered a track winner and will receive the corresponding track prize. There are four **Track Winners**, one per track: Trading Applications & Bots, Analytics & Data, Social & Gamification, and DeFi Composability. Each track winner receives $2,000 and 14,000 points. Since the Grand Prize winner is also a track winner, one of the four track winners overlaps with the Grand Prize recipient. Two **Special Awards** will be given for categories such as Most Innovative Use of Pacifica and Best User Experience. Each special award winner will receive $1,000 and 7,000 points. In total, the hackathon will distribute $15,000 in cash and 100,000 points across all winners. #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#faq) FAQ For questions regarding eligibility, submissions, and rules, participants are encouraged to review the Hackathon FAQ: [Hackathon FAQarrow-up-right](https://docs.google.com/document/d/1RlbAXxAWDVLnkT14hiDmfOmxudDGm3WPBwKDW4Yfovg/edit?usp=sharing) #### [hashtag](https://pacifica.gitbook.io/docs/hackathon/pacifica-hackathon#oboarding-guides) Oboarding Guides Mainnet: [https://pacifica.gitbook.io/docs/pacifica/close-beta-guidearrow-up-right](https://pacifica.gitbook.io/docs/pacifica/close-beta-guide) Testnet: [https://pacifica.gitbook.io/docs/pacifica/testnet-guidearrow-up-right](https://pacifica.gitbook.io/docs/pacifica/testnet-guide) [PreviousFund Securitychevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/fund-security) [NextConnectivitychevron-right](https://pacifica.gitbook.io/docs/support/connectivity) Last updated 1 month 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. ### [hashtag](https://pacifica.gitbook.io/docs/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) ### [hashtag](https://pacifica.gitbook.io/docs/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 & Leveragechevron-left](https://pacifica.gitbook.io/docs/trading-on-pacifica/margin-and-leverage) [NextTrading Feeschevron-right](https://pacifica.gitbook.io/docs/trading-on-pacifica/trading-fees) Last updated 1 year ago * [Funding Rate Calculation](https://pacifica.gitbook.io/docs/trading-on-pacifica/funding-rates#funding-rate-calculation) * [Effect on Isolated Positions and Liquidations](https://pacifica.gitbook.io/docs/trading-on-pacifica/funding-rates#effect-on-isolated-positions-and-liquidations) --- # 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 [Discordarrow-up-right](http://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 Programchevron-left](https://pacifica.gitbook.io/docs/programs/builder-program) [NextEducators Programchevron-right](https://pacifica.gitbook.io/docs/programs/educators-program) Last updated 1 month 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://pacifica.gitbook.io/docs/~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=3&quality=100&sign=a4384cd9&sv=2) ### [hashtag](https://pacifica.gitbook.io/docs/programs/points-program#faq) FAQ: #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. [PreviousHow do TP/SL limit orders work?chevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work) [NextReferral and Affiliate Programchevron-right](https://pacifica.gitbook.io/docs/programs/referral-and-affiliate-program) Last updated 3 months ago --- # Referral and Affiliate Program | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/programs/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/referralarrow-up-right](https://app.pacifica.fi/referral) , and share them with others to use in order to sign into Pacifica as your referee. ![](https://pacifica.gitbook.io/docs/~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=3&quality=100&sign=1d9a75c9&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 referral 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://pacifica.gitbook.io/docs/~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=3&quality=100&sign=9cf6c14a&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://pacifica.gitbook.io/docs/~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=3&quality=100&sign=4b00d4b3&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 a referral code you must deposit. ![](https://pacifica.gitbook.io/docs/~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=3&quality=100&sign=3ec363c1&sv=2) ### [hashtag](https://pacifica.gitbook.io/docs/programs/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/pacificaarrow-up-right](https://discord.gg/pacifica) for additional information. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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 Programchevron-left](https://pacifica.gitbook.io/docs/programs/points-program) [NextMarket Maker Programchevron-right](https://pacifica.gitbook.io/docs/programs/market-maker-program) Last updated 2 days ago * [Referrals](https://pacifica.gitbook.io/docs/programs/referral-and-affiliate-program#referrals) * [Affiliates](https://pacifica.gitbook.io/docs/programs/referral-and-affiliate-program#affiliates) --- # Market Maker Program | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/programs/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 ### [hashtag](https://pacifica.gitbook.io/docs/programs/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. ### [hashtag](https://pacifica.gitbook.io/docs/programs/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 ### [hashtag](https://pacifica.gitbook.io/docs/programs/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: 12% of total trading fees collected from all market maker counterparties. The Points pool to be distributed each period is 2,000,000 points (1,000,000/week) ### [hashtag](https://pacifica.gitbook.io/docs/programs/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. ### [hashtag](https://pacifica.gitbook.io/docs/programs/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 [ops@pacifica.fienvelope](mailto:undefined) or open a ticket at [discord.gg/pacificaarrow-up-right](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 Programchevron-left](https://pacifica.gitbook.io/docs/programs/referral-and-affiliate-program) [NextBuilder Programchevron-right](https://pacifica.gitbook.io/docs/programs/builder-program) Last updated 2 months ago * [Program Overview](https://pacifica.gitbook.io/docs/programs/market-maker-program#program-overview) * [Eligibility](https://pacifica.gitbook.io/docs/programs/market-maker-program#eligibility) * [Scoring](https://pacifica.gitbook.io/docs/programs/market-maker-program#scoring) * [Rewards](https://pacifica.gitbook.io/docs/programs/market-maker-program#rewards) * [Additional Specs](https://pacifica.gitbook.io/docs/programs/market-maker-program#additional-specs) * [Full Details and Application](https://pacifica.gitbook.io/docs/programs/market-maker-program#full-details-and-application) --- # Why was I liquidated at a different price to what was previously shown? | Pacifica This is most likely a result of cross margining. 1. When you are using cross margin, all your open positions share the same margin pool. 2. The displayed liquidation price is conditional: it typically assumes your other positions don’t change materially. 3. When multiple positions move against you at the same time: losses are accumulated across multiple positions simultaneously. 4. This means shared margin was consumed faster: your total account equity drops quicker than a single-position estimate. 5. Liquidation thresholds adjusted upward in real time: as equity falls, the effective liquidation prices for each position increases. 6. Liquidation triggered at the account level: once total margin fell below requirements, liquidation occurred even if one market hadn’t reached the originally displayed price. How to prevent this: 1. Use isolated margin if you want more stable, predictable liquidation prices per position. 2. Avoid holding multiple correlated positions at high leverage on cross margin. [PreviousWhy was I Liquidated?chevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/why-was-i-liquidated) [NextMy TP/SL did not execute properlychevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly) Last updated 1 month ago --- # Educators Program | Pacifica The **Educators Program** has been **discontinued** until further notice. We will review all submissions up to date and will share more details regarding winning submissions soon. Thanks for everyone who has participated! Winning submissions will be announced on our discord: [discord.gg/pacificaarrow-up-right](https://t.co/mJbPQx0UY7) [PreviousVIP Programchevron-left](https://pacifica.gitbook.io/docs/programs/vip-program) [NextBug Bounty Programchevron-right](https://pacifica.gitbook.io/docs/programs/bug-bounty-program) Last updated 2 months ago --- # Why was I Liquidated? | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/why-was-i-liquidated#what-happens-during-liquidation) What Happens During Liquidation A liquidation occurs when your position moves against you and your account equity falls below the required **maintenance margin**. When this happens: * Your position is automatically closed by the system * You will see **“Market Liquidation”** in your Trade History * The position size will be reduced to zero (or partially reduced if partial liquidation applies) * Your available balance and margin will update accordingly Liquidations are triggered based on mark price and maintenance margin requirements, not just last traded price. You can read more about how liquidations work on Pacifica here: [https://docs.pacifica.fi/trading-on-pacifica/liquidationsarrow-up-right](https://docs.pacifica.fi/trading-on-pacifica/liquidations) [PreviousTrade outcomeschevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes) [NextWhy was I liquidated at a different price to what was previously shown?chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/why-was-i-liquidated/why-was-i-liquidated-at-a-different-price-to-what-was-previously-shown) Last updated 1 month ago --- # My TP/SL was not triggered despite crossing the price level on the chart | Pacifica This is likely because of the mark price being used to trigger stops. Using mark price to trigger stops have the advantage of having exchange-isolated 'wicks' not trigger a user's orders. If you would like to have TP/SL be triggered using last traded orderbook price, you can change the trigger condition of your stop orders when placing a stop order to "Last traded" ![](https://pacifica.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F727612817-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FO2lcakUmUFILzrKCX989%252Fuploads%252Fs03XSZaFMHNg3M01vc74%252FScreenshot%25202026-02-23%2520at%25204.34.11%25E2%2580%25AFpm.png%3Falt%3Dmedia%26token%3Da15d6b5d-d4c6-4ac8-81bb-a4d4ba706579&width=300&dpr=3&quality=100&sign=f4f52be8&sv=2) [PreviousMy TP/SL did not close my position as the price kept moving in a single direction.chevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-did-not-close-my-position-as-the-price-kept-moving-in-a-single-direction.) [NextHow do TP/SL limit orders work?chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work) Last updated 1 month ago --- # My TP/SL didn’t close my position at the exact price I set. | Pacifica This is normal behavior. A stop loss works very differently from a limit order. A limit order executes only at the specified price or better. A stop order, on the other hand, is triggered when the mark or last traded price reaches the user’s specified trigger level (this can be customized on Pacifica). During periods of volatility, orderbook prices can move past the trigger level before triggering the stop order. This is especially true when mark price is used. This, along with natural orderbook slippage - which can be higher during periods of volatility - causes discrepancies between TP/SL prices and actual execution. This is expected behavior across all exchanges, and it’s extremely rare for a TP/SL order to execute exactly at the trigger price due to normal market movement and liquidity dynamics. [PreviousMy TP/SL did not execute properlychevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly) [NextMy TP/SL did not close my position as the price kept moving in a single direction.chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-did-not-close-my-position-as-the-price-kept-moving-in-a-single-direction.) Last updated 1 month ago --- # My TP/SL did not execute properly | Pacifica [My TP/SL didn’t close my position at the exact price I set.chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-didnt-close-my-position-at-the-exact-price-i-set.) [My TP/SL did not close my position as the price kept moving in a single direction.chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-did-not-close-my-position-as-the-price-kept-moving-in-a-single-direction.) [My TP/SL was not triggered despite crossing the price level on the chartchevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-was-not-triggered-despite-crossing-the-price-level-on-the-chart) [How do TP/SL limit orders work?chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work) [PreviousWhy was I liquidated at a different price to what was previously shown?chevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/why-was-i-liquidated/why-was-i-liquidated-at-a-different-price-to-what-was-previously-shown) [NextMy TP/SL didn’t close my position at the exact price I set.chevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-didnt-close-my-position-at-the-exact-price-i-set.) Last updated 1 month ago --- # My TP/SL did not close my position as the price kept moving in a single direction. | Pacifica A stop-limit order works in two stages: When the trigger price is reached, it places a limit order at the specified limit price. That limit order will then attempt to execute at that price or better. However, if the market falls through your limit price and doesn’t recover, the limit order may remain unfilled, creating the impression that the stop-limit didn’t work. In reality, it worked as intended - it just couldn’t execute because the market moved past your limit. To guarantee that your position closes once the trigger is hit, consider using a stop-market order instead of a stop-limit order. Stop-market orders prioritize execution, while stop-limits prioritize price. Especially if using stops to prevent liquidation, we highly recommend using stop market orders to guarantee execution. [PreviousMy TP/SL didn’t close my position at the exact price I set.chevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-didnt-close-my-position-at-the-exact-price-i-set.) [NextMy TP/SL was not triggered despite crossing the price level on the chartchevron-right](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-was-not-triggered-despite-crossing-the-price-level-on-the-chart) Last updated 1 month ago --- # How do TP/SL limit orders work? | Pacifica [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#stop-loss-sl-and-take-profit-tp-limit-orders) Stop-Loss (SL) and Take-Profit (TP) Limit Orders -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Stop-Loss and Take-Profit orders are triggered by the **mark/last/mid price**. Once triggered, a limit order is placed to try close off your position. * * * ### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#long-positions) Long Positions #### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#stop-loss-sl) Stop-Loss (SL) If you are long and set: * **Trigger price:** $25 * **Limit price:** $25 When the mark price falls below $25, a **limit sell order at $25** will be placed. If the market drops quickly from $26 to $23, your order may rest at $25 without filling. If instead you set: * **Limit price:** $22 The order has a higher probability of filling somewhere between $23 and $22 during a sharp move. Lower limit prices increase fill probability but may result in worse execution. * * * #### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#take-profit-tp) Take-Profit (TP) If you are long and set: * **Trigger price:** $32 * **Limit price:** $31.50 When the mark price rises above $32, a **limit sell order at $31.50** will be placed. This protects you from selling below $31.50 if the price quickly retraces after triggering. * * * ### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#short-positions) Short Positions #### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#stop-loss-sl-1) Stop-Loss (SL) If you are short and set: * **Trigger price:** $30 * **Limit price:** $30 When the mark price rises above $30, a **limit buy order at $30** will be placed. If the market spikes rapidly from $29 to $33, your order may not fill. If instead you set: * **Limit price:** $34 The order has a higher probability of filling somewhere between $33 and $34 during fast upward moves. Higher limit prices improve fill probability but may result in worse execution. * * * #### [hashtag](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#take-profit-tp-1) Take-Profit (TP) If you are short and set: * **Trigger price:** $20 * **Limit price:** $20.50 When the mark price falls below $20, a **limit buy order at $20.50** will be placed. This ensures the order will not fill at a worse price (above $20.50) if the market rebounds after triggering. [PreviousMy TP/SL was not triggered despite crossing the price level on the chartchevron-left](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/my-tp-sl-was-not-triggered-despite-crossing-the-price-level-on-the-chart) [NextPoints Programchevron-right](https://pacifica.gitbook.io/docs/programs/points-program) Last updated 1 month ago * [Stop-Loss (SL) and Take-Profit (TP) Limit Orders](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#stop-loss-sl-and-take-profit-tp-limit-orders) * [Long Positions](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#long-positions) * [Short Positions](https://pacifica.gitbook.io/docs/support/trade-outcomes/my-tp-sl-did-not-execute-properly/how-do-tp-sl-limit-orders-work#short-positions) --- # 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. [hashtag](https://pacifica.gitbook.io/docs/programs/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 ops@pacifica.fi or open a ticket on Pacifica's [Discordarrow-up-right](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/BTCarrow-up-right](https://test-app.pacifica.fi/trade/BTC) * 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 ops@pacifica.fi or on [Discordarrow-up-right](https://discord.gg/pacifica) for more on using the Pacifica testnet * * * ### [hashtag](https://pacifica.gitbook.io/docs/programs/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: #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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. * * * ### [hashtag](https://pacifica.gitbook.io/docs/programs/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: ops@pacifica.fi (flag any such reports as \[important\] or \[urgent\]. * Alternatively, reach out to the team on [Discordarrow-up-right](http://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. * * * ### [hashtag](https://pacifica.gitbook.io/docs/programs/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. * * * ### [hashtag](https://pacifica.gitbook.io/docs/programs/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. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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 Programchevron-left](https://pacifica.gitbook.io/docs/programs/educators-program) [NextAPIchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api) Last updated 2 days ago * [Pacifica Bug Bounty Program Rules](https://pacifica.gitbook.io/docs/programs/bug-bounty-program#pacifica-bug-bounty-program-rules) * [Bug Bounty Vulnerability Levels](https://pacifica.gitbook.io/docs/programs/bug-bounty-program#bug-bounty-vulnerability-levels) * [Submission Process](https://pacifica.gitbook.io/docs/programs/bug-bounty-program#submission-process) * [Prohibited Activity](https://pacifica.gitbook.io/docs/programs/bug-bounty-program#prohibited-activity) * [Eligibility](https://pacifica.gitbook.io/docs/programs/bug-bounty-program#eligibility) --- # 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** to reward teams building on Pacifica's Builder Program. As of the 12th of March, 2026, the **builder rewards program** has been **extended** by an additional three months. Volume two will run from **March 12th, 2026 to June 12th, 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. ### [hashtag](https://pacifica.gitbook.io/docs/programs/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 implementationarrow-up-right](https://docs.pacifica.fi/api-documentation/api/signing/implementation) , compact and sort this payload recursively to generate the signature. **Complete Payload (After Signing)** **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:** **Revoke Builder Code Authorization (Optional)** Users can revoke authorization at any time: **Data to be Signed** **Complete Payload (After Signing)** **Endpoint:** `POST https://api.pacifica.fi/api/v1/account/builder_codes/revoke` ### [hashtag](https://pacifica.gitbook.io/docs/programs/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** **Complete Payload (After Signing)** **Endpoint:** `POST https://api.pacifica.fi/api/v1/orders/create_market` **Example: Create Limit Order with Builder Code** **Data to be Signed** **Endpoint:** `POST https://api.pacifica.fi/api/v1/orders/create` **Example: Set Position TP/SL with Builder Code** **Data to be Signed** **Complete Payload (After Signing)** **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. ### [hashtag](https://pacifica.gitbook.io/docs/programs/builder-program#implementation-notes) Implementation Notes * **Signature Generation:** Follow the standard [signing implementationarrow-up-right](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` ### [hashtag](https://pacifica.gitbook.io/docs/programs/builder-program#update-builder-code-fee-rate) Update Builder Code Fee Rate Update the fee rate for your builder code. This endpoint is for builder account owners to change the fee they charge on orders sent with their builder code. **Request User Authorization (Sign & Send)** Builder account owner to sign an update containing the builder code and the new fee rate. **Data to be Signed** **Complete Payload (After Signing)** **Endpoints:** `POST https://api.pacifica.fi/api/v1/builder/update_fee_rate` ### [hashtag](https://pacifica.gitbook.io/docs/programs/builder-program#referral-code-claim) Referral Code Claim Users can claim a referral code to establish a referral relationship with the code's owner. #### [hashtag](https://pacifica.gitbook.io/docs/programs/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** After following the signing implementation, compact and sort this payload recursively to generate the signature. **Complete Payload (After Signing)** **Endpoint:** `POST https://api.pacifica.fi/api/v1/referral/user/code/claim` ### [hashtag](https://pacifica.gitbook.io/docs/programs/builder-program#useful-endpoints) **Useful Endpoints** * User trade history via specific builder code: `https://api.pacifica.fi/api/v1/trades/history?account=[WALLET_ADDRESS]&builder_code=[BUILDER_CODE]` * Builder Code Specifications: `https://api.pacifica.fi/api/v1/builder/overview?account=[WALLET_ADDRESS]` * Builder Trade History: `https://api.pacifica.fi/api/v1/builder/trades?builder_code=[BUILDER_CODE]` * Builder Code User Leaderboard: `https://api.pacifica.fi/api/v1/leaderboard/builder_code?builder_code=[BUILDER_CODE]` ### [hashtag](https://pacifica.gitbook.io/docs/programs/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) ### [hashtag](https://pacifica.gitbook.io/docs/programs/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 [ops@pacifica.fienvelope](mailto:undefined) , open a support ticket on our [Discordarrow-up-right](http://discord.gg/pacifica) or text @PacificaTGPortalBot on telegram. [PreviousMarket Maker Programchevron-left](https://pacifica.gitbook.io/docs/programs/market-maker-program) [NextVIP Programchevron-right](https://pacifica.gitbook.io/docs/programs/vip-program) Last updated 2 days ago * [Step 1: Request User Authorization](https://pacifica.gitbook.io/docs/programs/builder-program#step-1-request-user-authorization) * [Step 2: Include Builder Code in Order Creation Requests](https://pacifica.gitbook.io/docs/programs/builder-program#step-2-include-builder-code-in-order-creation-requests) * [Implementation Notes](https://pacifica.gitbook.io/docs/programs/builder-program#implementation-notes) * [Update Builder Code Fee Rate](https://pacifica.gitbook.io/docs/programs/builder-program#update-builder-code-fee-rate) * [Referral Code Claim](https://pacifica.gitbook.io/docs/programs/builder-program#referral-code-claim) * [Useful Endpoints](https://pacifica.gitbook.io/docs/programs/builder-program#useful-endpoints) * [Error Handling](https://pacifica.gitbook.io/docs/programs/builder-program#error-handling) * [Full Details and Onboarding](https://pacifica.gitbook.io/docs/programs/builder-program#full-details-and-onboarding) Copy { "account": "6ETn....", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA", "timestamp": 1748970123456, "expiry_window": 5000, "builder_code": "YOUR_CODE", "max_fee_rate": "0.001" } Copy [\ {\ "builder_code": "YOUR_CODE",\ "description": "Test Builder Integration",\ "max_fee_rate": "0.001",\ "updated_at": 1748970123456\ }\ ] Copy { "timestamp": 1748970123456, "expiry_window": 5000, "type": "revoke_builder_code", "data": { "builder_code": "YOUR_CODE" } } Copy { "account": "6ETnufiec2CxVWTS4u5Wiq33Zh5Y3Qm6Pkdpi375fuxP", "agent_wallet": null, "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GqbPkGEQKpW3UZmKXr4UWrHMJ5xHQFMJkZWE8J5VyA", "timestamp": 1748970123456, "expiry_window": 5000, "builder_code": "YOUR_CODE" } 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" } } 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" } 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" } } 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" } } 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" } Copy { "timestamp": , "expiry_window": 5000, "type": "update_builder_code_fee_rate", "data": { "builder_code": "YOUR_CODE", "fee_rate": "0.05" } } Copy { "account": "6ETn....", "agent_wallet": null, "signature": "5j1V.....", "timestamp": 1748970123456, "expiry_window": 5000, "builder_code": "YOUR_CODE", "fee_rate": "0.05" } Copy { "timestamp": , "expiry_window": 5000, "type": "claim_referral_code", "data": { "code": "YOUR_CODE" } } Copy { "account": "6ETn....", "agent_wallet": null, "signature": "5jHM.....", "timestamp": 1748970123456, "expiry_window": 5000, "code": "YOUR_CODE" } --- # Markets | Pacifica [Get market infochevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-market-info) [Get priceschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-prices) [Get candle datachevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-candle-data) [Get mark price candle datachevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-mark-price-candle-data) [Get orderbookchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-orderbook) [Get recent tradeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-recent-trades) [Get historical fundingchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-historical-funding) [PreviousREST APIchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api) [NextGet market infochevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-market-info) Last updated 10 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/v1arrow-up-right](https://api.pacifica.fi/api/v1) Testnet REST endpoint URL: [https://test-api.pacifica.fi/api/v1arrow-up-right](https://test-api.pacifica.fi/api/v1) Requests and responses use JSON. [PreviousAPIchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api) [NextMarketschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets) Last updated 10 months ago --- # 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-sdkarrow-up-right](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 channelarrow-up-right](https://discord.com/channels/1325864651816435822/1378723526957334548) ! [PreviousBug Bounty Programchevron-left](https://pacifica.gitbook.io/docs/programs/bug-bounty-program) [NextREST APIchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api) Last updated 4 months ago --- # Account | Pacifica [Get account infochevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-info) [Get account settingschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-settings) [Update leveragechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-leverage) [Update margin modechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-margin-mode) [Get positionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-positions) [Get trade historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-trade-history) [Get funding historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-funding-history) [Get account equity historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-equity-history) [Get account balance historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-balance-history) [Request withdrawalchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/request-withdrawal) [PreviousGet historical fundingchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-historical-funding) [NextGet account infochevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-info) Last updated 10 months ago --- # Audits | Pacifica file-pdf 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 downloadDownload[arrow-up-right-from-squareOpen](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) [PreviousChangelogchevron-left](https://pacifica.gitbook.io/docs/api-documentation/changelog) [NextBrand Assetschevron-right](https://pacifica.gitbook.io/docs/other/brand-assets) Last updated 10 months ago --- # Get account settings | Pacifica Copy GET /api/v1/account/settings #### [hashtag](https://pacifica.gitbook.io/docs/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... #### [hashtag](https://pacifica.gitbook.io/docs/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": { "auto_lend_disabled": null, "margin_settings": [\ {\ "symbol": "WLFI",\ "isolated": false,\ "leverage": 5,\ "created_at": 1758085929703,\ "updated_at": 1758086074002\ }\ ], "spot_settings": [], "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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-settings#code-example-python) Code Example (Python) [PreviousGet account infochevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-info) [NextUpdate leveragechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-leverage) Last updated 28 days ago Copy import requests response = requests.get( "/api/v1/account/settings?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() --- # 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. #### [hashtag](https://pacifica.gitbook.io/docs/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. * [Discordarrow-up-right](https://discord.gg/dxddmceu4C) #### [hashtag](https://pacifica.gitbook.io/docs/other/contact-us#socials) Socials Follow us for the latest updates, announcements, and market insights. * [X arrow-up-right](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 Assetschevron-left](https://pacifica.gitbook.io/docs/other/brand-assets) [NextGlossary of Termschevron-right](https://pacifica.gitbook.io/docs/other/glossary-of-terms) Last updated 1 year ago --- # Update leverage | Pacifica Copy POST /api/v1/account/leverage #### [hashtag](https://pacifica.gitbook.io/docs/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..." } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-leverage#response) Response * Status 200: Leverage updated successfully * Status 400: Invalid request parameters * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-leverage#code-example-python) Code Example (Python) [PreviousGet account settingschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-settings) [NextUpdate margin modechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-margin-mode) Last updated 10 months ago Copy { "success": true } Copy { "error": "Invalid leverage", "code": 400 } 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() --- # Subaccounts | Pacifica [Create subaccountchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/create-subaccount) [List subaccountschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/list-subaccounts) [Subaccount fund transferchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer) [PreviousRequest withdrawalchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/request-withdrawal) [NextCreate subaccountchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/create-subaccount) --- # Update margin mode | Pacifica Copy POST /api/v1/account/margin #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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..." } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-margin-mode#response) Response * Status 200: Margin mode updated successfully * Status 400: Invalid request parameters * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-margin-mode#code-example-python) Code Example (Python) [PreviousUpdate leveragechevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-leverage) [NextGet positionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-positions) Last updated 10 months ago Copy { "success": true } Copy { "error": "Invalid margin mode", "code": 400 } 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() --- # 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._arrow-up-right](https://drive.google.com/drive/folders/1cpktvx3Ir4OZVjEiyqY3VcY3Y87_PTnb?usp=sharing) [PreviousAuditschevron-left](https://pacifica.gitbook.io/docs/other/audits) [NextContact Uschevron-right](https://pacifica.gitbook.io/docs/other/contact-us) Last updated 1 year ago --- # Get account info | Pacifica Copy GET /api/v1/account #### [hashtag](https://pacifica.gitbook.io/docs/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... #### [hashtag](https://pacifica.gitbook.io/docs/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, "maker_fee": "0.00015", "taker_fee": "0.0004", "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 `'maker_fee'` decimal string Current maker fee rate of account, determined by trading volume `'taker_fee'` decimal string Current taker fee rate 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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-info#code-example-python) Code Example (Python) [PreviousAccountchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account) [NextGet account settingschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-settings) Last updated 2 months ago Copy import requests response = requests.get( "/api/v1/account?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() --- # 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. **Candle:** A visual summary of the stock's price action within a period of time, displaying the opening, closing, high, and low prices. Pacifica's candlestick charts are powered by [TradingViewarrow-up-right](https://www.tradingview.com/symbols/BTCUSD/) . **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 Uschevron-left](https://pacifica.gitbook.io/docs/other/contact-us) Last updated 1 month ago --- # Orders | Pacifica [Create market orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-market-order) [Create limit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order) [Create stop orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-stop-order) [Create position TP/SLchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-position-tp-sl) [Cancel orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order) [Cancel all orderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-all-orders) [Cancel stop orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-stop-order) [Edit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/edit-order) [Batch orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/batch-order) [Get open orderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-open-orders) [Get order historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history) [Get order history by IDchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history-by-id) [PreviousSubaccount fund transferchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer) [NextCreate market orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-market-order) --- # Websocket | Pacifica Mainnet websocket URL: [wss://ws.pacifica.fi/wsarrow-up-right](wss://ws.pacifica.fi/ws) Testnet websocket URL: [wss://test-ws.pacifica.fi/wsarrow-up-right](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. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket#subscription-message) Subscription Message Copy { "method": "subscribe", "params": { ... } } ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket#unsubscription-message) Unsubscription Message Copy { "method": "unsubscribe", "params": { ... } } ### [hashtag](https://pacifica.gitbook.io/docs/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 [PreviousGet order history by IDchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history-by-id) [NextSubscriptionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions) Last updated 3 months ago * [Subscription Message](https://pacifica.gitbook.io/docs/api-documentation/api/websocket#subscription-message) * [Unsubscription Message](https://pacifica.gitbook.io/docs/api-documentation/api/websocket#unsubscription-message) * [Heartbeat and Timeout](https://pacifica.gitbook.io/docs/api-documentation/api/websocket#heartbeat-and-timeout) Copy { "channel": "pong" } --- # Get market info | Pacifica Copy GET /api/v1/info #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-market-info#code-example-python) Code Example (Python) [PreviousMarketschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets) [NextGet priceschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-prices) Last updated 4 months ago Copy import requests response = requests.get( "/api/v1/info", headers={"Accept": "*/*"}, ) data = response.json() --- # Signing | Pacifica All POST requests require signing, whereas GET and websocket subscriptions do not. We _strongly_ recommend following the [Pacifica Python SDKarrow-up-right](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 orderschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-all-orders) [NextImplementationchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation) Last updated 10 months ago --- # Get positions | Pacifica Copy GET /api/v1/positions #### [hashtag](https://pacifica.gitbook.io/docs/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... #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-positions#code-example-python) Code Example (Python) [PreviousUpdate margin modechevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/update-margin-mode) [NextGet trade historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-trade-history) Last updated 4 months ago Copy import requests response = requests.get( "/api/v1/positions?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() --- # Changelog | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-03-11) 2026-03-11 * [Account settings](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-settings) REST API to include `margin_settings`, `spot_settings` and `auto_lend_disabled`, in order to support spot assets and unified margin \[UPDATE\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-02-19) 2026-02-19 * VIP Tier rate-limits increased \[UPDATE\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-02-05) 2026-02-05 * Remove `account_orders` websocket endpoint. Note that open orders snapshot can be obtained from REST API `/api/v1/orders` and real time order updates can be obtained from websocket `account_order_updates` \[UPDATE\] * Enforce main+subaccount rate limit [based on fee tier](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits#credit-quotas) for requests with API Config Keys \[NEW\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-24) 2026-01-24 * Update `agg_level` to `1, 10, 100, 1000, 10000` for `api/v1/book` and websocket `book` \[UPDATE\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-20) 2026-01-20 * Add `maker_fee` and `taker_fee` to /api/v1/account endpoint \[UPDATE\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-12) 2026-01-12 * Add `li` (last order id) to `bbo` websocket stream \[UPDATE\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-01) 2026-01-01 * Add `li` (last order id) to `orderbook` websocket stream \[UPDATE\] ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-12-16) 2025-12-16 **WebSocket** * Initialization added to `account_orders` endpoint \[UPDATE\] * `account_orders` endpoint now sends snapshot of account's open orders upon subscription. ### [hashtag](https://pacifica.gitbook.io/docs/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 ### [hashtag](https://pacifica.gitbook.io/docs/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 ### [hashtag](https://pacifica.gitbook.io/docs/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 ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-11-10) 2025-11-10 **REST API & WS** * [Top-of-Book (TOB)](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order) endpoint * [Batch order REST API](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/batch-order) endpoint * [Create limit order websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order) endpoint ### [hashtag](https://pacifica.gitbook.io/docs/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 ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-10-30) 2025-10-30 **REST API** * Cursor based pagination added for all history endpoints \[UPDATE\] * Offset pagination deprecated ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-10-25) 2025-10-25 **REST API** * [List subaccounts](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/list-subaccounts) \[NEW\] * Added a new endpoint to retrieve subaccount information **WEBSOCKET** * [Orderbook websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/orderbook) \[UPDATE\] * 'book' websocket update interval improved from 500ms to 100ms [PreviousDelayed account\_positionschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq/delayed-account_positions) [NextAuditschevron-right](https://pacifica.gitbook.io/docs/other/audits) Last updated 25 days ago * [2026-03-11](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-03-11) * [2026-02-19](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-02-19) * [2026-02-05](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-02-05) * [2026-01-24](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-24) * [2026-01-20](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-20) * [2026-01-12](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-12) * [2026-01-01](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2026-01-01) * [2025-12-16](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-12-16) * [2025-12-06](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-12-06) * [2025-11-19](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-11-19) * [2025-11-12](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-11-12) * [2025-11-10](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-11-10) * [2025-11-09](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-11-09) * [2025-10-30](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-10-30) * [2025-10-25](https://pacifica.gitbook.io/docs/api-documentation/changelog#id-2025-10-25) --- # Get trade history | Pacifica Copy GET /api/v1/trades/history #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-trade-history#code-example-python) Code Example (Python) [PreviousGet positionschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-positions) [NextGet funding historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-funding-history) Last updated 4 months ago Copy import requests response = requests.get( "/api/v1/trades/history?account=42trU9A5...&symbol=BTC&limit=20&cursor=11115hVka", headers={"Accept": "*/*"}, ) data = response.json() --- # Get prices | Pacifica Copy GET /api/v1/info/prices #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-prices#code-example-python) Code Example (Python) [PreviousGet market infochevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-market-info) [NextGet candle datachevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-candle-data) Last updated 6 months ago Copy import requests response = requests.get( "/api/v1/info/prices", headers={"Accept": "*/*"}, ) data = response.json() --- # Get account equity history | Pacifica Copy GET /api/v1/portfolio #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-equity-history#code-example-python) Code Example (Python) [PreviousGet funding historychevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-funding-history) [NextGet account balance historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-balance-history) Last updated 5 months ago Copy import requests response = requests.get( "/api/v1/portfolio?account=42trU9A5...&time_range=7d", headers={"Accept": "*/*"}, ) data = response.json() --- # Get recent trades | Pacifica Copy GET /api/v1/trades #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-recent-trades#code-example-python) Code Example (Python) [PreviousGet orderbookchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-orderbook) [NextGet historical fundingchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-historical-funding) Last updated 4 months ago Copy import requests response = requests.get( "/api/v1/trades?symbol=BTC", headers={"Accept": "*/*"}, ) data = response.json() --- # Orderbook | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/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, 10, 100, 1000, 10000`. ### [hashtag](https://pacifica.gitbook.io/docs/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, "li": 1559885104 } } The `book` websocket stream updates once every 250ms 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 `'li'` number Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift. [PreviousPriceschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/prices) [NextBest bid offer (BBO)chevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) Last updated 20 days ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/orderbook#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/orderbook#stream) --- # 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://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-market-info) endpoint to verify. [hashtag](https://pacifica.gitbook.io/docs/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 symbolschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/market-symbols) [NextLast order IDchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id) Last updated 4 months ago --- # API FAQ | Pacifica [403 CloudFrontchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq/403-cloudfront) [Delayed account\_positionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq/delayed-account_positions) [PreviousError codeschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/error-codes) [Next403 CloudFrontchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq/403-cloudfront) --- # 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 Keyschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits/api-config-keys) [NextTick and lot sizechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/tick-and-lot-size) Last updated 4 months ago --- # List subaccounts | Pacifica Copy POST /api/v1/account/subaccount/list #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/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 * Status 401: Unauthorized [PreviousCreate subaccountchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/create-subaccount) [NextSubaccount fund transferchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer) Last updated 2 days ago Copy { "success": false, "data": null, "error": "Invalid signature format", "code": null } Copy { "success": false, "data": null, "error": "Signature verification failed", "code": null } --- # Get funding history | Pacifica Copy GET /api/v1/funding/history #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-funding-history#code-example-python) Code Example (Python) [PreviousGet trade historychevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-trade-history) [NextGet account equity historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-equity-history) Last updated 5 months ago Copy import requests response = requests.get( "/api/v1/funding/history?account=42trU9A5...&limit=20&cursor=11115hVka", headers={"Accept": "*/*"}, ) data = response.json() --- # Get account balance history | Pacifica Copy GET /api/v1/account/balance/history #### [hashtag](https://pacifica.gitbook.io/docs/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... #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-balance-history#code-example-python) Code Example (Python) [PreviousGet account equity historychevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-equity-history) [NextRequest withdrawalchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/request-withdrawal) Last updated 5 months ago Copy import requests response = requests.get( "/api/v1/portfolio?account/balance/history?account=42trU9A5..." headers={"Accept": "*/*"}, ) data = response.json() --- # Request withdrawal | Pacifica Copy POST /api/v1/account/withdraw #### [hashtag](https://pacifica.gitbook.io/docs/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, } #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/request-withdrawal#code-example-python) Code Example (Python) [PreviousGet account balance historychevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-balance-history) [NextSubaccountschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts) Last updated 10 months ago 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() --- # Last order ID | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#affected-endpoints) Affected Endpoints #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#rest-api) REST API * [/api/v1/positionsarrow-up-right](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions) * [/api/v1/tradesarrow-up-right](https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades) * [/api/v1/ordersarrow-up-right](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders) #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#websocket) WebSocket * [bboarrow-up-right](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) * [tradesarrow-up-right](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades) * [account\_positionsarrow-up-right](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-positions) * [account\_ordersarrow-up-right](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-orders) * [account\_order\_updatesarrow-up-right](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates) * [account\_tradesarrow-up-right](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades) ### [hashtag](https://pacifica.gitbook.io/docs/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. [PreviousTick and lot sizechevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/tick-and-lot-size) [NextError codeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/error-codes) Last updated 2 months ago * [Overview](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#overview) * [Why Use It](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#why-use-it) * [Affected Endpoints](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#affected-endpoints) * [Notes](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id#notes) --- # 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. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/signing/api-agent-keys#generate-api-agent-keys) Generate API Agent Keys Agent wallets can be generated on the [frontendarrow-up-right](https://app.pacifica.fi/apikey) , or using this [Python SDK examplearrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/main/rest/api_agent_keys.py#L31-L79) . ### [hashtag](https://pacifica.gitbook.io/docs/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 programarrow-up-right](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 Walletchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/signing/hardware-wallet) [NextRate limitschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits) Last updated 6 months ago * [Generate API Agent Keys](https://pacifica.gitbook.io/docs/api-documentation/api/signing/api-agent-keys#generate-api-agent-keys) * [Use API Agent Keys](https://pacifica.gitbook.io/docs/api-documentation/api/signing/api-agent-keys#use-api-agent-keys) --- # 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 channelarrow-up-right](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.pyarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/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` #### [hashtag](https://pacifica.gitbook.io/docs/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}"` ### [hashtag](https://pacifica.gitbook.io/docs/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 limitschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits) [NextMarket symbolschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/market-symbols) Last updated 4 months ago --- # Error codes | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/error-codes#pacifica-api-response-codes-rest-api) Pacifica API Response Codes (REST API) 400 Bad Request 403 Forbidden: 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 ### [hashtag](https://pacifica.gitbook.io/docs/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 ### [hashtag](https://pacifica.gitbook.io/docs/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 [PreviousLast order IDchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/last-order-id) [NextAPI FAQchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq) Last updated 2 days ago * [Pacifica API Response Codes (REST API)](https://pacifica.gitbook.io/docs/api-documentation/api/error-codes#pacifica-api-response-codes-rest-api) * [Business Logic Errors (Code 422)](https://pacifica.gitbook.io/docs/api-documentation/api/error-codes#business-logic-errors-code-422) * [WebSocket Error Codes](https://pacifica.gitbook.io/docs/api-documentation/api/error-codes#websocket-error-codes) --- # Delayed account_positions | Pacifica **Question:** My `account_positions`/`account_orders` updates are sometimes delayed. What should I do to reliably construct a local state based on Pacifica's WS feeds? **Answer:** `account_positions` and `account_orders` are snapshot-driven channels. They show your current state but can be delayed under high load. For real-time updates with no delay, use our event-driven channels: * `account_trades` - update on every fill as it happens * `account_order_updates` - update on every order state change We recommend using our snapshot-driven channels for initialization/checks, and our events-driven channels to construct a real-time local state. [Previous403 CloudFrontchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq/403-cloudfront) [NextChangelogchevron-right](https://pacifica.gitbook.io/docs/api-documentation/changelog) Last updated 3 months ago --- # Rate limits | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/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. The credit is shared across a main account and all its subaccounts. Naturally, higher [fee tier](https://pacifica.gitbook.io/docs/trading-on-pacifica/trading-fees) grants an account higher rate limits. Tier Credits/60s 1 300 2 600 3 1200 4 2400 5 6000 VIP1 20000 VIP2 30000 VIP3 40000 ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits#websocket-limits) WebSocket Limits * Max 300 concurrent connections per IP * Max 20 subscriptions per channel per connection ### [hashtag](https://pacifica.gitbook.io/docs/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: **WebSocket** — `rl` field in action responses: Field Description `r` Remaining credits `t` Seconds until refresh `q` Total quota per window `w` Window size in seconds [PreviousAPI Agent Keyschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/signing/api-agent-keys) [NextAPI Config Keyschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits/api-config-keys) Last updated 1 month ago * [Credit Quotas](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits#credit-quotas) * [Credit Costs](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits#credit-costs) * [WebSocket Limits](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits#websocket-limits) * [Checking Your Quota](https://pacifica.gitbook.io/docs/api-documentation/api/rate-limits#checking-your-quota) Copy ratelimit: "credits";r=1200;t=32 ratelimit-policy: "credits";q=1250;w=60 Copy {"rl": {"r": 1200, "q": 1250, "t": 32}} --- # Batch order | Pacifica The [Pacifica Python SDKarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/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. #### [hashtag](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order) and [cancel](https://pacifica.gitbook.io/docs/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\ }\ }\ ] } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/batch-order#response) Response * Status 200: Batch operations processed successfully * Status 400: Bad request * Status 500: Internal server error ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/batch-order#notes-on-batch-ordering) Notes on Batch Ordering: #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/edit-order) [NextGet open orderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-open-orders) Last updated 4 months ago Copy { "success": true, "data": { "results": [\ {\ "success": true,\ "order_id": 470506,\ "error": null\ },\ {\ "success": true,\ }\ ] }, "error": null, "code": null } Copy { "error": "Invalid batch operation parameters", "code": 400 } --- # Get candle data | Pacifica Copy /api/v1/kline #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-candle-data#code-example-python) Code Example (Python) [PreviousGet priceschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-prices) [NextGet mark price candle datachevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-mark-price-candle-data) Last updated 4 months ago Copy import requests response = requests.get( "/api/v1/kline?symbol=BTC&interval=1m&start_time=1742243160000&end_time=1742243220000", headers={"Accept": "*/*"}, ) data = response.json() --- # Get mark price candle data | Pacifica Copy /api/v1/kline/mark #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-mark-price-candle-data#code-example-python) Code Example (Python) [PreviousGet candle datachevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-candle-data) [NextGet orderbookchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-orderbook) Last updated 4 months ago 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() --- # Trades | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades#params) Params Copy { "method": "subscribe", "params": { "source": "trades", "symbol": "SOL" } } ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades#stream) Stream Copy { "channel": "trades", "data": [\ {\ "h": 80062522,\ "s": "BTC",\ "a": "0.00001",\ "p": "89471",\ "d": "close_short",\ "tc": "normal",\ "t": 1765018379085,\ "li": 1559885104\ }\ ] } Field Type Description `'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)chevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) [NextCandlechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/candle) Last updated 3 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades#stream) --- # Get orderbook | Pacifica Copy /api/v1/book #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-orderbook#code-example-python) Code Example (Python) [PreviousGet mark price candle datachevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-mark-price-candle-data) [NextGet recent tradeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-recent-trades) Last updated 9 months ago Copy import requests response = requests.get( "api.pacifica.fi/api/v1/book?symbol=BTC", headers={"Accept": "*/*"}, ) data = response.json() --- # Subscriptions | Pacifica [Priceschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/prices) [Orderbookchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/orderbook) [Best bid offer (BBO)chevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo) [Tradeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades) [Candlechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/candle) [Mark price candlechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/mark-price-candle) [Account marginchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin) [Account leveragechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage) [Account infochevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info) [Account positionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions) [Account order updateschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-order-updates) [Account tradeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-trades) [PreviousWebsocketchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) [NextPriceschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/prices) --- # Cancel order | Pacifica The [Pacifica Python SDKarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"cancel_order"` #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order#response) Response * Status 200: Order cancelled successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order#code-example-python) Code Example (Python) Cancel requests are not affected by any speedbumps. [PreviousCreate position TP/SLchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-position-tp-sl) [NextCancel all orderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-all-orders) Last updated 4 months ago Copy { "success": true } Copy { "error": "Order not found", "code": 400 } 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() --- # Create limit order | Pacifica The [Pacifica Python SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint. ### [hashtag](https://pacifica.gitbook.io/docs/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` ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order#response) Response 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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-market-order) [NextEdit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/edit-order) Last updated 4 months ago * [Request](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order#request) * [Response](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order#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" } --- # 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 cannot have any deposit/trade history Please refer to the [Python SDKarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/create-subaccount#response) Response * Status 200: Subaccount created successfully * Status 400: Bad request * Status 500: Internal server error [PreviousSubaccountschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts) [NextList subaccountschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/list-subaccounts) Last updated 2 days ago Copy { "success": true, "data": null, "error": null, "code": null, } Copy { "success": false, "data": null, "error": "Account already exists: CRTxBM...", "code": 2 } --- # Account margin | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin#margin) Margin --------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin#params) Params Copy { "method": "subscribe", "params": { "source": "account_margin", "account": "42trU9A5..." } } ### [hashtag](https://pacifica.gitbook.io/docs/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 candlechevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/mark-price-candle) [NextAccount leveragechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage) Last updated 10 months ago * [Margin](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin#margin) * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin#stream) --- # Create market order | Pacifica Copy POST /api/v1/orders/create_market #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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` #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-market-order#response) Response * Status 200: Order created successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-market-order#code-example-python) Code Example (Python) Note: In order to protect liquidity providers from adverse selection, all market orders are subject to a ~200ms delay. [PreviousOrderschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders) [NextCreate limit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order) Last updated 4 months ago 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 } Copy { "order_id": 12345 } Copy { "error": "Invalid order parameters", "code": 400 } 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() --- # Get historical funding | Pacifica Copy GET /api/v1/funding_rate/history #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 calculationarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-historical-funding#code-example-python) Code Example (Python) [PreviousGet recent tradeschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/markets/get-recent-trades) [NextAccountchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account) Last updated 5 months ago Copy import requests response = requests.get( "/api/v1/funding_rate/history?symbol=BTC", headers={"Accept": "*/*"}, ) data = response.json() --- # Prices | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/prices#params) Params Copy { "method": "subscribe", "params": { "source": "prices" } } ### [hashtag](https://pacifica.gitbook.io/docs/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 [PreviousSubscriptionschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions) [NextOrderbookchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/orderbook) Last updated 10 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/prices#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/prices#stream) --- # Trading operations | Pacifica [Create market orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-market-order) [Create limit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order) [Edit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/edit-order) [Batch orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order) [Cancel orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-order) [Cancel all orderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-all-orders) [PreviousAccount tradeschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-trades) [NextCreate market orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-market-order) --- # Create stop order | Pacifica Copy POST /api/v1/orders/stop/create #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-stop-order#response) Response * Status 200: Stop order created successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-stop-order#code-example-python) Code Example (Python) [PreviousCreate limit orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order) [NextCreate position TP/SLchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-position-tp-sl) Last updated 4 months ago Copy { "order_id": 12345 } Copy { "error": "Invalid stop order parameters", "code": 400 } 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() --- # 403 CloudFront | Pacifica **Question:** Why am I getting a 403 "The request could not be satisfied" error from CloudFront? **Answer:** After our migration to CloudFront, GET requests with an empty request body will be rejected with a 403 error (while previously accepted). Using `curl` as an example, remove the `-d '{}'` or any empty payload from your GET requests. GET requests should not include a request body. **Example:** This **will not** work: Copy curl -X GET -H "PF-API-KEY: your-api-key" -H "Content-Type: application/json" -d '{}' "https://api.pacifica.fi/api/v1/positions?account=..." This **will** work: Copy curl -X GET -H "PF-API-KEY: your-api-key" "https://api.pacifica.fi/api/v1/positions?account=..." [PreviousAPI FAQchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq) [NextDelayed account\_positionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/api-faq/delayed-account_positions) Last updated 4 months ago --- # Account info | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info#leverage) Leverage ----------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info#params) Params Copy { "method": "subscribe", "params": { "source": "account_info", "account": "42trU9A5..." } } ### [hashtag](https://pacifica.gitbook.io/docs/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 leveragechevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage) [NextAccount positionschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions) Last updated 5 months ago * [Leverage](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info#leverage) * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info#stream) --- # Create limit order | Pacifica The [Pacifica Python SDKarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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` #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order#response) Response * Status 200: Order created successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order#code-example-python) Code Example (Python) 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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-market-order) [NextCreate stop orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-stop-order) Last updated 4 months ago 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 } Copy { "order_id": 12345 } Copy { "error": "Invalid order parameters", "code": 400 } 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() --- # Get order history by ID | Pacifica Copy GET /api/v1/orders/history_by_id #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 Execution price of the order event (e.g. order creation limit price, order matching filled price, limit price at cancellation) `"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"` string `"make"` `"stop_created"` `"twap_created"` `"fulfill_market"` `"fulfill_limit"` `"adjust"` `"stop_parent_order_filled"` `"stop_triggered"` `"stop_upgrade"` `"twap_triggered"` `"cancel"` `"force_cancel"` `"expired"` `"post_only_rejected"` `"self_trade_prevented"` `"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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history-by-id#code-example-python) Code Example (Python) [PreviousGet order historychevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history) [NextWebsocketchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) Last updated 2 months ago Copy import requests response = requests.get( "/api/v1/orders/history_by_id?order_id=13753364", headers={"Accept": "*/*"}, ) data = response.json() --- # Account trades | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-trades#params) Params Copy { "method": "subscribe", "params": { "source": "account_trades", "account": "42trU9A5..." } } ### [hashtag](https://pacifica.gitbook.io/docs/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 updateschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-order-updates) [NextTrading operationschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations) Last updated 4 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-trades#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-trades#stream) --- # Cancel stop order | Pacifica Copy POST /api/v1/orders/stop/cancel #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-stop-order#response) Response * Status 200: Stop order cancelled successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-stop-order#code-example-python) Code Example (Python) [PreviousCancel all orderschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-all-orders) [NextEdit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/edit-order) Last updated 10 months ago Copy { "success": true } Copy { "error": "Stop order not found", "code": 400 } 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() --- # Best bid offer (BBO) | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo#params) Params Copy { "method": "subscribe", "params": { "source": "bbo", "symbol": "BTC" } } ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo#stream) Stream Copy { "channel": "bbo", "data": { "s": "BTC", "i": 1234567890, "li": 1325476098, "t": 1764133203991, "b": "87185", "B": "1.234", "a": "87186", "A": "0.567" } } Field Type Description `'s'` string Symbol `'i'` integer Order id `'li'` integer Last 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) [PreviousOrderbookchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/orderbook) [NextTradeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades) Last updated 2 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/best-bid-offer-bbo#stream) --- # Edit order | Pacifica Copy POST /api/v1/orders/edit #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/edit-order#operation-type-for-signing) Operation Type (for signing) Header Field Type Content `"type"` string `"edit_order"` #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/edit-order#response) Response * Status 200: Order created successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/edit-order#code-example-python) Code Example (Python) **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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-stop-order) [NextBatch orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/batch-order) Last updated 3 months ago Copy { "order_id": 123498765 } Copy { "success": false, "error": "Order not found", "code": 400 } 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() --- # Candle | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/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` ### [hashtag](https://pacifica.gitbook.io/docs/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 [PreviousTradeschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/trades) [NextMark price candlechevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/mark-price-candle) Last updated 10 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/candle#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/candle#stream) --- # Mark price candle | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/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` ### [hashtag](https://pacifica.gitbook.io/docs/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 [PreviousCandlechevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/candle) [NextAccount marginchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin) Last updated 4 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/mark-price-candle#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/mark-price-candle#stream) --- # Get open orders | Pacifica Copy GET /api/v1/orders #### [hashtag](https://pacifica.gitbook.io/docs/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... #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-open-orders#code-example-python) Code Example (Python) [PreviousBatch orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/batch-order) [NextGet order historychevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history) Last updated 4 months ago Copy import requests response = requests.get( "/api/v1/orders?account=42trU9A5...", headers={"Accept": "*/*"}, ) data = response.json() --- # Create position TP/SL | Pacifica Copy POST /api/v1/positions/tpsl #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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` #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-position-tp-sl#response) Response * Status 200: Take profit and stop loss set successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-position-tp-sl#code-example-python) Code Example (Python) [PreviousCreate stop orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-stop-order) [NextCancel orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order) Last updated 7 months ago 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 } Copy { "success": true } Copy { "error": "Position not found", "code": 400 } 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() --- # Batch order | Pacifica The [Pacifica Python SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/batch_orders.py) provides a comprehensive example on using this endpoint ### [hashtag](https://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/create-limit-order) and [cancel](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order) requests. #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order#response) Response * Status 200: Batch operations processed successfully * Status 400: Bad request * Status 500: Internal server error ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order#notes-on-batch-ordering) Notes on Batch Ordering: #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/edit-order) [NextCancel orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-order) Last updated 4 months ago * [Request](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order#request) * [Notes on Batch Ordering:](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order#notes-on-batch-ordering) 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" } Copy { "error": "Invalid batch operation parameters", "code": 400 } --- # Account positions | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions#params) Params Copy { "method": "subscribe", "params": { "source": "account_positions", "account": "42trU9A5..." } } ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions#positions-snapshots) Positions Snapshots 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 in a best effort picture of current state. We recommend using `account_positions` for initialization, and `account_trades`, to construct up-to-date positions state. ### [hashtag](https://pacifica.gitbook.io/docs/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 infochevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info) [NextAccount order updateschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-order-updates) Last updated 3 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions#params) * [Positions Snapshots](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions#positions-snapshots) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions#stream) --- # Get order history | Pacifica Copy GET /api/v1/orders/history #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/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 #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history#code-example-python) Code Example (Python) [PreviousGet open orderschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-open-orders) [NextGet order history by IDchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/get-order-history-by-id) Last updated 5 months ago Copy import requests response = requests.get( "/api/v1/orders/history?account=42trU9A5...&limit=100", headers={"Accept": "*/*"}, ) data = response.json() --- # 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 SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk) , when followed closely, should make signing relatively straightforward to implement. [PreviousOperation Typeschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/signing/operation-types) [NextHardware Walletchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/signing/hardware-wallet) Last updated 10 months ago --- # Hardware Wallet | Pacifica Pacifica supports hardware wallet signature authentication via Ed25519 [off-chain message signingarrow-up-right](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://pacifica.gitbook.io/docs/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://pacifica.gitbook.io/docs/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 examplearrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/2b5e629eb15d86c1a229df5d1847f5000f113ec9/rest/transfer_subaccount_fund_hardware.py#L27-L47) in the Python SDK. [PreviousError Handlingchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/signing/error-handling) [NextAPI Agent Keyschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/signing/api-agent-keys) Last updated 10 months ago --- # Account leverage | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage#leverage) Leverage --------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage#params) Params Copy { "method": "subscribe", "params": { "source": "account_leverage", "account": "42trU9A5..." } } ### [hashtag](https://pacifica.gitbook.io/docs/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 marginchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-margin) [NextAccount infochevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-info) Last updated 10 months ago * [Leverage](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage#leverage) * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-leverage#stream) --- # Implementation | Pacifica ### [hashtag](https://pacifica.gitbook.io/docs/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()) ### [hashtag](https://pacifica.gitbook.io/docs/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 Typesarrow-up-right](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()), } ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-4.-combine-header-and-payload) 4\. Combine Header and Payload In the case of our example, this creates: Note that data must be in same level as other headers. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-5.-recursively-sort-json-keys) 5\. Recursively Sort JSON Keys In the case of our example, this creates: Note that the recursive sorting alphabetically sorts \*all\* levels ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-6.-create-compact-json) 6\. Create Compact JSON Compact JSON string with no whitespace and standardized seperators In the case of our example, this creates: This ensures that all logically identical messages will always produce \*identical\* signatures ### [hashtag](https://pacifica.gitbook.io/docs/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. ### [hashtag](https://pacifica.gitbook.io/docs/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!) In the case of our example, the final request looks like: [PreviousSigningchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/signing) [NextOperation Typeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/signing/operation-types) Last updated 6 months ago * [1\. Setup and Initialization:](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-1.-setup-and-initialization) * [2\. Choose Endpoint and Define Operation Type](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-2.-choose-endpoint-and-define-operation-type) * [3\. Create Signature Header](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-3.-create-signature-header) * [4\. Combine Header and Payload](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-4.-combine-header-and-payload) * [5\. Recursively Sort JSON Keys](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-5.-recursively-sort-json-keys) * [6\. Create Compact JSON](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-6.-create-compact-json) * [7\. Convert to Bytes and Generate Signature](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-7.-convert-to-bytes-and-generate-signature) * [8\. Build Final Request](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation#id-8.-build-final-request) Copy # Get current timestamp in milliseconds timestamp = int(time.time() * 1_000) signature_header = { "timestamp": timestamp, "expiry_window": 5_000, "type": "create_order", } Copy data_to_sign = { **signature_header, "data": operation_data, } 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" } } 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) 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" } Copy import json compact_json = json.dumps(sorted_message, separators=(",", ":")) 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"} 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" 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 } 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" } --- # Edit order | Pacifica The [Pacifica Python SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint. ### [hashtag](https://pacifica.gitbook.io/docs/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` ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/edit-order#response) Response 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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order) [NextBatch orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order) Last updated 4 months ago * [Request](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/edit-order#request) * [Response](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/edit-order#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" } --- # 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. [PreviousImplementationchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/signing/implementation) [NextError Handlingchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/signing/error-handling) Last updated 6 months ago --- # Cancel all orders | Pacifica The [Pacifica Python SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/cancel_all_orders.py) provides a comprehensive example on using this endpoint. ### [hashtag](https://pacifica.gitbook.io/docs/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` 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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-order) [NextSigningchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/signing) Last updated 10 months ago Copy { "code": 200, "data": { "cancelled_count": 10 }, "id": "b86b4f45-49da-4191-84e2-93e141acdeab", "t": 1749221787291, "type": "cancel_all_orders" } --- # Create market order | Pacifica The [Pacifica Python SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint. ### [hashtag](https://pacifica.gitbook.io/docs/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` ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-market-order#response) Response 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 operationschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations) [NextCreate limit orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order) Last updated 4 months ago * [Request](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-market-order#request) * [Response](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-market-order#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" } --- # Cancel all orders | Pacifica The [Pacifica Python SDKarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/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"` #### [hashtag](https://pacifica.gitbook.io/docs/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 } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-all-orders#response) Response * Status 200: All orders cancelled successfully * Status 400: Bad request * Status 500: Internal server error #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-all-orders#code-example-python) Code Example (Python) [PreviousCancel orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-order) [NextCancel stop orderchevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders/cancel-stop-order) Last updated 10 months ago Copy { "cancelled_count": 5 } Copy { "error": "Invalid parameters", "code": 400 } 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() --- # Subaccount fund transfer | Pacifica Please refer to the [Python SDKarrow-up-right](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 #### [hashtag](https://pacifica.gitbook.io/docs/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" } #### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer#response) Response * Status 200: Subaccount created successfully * Status 400: Bad request * Status 500: Internal server error [PreviousList subaccountschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/subaccounts/list-subaccounts) [NextOrderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/orders) Last updated 10 months ago Copy Status Code: 200 { "success": true, "data": { "success": true, "error": null }, "error": null, "code": null } Copy Status Code: 400 { "success": false, "data": null, "error": "Insufficient balance for AwX6321: 420.69 (account value: 336.9100000000000000000000)", "code": 5 } --- # Cancel order | Pacifica The [Pacifica Python SDKarrow-up-right](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/cancel_order.py) provides a comprehensive example on using this endpoint. ### [hashtag](https://pacifica.gitbook.io/docs/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` ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-order#response) Response 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 orderchevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/batch-order) [NextCancel all orderschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-all-orders) Last updated 4 months ago * [Request](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-order#request) * [Response](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-order#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" } --- # Account order updates | Pacifica Refer to [Websocket](https://pacifica.gitbook.io/docs/api-documentation/api/websocket) for establishing the websocket connection. ### [hashtag](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-order-updates#params) Params Copy { "method": "subscribe", "params": { "source": "account_order_updates", "account": "42trU9A5..." } } ### [hashtag](https://pacifica.gitbook.io/docs/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 positionschevron-left](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-positions) [NextAccount tradeschevron-right](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-trades) Last updated 4 months ago * [Params](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-order-updates#params) * [Stream](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/subscriptions/account-order-updates#stream) ---