Orders
Poloniex futures v1/v2 API will be officially offline on November 30, 2024. You can access the V3 API to provide you with a better trading experience.
Place an Order
You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.
Please note that the system will hold the fees from the orders entered in the orderbook in advance. Read Get Fills to learn more.
Do NOT include extra spaces in JSON strings.
Place Order Limit:
The maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.
HTTP Request
POST https://futures-api.poloniex.com/api/v1/orders
API Permission
This endpoint requires the Trade permission
REQUEST RATE LIMIT
This API is restricted for each account, the request rate limit is 30 times/3s.
Parameters
Param | type | Description |
---|---|---|
clientOid | String | Unique order id created by users to identify their orders, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |
side | String | buy or sell |
symbol | String | a valid contract code. e.g. BTCUSDTPERP |
type | String | [optional] Either limit or market |
String | Deprecated,Leverage of the order | |
remark | String | [optional] remark for the order, length cannot exceed 100 utf8 characters |
stop | String | [optional] Either down or up. Requires stopPrice and stopPriceType to be defined |
stopPriceType | String | [optional] Either TP, IP or MP, Need to be defined if stop is specified. |
stopPrice | String | [optional] Need to be defined if stop is specified. |
reduceOnly | boolean | [optional] A mark to reduce the position size only. Set to false by default. |
closeOrder | boolean | [optional] A mark to close the position. Set to false by default. |
forceHold | boolean | [optional] A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. |
See Advanced Description for more details.
LIMIT ORDER PARAMETERS
Param | type | Description |
---|---|---|
price | String | Limit price |
size | Integer | Order size. Must be a positive number |
quantity | String | [optional] Order quantity. Must be a positive number. Only takes effect when size is empty |
timeInForce | String | [optional] GTC, IOC(default is GTC), read Time In Force |
postOnly | boolean | [optional] Post only flag, invalid when timeInForce is IOC. When postOnly chose, not allowed choose hidden or iceberg. |
boolean | Deprecated,[optional] Orders not displaying in order book. When hidden chose, not allowed choose postOnly. | |
boolean | Deprecated,[optional] Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. | |
Integer | Deprecated,[optional] The maximum visible size of an iceberg order |
MARKET ORDER PARAMETERS
Param | type | Description |
---|---|---|
size | Integer | [optional] amount of contract to buy or sell |
quantity | String | [optional] Order quantity. Must be a positive number. Only takes effect when size is empty |
Example:
Request:
{
"clientOid": "5c52e11203aa677f33e493fb",
"reduceOnly": false,
"closeOrder": false,
"forceHold": false,
"hidden": false,
"iceberg": false,
"leverage": 20,
"postOnly": false,
"price": 8000,
"remark": "remark",
"side": "buy",
"size": 20,
"stop": "",
"stopPrice": 0,
"stopPriceType": "",
"symbol": "BTCUSDTPERP",
"timeInForce": "",
"type": "limit",
"visibleSize": 0
}
Response:
{
"code": "200000",
"data": {
"orderId": "5bd6e9286d99522a52e458de"
}
}
Advanced Description
SYMBOL
The symbol must match a contract symbol, e.g. BTCUSDTPERP
CLIENT ORDER ID
Generated by yourself, the optional clientOid field must be a unique id (e.g UUID). Only numbers, characters, underline(_) and separator(-) are allowed. The value will be returned in the order detail. You can use this field to identify your orders via the public feed. The client_oid is different from the server-assigned order id. Please do not send a repeated client_oid. The length of the client_oid cannot exceed 40 characters. You should record the server-assigned order_id as it will be used for future queries of your order status.
TYPE
The order type you specify may decide whether other optional parameters are required, as well as how your order will be executed by the matching engine. If order type is not specified, the order will be a limit order by default.
Price and size are required to be specified for a limit order. The order will be filled at the price specified or better, depending on the market condition. If a limit order cannot be filled immediately, it will be outstanding in the open order book until matched by another order, or canceled by the user.
A market order differs from a limit order in that the execution price is not guaranteed. Market order, however, provides a way to buy or sell a specific size of contract without having to specify the price. Market orders will be executed immediately, and no orders will enter the open order book afterwards. Market orders are always considered takers and incur taker fees.
LEVERAGE
The “leverage” parameter is used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.
STOP ORDERS
A stop order is an order to buy or sell at the market or pre-specified limit price once the contact has traded at or through a pre-specified stopPrice. There are two types of stop orders, down and up.
Stop Order Types
- down: Triggers when the price reaches or goes below the stopPrice.
- up: Triggers when the price reaches or goes above the stopPrice.
- stopPriceType: There are three types of stop prices for a contract, including: TP for trade price, MP for mark price, and IP for index price.
The last trade price is the last price at which an order was filled. This price can be found in the latest match message. The mark price and the index price can be obtained through relevant OPEN API for index services.
Note that when triggered, stop orders will be executed as either market or limit orders, depending on the pre-specified type.
When placing a stop order, the system will not pre-freeze the funds in your account. Do note that when triggered, a stop order may be canceled if the available balance is not enough.
PRICE
The price specified must be a multiple number of the contract tickSize, otherwise the system will report an error when you place the order. The tick size is the smallest price increment in which the prices are quoted. A valid price shall not be higher than the maxPrice in the contract specification. Poloniex Futures implements IEPR(Immediately Executable Price Range) rule, in which the price of a buy order cannot be higher than 1.05 * mark price, and the price of a sell order cannot be lower than 0.95 * mark price.
Price field is not required for market orders.
SIZE
The order quantity is the number of contracts, and the unit of measurement for order quantity is the minimum lot size of the contract. The order quantity cannot be less than the minimum order quantity or greater than the maximum order quantity, and must be a multiple of the lot size, otherwise a system error will occur when placing an order. The order quantity represents the size of the contract to be bought or sold. Each BTCUSDTPERP contract corresponds to 0.001BTC.
TIME IN FORCE
Time in force is a special instruction used when placing an order to indicate how long an order will remain active before it is executed or expires. There are two types, Good Till Canceled GTC and Immediate Or Cancel IOC.
- GTC Good Till Canceled: order remains open on the order book until canceled. This is the default type if the field is left empty.
- IOC Immediate Or Cancel: being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book.
Note that self trades belong to match as well.
POST ONLY
The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fees, the order will be fully rejected.
HIDDEN AND ICEBERG
The Hidden and iceberg Orders are two options in advanced settings (note: the iceberg order is a special form of the hidden order). You may select “Hidden” or “Iceberg” when placing a limit or stop limit order.
A hidden order will enter but not display on the orderbook.
Different from the hidden order, an iceberg order is divided into visible portion and invisible portion. When placing an iceberg order, you need to set the visible size. The minimum visible size is 1/20 of the order size. The minimum visible size shall be greater than the minimum order size, or an error will occur.
In a matching event, the visible portion of an iceberg order will be executed first, and another visible portion will pop up until the order is fully filled.
Note: 1)The system will charge taker fees for Hidden and iceberg Orders. 2)If both "Iceberg" and "Hidden" are selected, your order will be filled as an iceberg Order by default.
HOLDS
When placing an order, the system will freeze a certain amount of funds in your account for position margin and transaction fees based on the order price and quantity. If not, the order can only be one to reduce the position. If the total amount of these orders exceeds the position size, the system will cancel the extra no-fund-frozen orders to ensure they won’t be executed.
Actual fees are determined when the order is executed. If you cancel a partially filled or unfilled order, any remaining funds will be released from hold and become available.
Different from when an order reduces the position size, certain amount of funds need to be frozen when an order increases the position size. No funds need to be frozen when closeOrder is set to TRUE, or when reduceOnly is set to TRUE.
The execution of the order will incur transaction fees. If a partially filled or unfilled order is canceled, the system will unfreeze the remained frozen funds in your account.
CLOSE ORDER
If closeOrder is set to TRUE, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.
CLOSE ONLY
If set to TRUE, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.
FORCE HOLD
The system will force freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.
ORDER LIFECYCLE
The HTTP Request will respond when an order is either rejected (insufficient funds, invalid parameters, etc) or received (accepted by the matching engine). A success response with order id indicates that the order has been received. Orders may be execute either partially or fully. After a partial execution, the remaining size of the order will be in active state (excluding IOC orders). A completely filled order will be in done state.
Users listening to streaming market data are encouraged to use the order id and clientOid field to identify their received messages in the feed.
RESPONSE
A successful order will be assigned an order id. A successful order is defined as one that has been accepted by the matching engine.
Open orders will remain open until they are either filled or canceled.
Place Multiple Orders
HTTP Request
POST https://futures-api.poloniex.com/api/v1/batchOrders
API Permission
This endpoint requires the Trade permission