pacifica
pacifica cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
pacifica
Kind: global class
Extends: Exchange
- fetchMarkets
- fetchSwapMarkets
- fetchBalance
- fetchLeverage
- fetchAccountSettings
- fetchMarginMode
- fetchOrderBook
- fetchFundingRates
- fetchOHLCV
- fetchTrades
- fetchMyTrades
- createOrder
- createOrders
- cancelOrders
- cancelAllOrders
- cancelOrder
- editOrder
- fetchFundingRateHistory
- fetchTickers
- fetchClosedOrders
- fetchCanceledOrders
- fetchCanceledAndClosedOrders
- fetchOpenOrders
- fetchOrders
- fetchOrder
- fetchPosition
- fetchPositions
- setMarginMode
- setLeverage
- withdraw
- fetchTradingFee
- fetchOpenInterests
- fetchOpenInterest
- fetchLedger
- fetchFundingHistory
- transfer
- createSubAccount
- createOrderWs
- editOrderWs
- cancelOrdersWs
- cancelOrderWs
- cancelAllOrdersWs
- watchOrderBook
- unWatchOrderBook
- watchTicker
- watchTickers
- unWatchTickers
- watchMyTrades
- unWatchMyTrades
- watchTrades
- unWatchTrades
- watchOHLCV
- unWatchOHLCV
- watchOrders
- unWatchOrders
fetchMarkets
retrieves data on all markets for pacifica
Kind: instance method of pacifica
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.fetchMarkets (params?)fetchSwapMarkets
retrieves data on all swap markets for pacifica
Kind: instance method of pacifica
Returns: Array<object> - an array of objects representing market data
See: https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-market-info
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.fetchSwapMarkets (params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of pacifica
Returns: object - a balance structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchBalance (params?)fetchLeverage
fetch the set leverage for a market
Kind: instance method of pacifica
Returns: object - a leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchLeverage (symbol, params?)fetchAccountSettings
fetch account's market settings. Settings are cached for walletAddress. To refresh the cache, call loadAccountSettings with refresh=true
Kind: instance method of pacifica
Returns: object - Dict repacked from list by symbol key
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-settings
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchAccountSettings (params?)fetchMarginMode
fetches the margin mode of the trading pair
Kind: instance method of pacifica
Returns: object - a margin mode structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the margin mode for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchMarginMode (symbol, params?)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of pacifica
Returns: object - A dictionary of order book structures indexed by market symbols
See: https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.aggLevel | int | No | aggregation level for price grouping. Defaults to 1. Can be 1, 10, 100, 1000, 10000 |
pacifica.fetchOrderBook (symbol, limit?, params?)fetchFundingRates
retrieves data on all swap markets for pacifica
Kind: instance method of pacifica
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.fetchFundingRates (symbols?, params?)fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of pacifica
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-candle-data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents, support '1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '8h', '12h', '1d' |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest candle to fetch. 'limit' is priority |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](/docs/manual#pagination-params |
pacifica.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of pacifica
Returns: Array<Trade> - a list of trade structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-recent-trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.fetchTrades (symbol, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of pacifica
Returns: Array<Trade> - a list of trade structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-trade-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest trade |
| params.account | string | No | will default to walletAddress if not provided |
| params.cursor | string | No | pagination cursor from prev request (manual use) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
pacifica.fetchMyTrades (symbol?, since?, limit?, params?)createOrder
create a trade order
Kind: instance method of pacifica
Returns: object - an order structure
See
- https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-limit-order
- https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-market-order
- https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-stop-order
- https://docs.pacifica.fi/api-documentation/api/rest-api/orders/create-position-tp-sl
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency. Not used for set tpsl order! |
| price | float | No | the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | float | No | The price a trigger order is triggered at |
| params.stopLossPrice | float | No | the price that a stop loss order is triggered at (optional provide stopLossCloid) |
| params.takeProfitPrice | float | No | the price that a take profit order is triggered at (optional provide takeProfitCloid) |
| params.timeInForce | string | No | "GTC", "IOC", or "PO" or "ALO" or "PO_TOB" (or "TOB" - PO by top of book) |
| params.reduceOnly | boolean | No | Ensures that the executed order does not flip the opened position. |
| params.clientOrderId | string | No | client order id, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.createOrder (symbol, type, side, amount, price?, params?)createOrders
create a list of trade orders. It is supports only limit orders and have a random jitter ~100-300ms!
Kind: instance method of pacifica
Returns: object - an order structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type (optional or 'limit'), side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.createOrders (orders, params?)cancelOrders
cancel multiple orders
Kind: instance method of pacifica
Returns: object - an list of order structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids. An ids list is always required (can be empty). Both ids and clientOrderIds can be passed simultaneously. |
| symbol | string | No | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderIds | string, Array<string> | No | client order ids, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.cancelOrders (ids, symbol?, params?)cancelAllOrders
cancel all open orders in a market
Kind: instance method of pacifica
Returns: Array<object> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-all-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | (optional) unified market symbol of the market to cancel orders in. |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.excludeReduceOnly | boolean | No | whether to exclude reduce-only orders |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.cancelAllOrders (symbol, params?)cancelOrder
cancels an open order
Kind: instance method of pacifica
Returns: object - An order structure
See
- https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-stop-order#response
- https://docs.pacifica.fi/api-documentation/api/rest-api/orders/cancel-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.stop | boolean | No | necessary if this is to cancel a stop order. |
| params.clientOrderId | string | No | client order id, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.cancelOrder (id, symbol, params?)editOrder
edit a trade order
Kind: instance method of pacifica
Returns: object - an order structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | edit order id |
| symbol | string | Yes | unified symbol of the market to edit an order in |
| type | string | Yes | 'market' or 'limit' WARN is not usable! |
| side | string | Yes | 'buy' or 'sell' WARN is not usable! |
| amount | float | Yes | how much of currency you want to trade in units of base currency |
| price | float | Yes | the price at which the order is to be fulfilled, in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string | No | client order id, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.editOrder (id, symbol, type, side, amount, price, params?)fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance method of pacifica
Returns: Array<object> - a list of funding rate structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-historical-funding
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the funding rate history for |
| since | int | No | timestamp in ms of the earliest funding rate to fetch |
| limit | int | No | the maximum amount of funding rate structures to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.cursor | string | No | pagination cursor from prev request (manual use) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
pacifica.fetchFundingRateHistory (symbol, since?, limit?, params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of pacifica
Returns: object - a dictionary of ticker structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/markets/get-prices
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.fetchTickers (symbols?, params?)fetchClosedOrders
fetch all unfilled currently closed orders
Kind: instance method of pacifica
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchClosedOrders (symbol, since?, limit?, params?)fetchCanceledOrders
fetch all canceled orders
Kind: instance method of pacifica
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchCanceledOrders (symbol, since?, limit?, params?)fetchCanceledAndClosedOrders
fetch all closed and canceled orders
Kind: instance method of pacifica
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchCanceledAndClosedOrders (symbol, since?, limit?, params?)fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance method of pacifica
Returns: Array<Order> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-open-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchOpenOrders (symbol, since?, limit?, params?)fetchOrders
fetch all orders
Kind: instance method of pacifica
Returns: Array<Order> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
| params.cursor | string | No | pagination cursor from prev request (manual use) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
pacifica.fetchOrders (symbol, since?, limit?, params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of pacifica
Returns: object - An order structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history-by-id
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | (optional) unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.fetchOrder (id, symbol, params?)fetchPosition
fetch data on an open position
Kind: instance method of pacifica
Returns: object - a position structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the position is held in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchPosition (symbol, params?)fetchPositions
fetch all open positions
Kind: instance method of pacifica
Returns: Array<object> - a list of position structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchPositions (symbols?, params?)setMarginMode
set margin mode (symbol)
Kind: instance method of pacifica
Returns: object - response from the exchange
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string | Yes | margin mode must be either [isolated, cross] |
| symbol | string | Yes | unified market symbol of the market the position is held in, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.setMarginMode (marginMode, symbol, params?)setLeverage
set the level of leverage for a market
Kind: instance method of pacifica
Returns: object - response from the exchange
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | float | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.setLeverage (leverage, symbol, params?)withdraw
make a withdrawal (only support native USDC)
Kind: instance method of pacifica
Returns: object - a transaction structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/request-withdrawal
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the address to withdraw to |
| tag | string | Yes | |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.withdraw (code, amount, address, tag, params?)fetchTradingFee
fetch the trading fees for a market
Kind: instance method of pacifica
Returns: object - a fee structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-info
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
pacifica.fetchTradingFee (symbol, params?)fetchOpenInterests
Retrieves the open interest for a list of symbols
Kind: instance method of pacifica
Returns: object - an open interest structure/docs/manual#open-interest-structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | Unified CCXT market symbol |
| params | object | No | exchange specific parameters |
pacifica.fetchOpenInterests (symbols?, params?)fetchOpenInterest
retrieves the open interest of a contract trading pair
Kind: instance method of pacifica
Returns: object - an open interest structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| params | object | No | exchange specific parameters |
pacifica.fetchOpenInterest (symbol, params?)fetchLedger
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of pacifica
Returns: object - a ledger structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-account-balance-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | timestamp in ms of the earliest ledger entry |
| limit | int | No | max number of ledger entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
| params.cursor | string | No | pagination cursor from prev request (manual use) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
pacifica.fetchLedger (code?, since?, limit?, params?)fetchFundingHistory
fetch the history of funding payments paid and received on this account
Kind: instance method of pacifica
Returns: object - a funding history structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| since | int | No | the earliest time in ms to fetch funding history for |
| limit | int | No | the maximum number of funding history structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
| params.cursor | string | No | pagination cursor from prev request |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
pacifica.fetchFundingHistory (symbol?, since?, limit?, params?)transfer
transfer currency internally between wallets on the same account
Kind: instance method of pacifica
Returns: object - a transfer structure
See: https://docs.pacifica.fi/api-documentation/api/rest-api/subaccounts/subaccount-fund-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from spot, swap |
| toAccount | string | Yes | account to transfer to swap, spot or address |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiryWindow | int | No | time to live in milliseconds |
pacifica.transfer (code, amount, fromAccount, toAccount, params?)createSubAccount
creates a sub-account under the main account
Kind: instance method of pacifica
Returns: object - a response object
| Param | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | unused argument |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiryWindow | int | No | time to live in milliseconds |
| params.subAccountAddress | string | No | The public key (address) of the sub-account to use for creation |
| params.subAccountPrivateKey | string | No | The private key of the sub-account to use for creation |
pacifica.createSubAccount (name, params?)createOrderWs
create a trade order
Kind: instance method of pacifica
Returns: object - an order structure
See
- https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-market-order
- https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/create-limit-order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency |
| price | float | No | the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | float | No | The price a trigger order is triggered at |
| params.stopLossPrice | float, undefined | No | the price that a stop loss order is triggered at (optional provide stopLossCloid) |
| params.takeProfitPrice | float, undefined | No | the price that a take profit order is triggered at (optional provide takeProfitCloid) |
| params.timeInForce | string, undefined | No | "GTC", "IOC", or "PO" or "ALO" or "PO_TOB" (or "TOB" - PO by top of book) |
| params.reduceOnly | bool, undefined | No | Ensures that the executed order does not flip the opened position. |
| params.clientOrderId | string, undefined | No | client order id, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int, undefined | No | time to live in milliseconds |
| params.agentAddress | string, undefined | No | only if agent wallet in use. |
| params.originAddress | string, undefined | No | only if agent in use. Agent's owner address ( default = credentials walletAddress ) |
pacifica.createOrderWs (symbol, type, side, amount, price?, params?)editOrderWs
edit a trade order
Kind: instance method of pacifica
Returns: object - an order structure
See: https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/edit-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | edit order id |
| symbol | string | Yes | unified symbol of the market to edit an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency |
| price | float | Yes | the price at which the order is to be fulfilled, in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string | No | client order id, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int, undefined | No | time to live in milliseconds |
| params.agentAddress | string, undefined | No | only if agent wallet in use |
| params.originAddress | string, undefined | No | only if agent in use. Agent's owner address ( default = credentials walletAddress ) |
pacifica.editOrderWs (id, symbol, type, side, amount, price, params?)cancelOrdersWs
cancel multiple orders
Kind: instance method of pacifica
Returns: object - an list of order structures
See
- https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/batch-order
- https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | No | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string, Array<string> | No | client order ids, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int, undefined | No | time to live in milliseconds |
| params.agentAddress | string, undefined | No | only if agent wallet in use |
| params.originAddress | string, undefined | No | only if agent in use. Agent's owner address ( default = credentials walletAddress ) |
pacifica.cancelOrdersWs (ids, symbol?, params?)cancelOrderWs
cancels an open order
Kind: instance method of pacifica
Returns: object - An order structure
See: https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.stop | bool, undefined | No | necessary if this is to cancel a stop order. |
| params.clientOrderId | string, undefined | No | client order id, (optional uuid v4 e.g.: f47ac10b-58cc-4372-a567-0e02b2c3d479) |
| params.expiryWindow | int, undefined | No | time to live in milliseconds |
| params.agentAddress | string, undefined | No | only if agent wallet in use |
| params.originAddress | string, undefined | No | only if agent in use. Agent's owner address ( default = credentials walletAddress ) |
pacifica.cancelOrderWs (id, symbol, params?)cancelAllOrdersWs
cancel all open orders in a market
Kind: instance method of pacifica
Returns: Array<object> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/trading-operations/cancel-all-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | (optional) unified market symbol of the market to cancel orders in. |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.excludeReduceOnly | boolean, undefined | No | whether to exclude reduce-only orders |
| params.expiryWindow | int, undefined | No | time to live in milliseconds |
| params.agentAddress | string, undefined | No | only if agent wallet in use |
| params.originAddress | string, undefined | No | only if agent in use. Agent's owner address ( default = credentials walletAddress ) |
pacifica.cancelAllOrdersWs (symbol, params?)watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of pacifica
Returns: object - A dictionary of order book structures indexed by market symbols
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.aggLevel | int, undefined | No | aggregation level for price grouping. Defaults to 1. Can be 1, 10, 100, 1000, 10000 |
pacifica.watchOrderBook (symbol, limit?, params?)unWatchOrderBook
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of pacifica
Returns: object - A dictionary of order book structures indexed by market symbols
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.aggLevel | int, undefined | No | aggregation level for price grouping. Defaults to 1. Can be 1, 10, 100, 1000, 10000 |
pacifica.unWatchOrderBook (symbol, params?)watchTicker
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of pacifica
Returns: object - a ticker structure
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.watchTicker (symbol, params?)watchTickers
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of pacifica
Returns: object - a ticker structure
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.watchTickers (symbols, params?)unWatchTickers
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of pacifica
Returns: object - a ticker structure
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/prices
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.unWatchTickers (symbols, params?)watchMyTrades
watches information on multiple trades made by the user
Kind: instance method of pacifica
Returns: Array<object> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string, undefined | No | will default to options' walletAddress if not provided |
pacifica.watchMyTrades (symbol, since?, limit?, params?)unWatchMyTrades
unWatches information on multiple trades made by the user
Kind: instance method of pacifica
Returns: Array<object> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string, undefined | No | will default to options' walletAddress if not provided |
pacifica.unWatchMyTrades (symbol, params?)watchTrades
watches information on multiple trades made in a market
Kind: instance method of pacifica
Returns: Array<object> - a list of trade structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market trades were made in |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trade structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.watchTrades (symbol, since?, limit?, params?)unWatchTrades
unWatches information on multiple trades made in a market
Kind: instance method of pacifica
Returns: Array<object> - a list of trade structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market trades were made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.unWatchTrades (symbol, params?)watchOHLCV
watches historical candlestick data containing the open, high, low, close price, and the volume of a market
Kind: instance method of pacifica
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.watchOHLCV (symbol, timeframe, since?, limit?, params?)unWatchOHLCV
watches historical candlestick data containing the open, high, low, close price, and the volume of a market
Kind: instance method of pacifica
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/candle
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| params | object | No | extra parameters specific to the exchange API endpoint |
pacifica.unWatchOHLCV (symbol, timeframe, params?)watchOrders
watches information on multiple orders made by the user
Kind: instance method of pacifica
Returns: Array<object> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string, undefined | No | will default to options' walletAddress if not provided |
pacifica.watchOrders (symbol, since?, limit?, params?)unWatchOrders
unWatches information on multiple orders made by the user
Kind: instance method of pacifica
Returns: Array<object> - a list of order structures
See: https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-updates
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string, undefined | No | will default to options' walletAddress if not provided |
pacifica.unWatchOrders (symbol, params?)