Create Order
POST
https://api.sfox.com/v1/orders/:side
Create an order.
Create order requests are rate limited to 60 requests per second per account.
Path Parameters
side
required
string
Possible values: buy
(buy order), sell
(sell order)
Body Parameters
currency_pair
required
string
Pair or product to trade in the format basequote
. e.g. btcusd
, ethbtc
, ethusdc
algorithm_id
required
int
Order type / algorithm.
For more info, see Order Types & Algorithms
Default: Limit (
200
)
price
required
string
Order limit price.
Precision: 8 decimal places for crypto, 2 decimal places for fiat
NOT required for Market (
100
) ordersOrder fill price will always be better than or equal to this price. If market conditions do not allow it, the order will not execute.
quantity
required
string
Order size in base currency quantity.
NOT required for Market (
100
) ordersMinimum quantity:
Crypto Quote Pairs:
0.001
USD Quote Pairs:
price
*quantity
must be >= $5
amount
string
The amount (quote currency) to spend when buying.
Required when placing BUY orders using: Market (100
), Stop (304
) or Trailing Stop (308
) order types.
client_order_id
string
Optional field for a user-specified ID.
client_order_id
serves as an idempotency key. Orders will be rejected if the client_order_id
has been specified in a previous order placed in the last 24 hours.
time_in_force
string
Time in force (TIF) specifies how the lifetime of your order will be handled. Possible values:
GTC
: Good 'til canceled orders remain open until canceled. This is the default TIF option. (Default)IOC
: Immediate or cancel orders instantly cancel the remaining unfilled size of an order leaving it open. Smart (200
) and Limit (201
) orders only.FOK
: Fill or kill orders are either instantly filled for the full order size or instantly rejected if the entire size cannot be matched. Market (100
) and Limit (201
) orders only.GTD
: Good 'til date orders are automatically canceled at your specifiedexpires
date time.
max_slippage
number
A risk management parameter that will limit the slippage of an order in basis points (e.g. setting max_slippage
to 5
= 0.05%). Market (100
), Stop (304
), Trailing Stop (308
) only.
expires
date-time
Specify the expiration date time of your order (UNIX timestamp in ms).
Required for orders with time_in_force
= GTD
destination
string
Route the order to a specific destination.
Possible values:
ox
for the sFOX Ox order bookdarkpool
for the sFOX Dark Pool
total_time
int
The time, in seconds, that a TWAP (307
) order will stay active from the time the TWAP order is placed.
interval
int
The frequency, in seconds, that slices of a TWAP (307
) order will be executed. Default: 900
continuous
boolean
TWAP (307
) orders will execute slices as small as possible and frequently as possible over the total_time
. interval
will be ignored If continuous
= true.
post_only
boolean
TWAP (307
) orders will execute in "post-only" mode. The order will not take and will only execute slices as make orders.post_only
means it is possible the TWAP order will not fill completely by the end of the total_time
stop_amount
number
Set the amount (quote currency) that the trigger price of a trailing stop order will trail the price of an asset. Trailing Stop (308
) only.
stop_percent
number
Percentage that the trigger price of a trailing stop order will trail the price of an asset (e.g. 0.1
= 10%). Trailing Stop (308
) only.
stop_any_id
int
Turn your order into an STO (Stop-Triggers-Other) or TSTO (Trailing-Stop-Triggers-Other) order: Trigger placement of an order type of your choosing at a certain price or based on a trailing amount/percent. e.g. when price reaches $100 trigger a 1-hour TWAP. Possible values:
310
: STO (Stop-Triggers-Other)311
: TSTO (Trailing-Stop-Triggers-Other)
stop_any_price
number
Trigger price of an STO (Stop-Triggers-Other) order. Required if stop_any_id
= 310
.
stop_any_trail_amount
number
Trailing amount (quote currency) of a TSTO (Trailing-Stop-Triggers-Other) order. Required if stop_any_id
= 311
and stop_any_trail_percent
is not used.
stop_any_trail_percent
number
Specify the trailing percent of a TSTO (Trailing-Stop-Triggers-Other) order (e.g. 0.1
= 10%). Required if stop_any_id
= 311
and stop_any_trail_amount
is not used.
routing_option
string
Specify how sFOX will trade your order. Routing Options:
BestPrice
: Prioritize price improvement. Hare (303
) and Gorilla (301
) only.Fast
: Prioritize speed of execution. Hare (303
) and Gorilla (301
) only.WeightedExchange
: Prioritize routing based on the best combination of price and speed of execution. Smart (200
), Limit (201
) and Hare (303
) only.
Responses
Example Requests
Last updated