FTX API CODE
FTX API CODE
REST API
HTTP-based API with full trading and
asset management functionality,
with public orderbook and trades
data as well as private account data
and order management.
REST endpoint
URL: https://ftx.com/api
Pagination
Generalized Request
GET {endpoint}?start_time=1559881511&end_time=1559881711
FTX supports pagination on most
REST API endpoints. Pagination
allows you to specify the time range
of data to be returned, which also
enables you to retrieve more results
than are returned by default. You
can find sample Python code which
demonstrates pagination using the
start_time and end_time
parameters here
Subaccounts
To specify a subaccount, include its
URI-encoded nickname in the
header FTX-SUBACCOUNT with the
request.
Response format
Name Type Value Description
competition boolea true whether the subaccount was created for a competition
n
Create subaccount
Request
POST /subaccounts
{
"nickname": "sub2",
}
Response
{
"success": true,
"result": {
"nickname": "sub2",
"deletable": true,
"editable": true,
}
}
Requires authentication.
Payload format
Response format
editable boolea true whether the nickname of the subaccount can be changed
n
Payload format
Delete subaccount
Request
DELETE /subaccounts
{
"nickname": "sub2",
}
Response
{
"success": true,
"result": null
}
Requires authentication.
Payload format
Name Type Value Description
{
"success": true,
"result": [
{
"coin": "USDT",
"free": 4321.2,
"total": 4340.2,
"spotBorrow": 0,
"availableWithoutBorrow": 2320.2
}
]
}
Requires authentication.
Response format
Transfer between
subaccounts
Request
POST /subaccounts/transfer
{
"coin": "XRP",
"size": 10000,
"source": null,
"destination": "sub1",
}
Response
{
"success": true,
"result": {
"id": 316450,
"coin": "XRP",
"size": 10000,
"time": "2019-03-05T09:56:55.728933+00:00",
"notes": "",
"status": "complete",
}
}
Requires authentication.
Payload format
source string main name of the source subaccount. Use null or 'main' for the main account
destination string sub1 name of the destination subaccount. Use null or 'main' for the main
account
Response format
id numbe 316450
r
notes string
Markets
This section covers all types of
markets on FTX: spot, perpetual
futures, expiring futures, and MOVE
contracts. Examples for each type
are BTC/USD, BTC-PERP, BTC-0626,
and BTC-MOVE-1005. For futures that
expired in 2019, prepend a 2019 to
the date, like so: BTC-
20190628 or BTC-MOVE-20190923.
Get markets
Request
GET /markets
Response
{
"success": true,
"result": [
{
"name": "BTC-PERP",
"baseCurrency": null,
"quoteCurrency": null,
"quoteVolume24h": 28914.76,
"change1h": 0.012,
"change24h": 0.0299,
"changeBod": 0.0156,
"highLeverageFeeExempt": false,
"minProvideSize": 0.001,
"type": "future",
"underlying": "BTC",
"enabled": true,
"ask": 3949.25,
"bid": 3949,
"last": 10579.52,
"postOnly": false,
"price": 10579.52,
"priceIncrement": 0.25,
"sizeIncrement": 0.0001,
"restricted": false,
"volumeUsd24h": 28914.76,
"largeOrderThreshold": 5000.0,
"isEtfMarket": false,
}
]
}
Response format
name string BTC- e.g. "BTC/USD" for spot, "BTC-PERP" for futures
Name Type Value Description
PERP
minProvideSize number 0.001 Minimum maker order size (if >10 orders per hour fall below this size)
postOnly boolean false if the market is in post-only mode (all orders get modified to be post-only, in
addition to other settings they may have)
restricted boolean false if the market has nonstandard restrictions on which jurisdictions can trade it
Name Type Value Description
largeOrderThreshold number 5000.0 threshold above which an order is considered large (for VIP rate limits)
Get orderbook
Request
GET /markets/{market_name}/orderbook?depth={depth}
Response
{
"success": true,
"result": {
"asks": [
[
4114.25,
6.263
]
],
"bids": [
[
4112.25,
49.29
]
]
}
}
Parameters
Response format
Get trades
Supports pagination
Request
GET /markets/{market_name}/trades
Response
{
"success": true,
"result": [
{
"id": 3855995,
"liquidation": false,
"price": 3857.75,
"side": "buy",
"size": 0.111,
"time": "2019-03-20T18:16:23.397991+00:00"
}
]
}
Parameters
Response format
Request
GET /markets/{market_name}/candles?resolution={resolution}&start_time={start_time}&end_time={end_time}
Response
{
"success": true,
"result": [
{
"close": 11055.25,
"high": 11089.0,
"low": 11043.5,
"open": 11059.25,
"startTime": "2019-06-24T17:15:00+00:00",
"volume": 464193.95725
}
]
}
Parameters
resolution number 300 window length in seconds. options: 15, 60, 300, 900, 3600, 14400, 86400, or any
multiple of 86400 up to 30*86400
Response format
Name Type Value Description
close number 11055.25 mark price at the end of the window: startTime + resolution
Futures
This section covers all types of
futures on FTX: perpetual, expiring,
and MOVE. Examples for each type
are BTC-PERP, BTC-0626, and BTC-MOVE-
1005. For futures that expired in
2019, prepend a 2019 to the date,
like so: BTC-20190628.
List all futures
Request
GET /futures
Response
{
"success": true,
"result": [
{
"ask": 4196,
"bid": 4114.25,
"change1h": 0,
"change24h": 0,
"changeBod": 0,
"volumeUsd24h": 100000000,
"volume": 24390.24,
"description": "Bitcoin March 2019 Futures",
"enabled": true,
"expired": false,
"expiry": "2019-03-29T03:00:00+00:00",
"index": 3919.58841011,
"imfFactor": 0.002,
"last": 4196,
"lowerBound": 3663.75,
"mark": 3854.75,
"name": "BTC-0329",
"openInterest": 12.23,
"openInterestUsd": 47265.8925,
"perpetual": false,
"positionLimitWeight": 1.0,
"postOnly": false,
"priceIncrement": 0.25,
"sizeIncrement": 0.0001,
"underlying": "BTC",
"upperBound": 4112.2,
"type": "future"
}
]
}
Response format
Name Type Value Description
changeBod number 0.0 price change since midnight UTC (beginning of day)
index number 3919.58841011 average of the Market Prices for the constituent markets in the
index
lowerBound number 3663.75 the lowest price the future can trade at
upperBound number 4112.2 the highest price the future can trade at
Get future
Request
GET /futures/{future_name}
Response
{
"success": true,
"result": {
"ask": 4196,
"bid": 4114.25,
"change1h": 0,
"change24h": 0,
"description": "Bitcoin March 2019 Futures",
"enabled": true,
"expired": false,
"expiry": "2019-03-29T03:00:00+00:00",
"index": 3919.58841011,
"last": 4196,
"lowerBound": 3663.75,
"mark": 3854.75,
"name": "BTC-0329",
"perpetual": false,
"postOnly": false,
"priceIncrement": 0.25,
"sizeIncrement": 0.0001,
"underlying": "BTC",
"upperBound": 4112.2,
"type": "future"
}
}
Response format
index number 3919.58841011 average of the Market Prices for the constituent markets in the
index
lowerBound number 3663.75 the lowest price the future can trade at
upperBound number 4112.2 the highest price the future can trade at
nextFundingRate number 0.00025 upcoming funding rate (only applicable for perpetual
contracts)
nextFundingTime string 2019-03- upcoming funding time (only applicable for perpetual
29T03:00:00+00:00 contracts)
expirationPrice number 3992.1 price to which the future expired (only applicable if the future
has expired)
predictedExpirationPrice number 3993.0 only applicable if the future has not expired
Name Type Value Description
strikePrice number 8182.35009484 price of the underlying at the beginning of the expiration day
(only applicable for MOVE contracts)
Request
GET /funding_rates
Parameters
Response
{
"success": true,
"result": [
{
"future": "BTC-PERP",
"rate": 0.0025,
"time": "2019-06-02T08:00:00+00:00"
}
]
}
Response format
Response
{
"success": true,
"result": {
"BCH": 0.3492,
"BNB": 2.8632,
"BSV": 0.3471,
"EOS": 18.1707,
"ETH": 0.5724,
"LTC": 1.2973,
"XRP": 573.6345,
}
}
Request
GET /expired_futures
Response
{
"success": true,
"result": [
{
"ask": null,
"bid": null,
"description": "Bitcoin March 2020 Futures",
"enabled": false,
"expired": true,
"expiry": "2020-03-27T03:00:00+00:00",
"expiryDescription": "March 2020",
"group": "quarterly",
"imfFactor": 0.002,
"index": 6807.943073426,
"last": 6804.75,
"lowerBound": 6467.75,
"marginPrice": 6801.1226609324885,
"mark": 6801.1226609324885,
"moveStart": null,
"name": "BTC-0327",
"perpetual": false,
"positionLimitWeight": 2.0,
"postOnly": false,
"priceIncrement": 0.5,
"sizeIncrement": 0.0001,
"type": "future",
"underlying": "BTC",
"underlyingDescription": "Bitcoin",
"upperBound": 7152.75
}
]
}
Request
GET /indexes/{market_name}/candles?resolution={resolution}&start_time={start_time}&end_time={end_time}
Response
{
"success": true,
"result": [
{
"close": 11055.25,
"high": 11089.0,
"low": 11043.5,
"open": 11059.25,
"startTime": "2019-06-24T17:15:00+00:00",
"volume": null
}
]
}
Parameters
Name Type Value Description
resolution number 300 window length in seconds. options: 15, 60, 300, 900, 3600, 14400, 86400, or any
multiple of 86400 up to 30*86400
Response format
close number 11055.25 mark price at the end of the window: startTime + resolution
Response format
Response format
marginFraction number 0.5588433331419503 ratio between total account value and total account
- position notional.
openMarginFraction number 0.2447194090423075 Ratio between total realized account value and total
open position notional
totalAccountValue number 3568180.98341129 collateral plus unrealized pnl. note that this does not
include the value of non-collateral holdings
totalAccountNav number 3568180.98341129 the sum of the usd value of all balances plus unrealized
pnl. this is the same as totalAccountValue except that it
does include the value of non-collateral holdings.
totalPositionSize number 6384939.6992 total size of positions held by the account, using mark
price
Name Type Value Description
Payload format
Response
{
"success": true,
"result": 12332
}
Name Type Value Description
Response
{
"success": true,
"result": {
"id": 12332,
"accounts": ["main", "subaccounts"],
"time": 1646356865,
"endTime": 1646376865,
"status": "done",
"error": false,
"results": [
{"account": "main", "ticker": "BTC-PERP", "size": -1.2, "price": 40122.13},
{"account": "main", "ticker": "USD", "size": 10000.3},
]
}
}
Name Type Value Description
id number 12332
price number 40122.13 mark price of future at endTime (null for options and balances entries)
Response
{
"success": true,
"result": [
{
"id": 12332,
"accounts": ["main", "subaccounts"],
"time": 1646356865,
"endTime": 1646376865,
"status": "done",
"error": false,
"results": [
{"account": "main", "ticker": "BTC-PERP", "size": -1.2, "price": 40122.13},
{"account": "main", "ticker": "USD", "size": 10000.3},
]
}
]
}
Get positions
Request
GET /positions
Response
{
"success": true,
"result": [
{
"cost": -31.7906,
"cumulativeBuySize": 1.2,
"cumulativeSellSize": 0.0,
"entryPrice": 138.22,
"estimatedLiquidationPrice": 152.1,
"future": "ETH-PERP",
"initialMarginRequirement": 0.1,
"longOrderSize": 1744.55,
"maintenanceMarginRequirement": 0.04,
"netSize": -0.23,
"openSize": 1744.32,
"realizedPnl": 3.39441714,
"recentAverageOpenPrice": 135.31,
"recentBreakEvenPrice": 135.31,
"recentPnl": 3.1134,
"shortOrderSize": 1732.09,
"side": "sell",
"size": 0.23,
"unrealizedPnl": 0,
"collateralUsed": 3.17906
}
]
}
Requires authentication.
Parameters
Name Type Value Description
Response format
cost numbe -31.7906 Amount that was paid to enter this position, equal to size *
r entry_price. Positive if long, negative if short.
entryPrice numbe 138.22 Average cost of this position after pnl was last realized: whenever
r unrealized pnl gets realized, this field gets set to mark price,
unrealizedPnL is set to 0, and realizedPnl changes by the previous
value for unrealizedPnl.
initialMarginRequirement numbe 0.1 Minimum margin fraction for opening new positions
r
openSize numbe 1744.32 Maximum possible absolute position size if some subset of open
r orders are filled
price)
For MOVE: initialMarginRequirement * openSize * (index
price)
Otherwise: initialMarginRequirement * openSize * (mark
price)
Payload format
Get coins
Request
GET /wallet/coins
Response
{
"success": true,
"result": [
{
"bep2Asset": null,
"canConvert": true,
"canDeposit": true,
"canWithdraw": true,
"collateral": true,
"collateralWeight": 0.975,
"creditTo": null,
"erc20Contract": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"fiat": false,
"hasTag": false,
"id": "USDT",
"isToken": false,
"methods": ["omni", "erc20", "trx", "sol"],
"name": "USD Tether",
"splMint": "BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4",
"trc20Contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"usdFungible": false
}
]
}
Response format
Name Type Value Description
hasTag boolean false true if addresses for this coin have a tag
id string USDT
Get balances
Request
GET /wallet/balances
Response
{
"success": true,
"result": [
{
"coin": "USDTBEAR",
"free": 2320.2,
"spotBorrow": 0.0,
"total": 2340.2,
"usdValue": 2340.2,
"availableWithoutBorrow": 2320.2
}
]
}
Requires authentication.
Response format
{
"success": true,
"result": {
"main": [
{
"coin": "USDTBEAR",
"free": 2320.2,
"spotBorrow": 0.0,
"total": 2340.2,
"usdValue": 2340.2,
"availableWithoutBorrow": 2320.2
},
{
"coin": "BTC",
"free": 2.0,
"spotBorrow": 0.0,
"total": 3.2,
"usdValue": 23456.7,
"availableWithoutBorrow": 2.0
}
],
"Battle Royale": [
{
"coin": "USD",
"free": 2000.0,
"spotBorrow": 0.0,
"total": 2200.0,
"usdValue": 2200.0,
"availableWithoutBorrow": 2000.0
}
]
}
}
Requires authentication.
Response format
Request parameters
method string erc20 optional; for coins available on different blockchains (e.g USDT)
Response format
Name Type Value Description
Request parameters
Name Type Value Description
method string erc20 optional; for coins available on different blockchains (e.g USDT)
Response format
Supports pagination
Request parameters
start_time number 1564146934 optional; minimum time of items to return, in Unix time (seconds since 1970-01-01)
end_time number 1564233334 optional; maximum time of items to return, in Unix time (seconds since 1970-01-01)
Response format
Name Type Value Description
id number 1 deposit id
Supports pagination
Request parameters
Name Type Value Description
start_time number 1564146934 optional; minimum time of items to return, in Unix time (seconds since 1970-01-01)
end_time number 1564233334 optional; maximum time of items to return, in Unix time (seconds since 1970-01-01)
Response format
id numbe 1 withdrawal id
r
Name Type Value Description
Request withdrawal
Request
POST /wallet/withdrawals
{
"coin": "USDTBEAR",
"size": 20.2,
"address": "0x83a127952d266A6eA306c40Ac62A4a70668FE3BE",
"tag": null,
"password": "my_withdrawal_password",
"code": 152823
}
Response
{
"success": true,
"result": {
"coin": "USDTBEAR",
"address": "0x83a127952d266A6eA306c40Ac62A4a70668FE3BE",
"tag": null,
"fee": 0,
"id": 1,
"size": 20.2,
"status": "requested",
"time": "2019-03-05T09:56:55.728933+00:00",
"txid": null
}
}
Requires authentication.
Payload format
code string null optional; 2fa code if it is required for your account
Response format
id number 1 withdrawal id
Get airdrops
This endpoint provides you with
updates to your AMPL balances
based on AMPL rebases.
Request
GET /wallet/airdrops
Response
{
"success": true,
"result": [
{
"coin": "AMPL",
"id": 1,
"size": 99.0,
"time": "2019-03-05T09:56:55.728933+00:00",
"status": "complete"
}
]
}
Requires authentication.
Supports pagination
Request parameters
start_time number 1564146934 optional; minimum time of items to return, in Unix time (seconds since 1970-01-01)
end_time number 1564233334 optional; maximum time of items to return, in Unix time (seconds since 1970-01-01)
Response format
Name Type Value Description
id numbe 1 aidrop id
r
Payload format
metho string erc20 optional; for coins available on different blockchains (e.g
d USDT)
Response format
fee number 0 fee that will be charged on the withdrawal (size - fee will be sent to
the destination)
Request
GET /wallet/saved_addresses
Response
{
"success": true,
"result": [
{
"address": "0xb2EA1CC386A260c9Ae3ebda2cb7AEd212b034Ab4",
"coin": "ETH",
"fiat": false,
"id": 31189,
"isPrimetrust": false,
"lastUsedAt": "2020-09-21T15:38:11.795763+00:00",
"name": "MetaMask 1",
"tag": null,
"whitelisted": true,
"whitelistedAfter": "2020-08-26T09:41:53.959256+00:00"
},
{
"address": "0xE4Ba8791E0fdbdc50024898A384FecFD90e69553",
"coin": "ETH",
"fiat": false,
"id": 46725,
"isPrimetrust": false,
"lastUsedAt": "2020-09-21T09:16:46.918175+00:00",
"name": "Ledger Nano S",
"tag": null,
"whitelisted": true,
"whitelistedAfter": "2020-09-21T09:16:16.829467+00:00"
}
]
}
Requires authentication.
Request parameters
Response format
Name Type Value Description
id int 31189
whitelistedAfter string "2020-09-21T09:16:16.829467+00:00" Date after which the address has been
whitelisted, null if the address has never
Name Type Value Description
whitelist boolean false Pass true if the user has whitelisting enabled
and would like this new address to be
whitelisted
Response format
id int 52382
whitelistedAfter boolean null Date after which the address has been
whitelisted, null if the address has never
been whitelisted or has been unwhitelisted
Request parameters
Typ
Name e Value Description
Valu
Name Type e Description
Orders
Request parameters
Response format
id number 9596912
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
Supports pagination
Request parameters
start_time number 1559881511 optional; only fetch orders created after this time
end_time number 1559901511 optional; only fetch orders created before this time
Response format
id number 257132591
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
Request parameters
Response format
error string null [DEPRECATED] error that occurred on most recent trigger, if
exists; otherwise null
Name Type Value Description
id number 50001
orderId number null [DEPRECATED] order id of the most recent trigger, if exixsts;
otherwise null
orderPrice number 0.50 Limit price for stop limit and take profit limit orders; otherwise
null
trailStart number null trigger price - trail value; only for trailing stop orders
Name Type Value Description
triggerPrice number 0.49 market price at which this order will trigger
filledSize number 0
Response format
error string null reason for order failing to be placed, null if successful
Name Type Value Description
Supports pagination
Request parameters
start_time number 1559881511 optional; only fetch orders created after this time
end_time number 1559881511 optional; only fetch orders created before this time
side string buy optional; valid values are buy and sell.
orderType string limit optional; valid values are market and limit.
Response format
Name Type Value Description
error string null [DEPRECATED] error that occurred on most recent trigger, if
exists; otherwise null
id number 50001
orderId number null [DEPRECATED] order ID if this order has triggered; otherwise
null
orderPrice number 0.50 Limit price for stop limit and take profit limit orders; otherwise
null
trailStart number null trigger price - trail value; only for trailing stop orders
triggerPrice number 0.49 market price at which this order will trigger
filledSize number 0
Supports pagination
Request parameters
marke string BTC/ optional; When provided, only TWAP orders for this market are returned.
t USD
Response format
id number 50001
Name Type Value Description
type string market One of market or limit. Determines the type of order
that each TWAP execution sends.
durationSeconds number 600 In seconds, the duration this TWAP order will run for.
randomizeSize boolea false If true, each individual order for this TWAP will be sent
n with size bound by some [lower, upper] bound.
Name Type Value Description
maxSpread number 0.01 Optional; When specified, an individual order for this
TWAP will not be sent if market spread is higher than
maxSpread. For %1 spread, this value will be 0.01.
maxIndividualOrderSize number 0.01 Optional; When specified, an individual order for this
TWAP will be capped at maxIndividualOrderSize
maxDistanceThroughBook number 0.01 Optional; Max allowed distance of order price from
market price. For 1% distance, this field will be 0.01.
priceBound number 5500 Optional; When specified, an individual order for this
TWAP will not be sent if market price is above (for buys)
or below (for sells) this price bound.
filledSize number 0 Total filled size of this TWAP. This value is updated
throughout a TWAP's execution.
avgFillPrice number null Average price paid for the filled size.
Supports pagination
Request parameters
Response format
id numbe 50001
r
failureReason string 'insufficient_balance' This field may be populated if status is not 'sent' and there is
additional information about this error. See table below for
possible values.
size numbe 0.5 Size of the order that was placed as part of this execution
r
filledSize numbe 0.5 Total filled size for this individual order. Total of all filledSize's for all
r individual orders within a TWAP is equal to the total filled size of
the TWAP.
avgFillPrice numbe 5000 Average price paid for the filled size of this individual order.
r
orderStatus string 'closed' Status of the order that was sent as part of this execution. One
of new, open, closed
orderType string 'market' Order type of the order that was sent as part of this execution. One
of market, limit.
Status format
Status Description
skipped_spread_higher_than_allo This TWAP has a non-null maxSpread specified and this order was not sent because max
wed
spread was exceeded.
skipped_remaining_size_too_smal Remaining size for this TWAP is smaller than the minimum order size allowed for the
l
market. This TWAP will stop execution after encountering this issue.
skipped_run_size_too_small Order size for this individual run is smaller than the minimum order sized allowed for this
market.
skipped_place_order_failed Placing this individual order failed. The failureReason field will be populated if there is
additional information available (e.g. not enough balances).
skipped_last_order_not_closed The most recent order placed for this TWAP is still open.
skipped_price_bound_exceeded This TWAP has a non-null priceBound specified, and the market price exceeded that price
bound at the time this order was attempted to be executed.
insufficient_margin User did not have enough margin to send an order as part of this execution
insufficient_balance User did not have enough balance to send an order as part of this execution.
invalid_reduce_only_or This execution attempted to place a reduce-only order that would have been invalid (e.g. would have
der
opened position).
account_being_liquidat The account was being liquidated at the time of TWAP execution.
ed
Place order
Request
POST /orders
{
"market": "XRP-PERP",
"side": "sell",
"price": 0.306525,
"type": "limit",
"size": 31431.0,
"reduceOnly": false,
"ioc": false,
"postOnly": false,
"clientId": null
}
Response
{
"success": true,
"result": {
"createdAt": "2019-03-05T09:56:55.728933+00:00",
"filledSize": 0,
"future": "XRP-PERP",
"id": 9596912,
"market": "XRP-PERP",
"price": 0.306525,
"remainingSize": 31431,
"side": "sell",
"size": 31431,
"status": "open",
"type": "limit",
"reduceOnly": false,
"ioc": false,
"postOnly": false,
"clientId": null,
}
}
Requires authentication.
Payload format
market string XRP- e.g. "BTC/USD" for spot, "XRP-PERP" for futures
PERP
Name Type Value Description
rejectOnPriceBand boolean false optional; if the order should be rejected if its price would instead be adjusted due
to price bands
rejectAfterTs number null optional; if the order would be put into the placement queue after this timestamp,
instead reject it. If it would be placed on the orderbook after the timestamp, then
Name Type Value Description
immediately close it instead (as if it were, for instance, a post-only order that would
have taken)
Response format
id number 9596912
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
{
"market": "XRP-PERP",
"side": "sell",
"triggerPrice": 0.306525,
"size": 31431.0,
"type": "stop",
"reduceOnly": false,
}
Trailing stop
{
"market": "XRP-PERP",
"side": "sell",
"trailValue": -0.05,
"size": 31431.0,
"type": "trailingStop",
"reduceOnly": false,
}
Take profit
{
"market": "XRP-PERP",
"side": "buy",
"triggerPrice": 0.367895,
"size": 31431.0,
"type": "takeProfit",
"reduceOnly": false,
}
Response
{
"success": true,
"result": {
"createdAt": "2019-03-05T09:56:55.728933+00:00",
"future": "XRP-PERP",
"id": 9596912,
"market": "XRP-PERP",
"triggerPrice": 0.306525,
"orderId": null,
"side": "sell",
"size": 31431,
"status": "open",
"type": "stop",
"orderPrice": null,
"error": null,
"triggeredAt": null,
"reduceOnly": false,
"orderType": "market",
"retryUntilFilled": false,
}
}
Requires authentication.
Payload format
retryUntilFilled boolean false Whether or not to keep re-triggering until filled. optional, default true for market
Name Type Value Description
orders
orderPrice number 0.3063 optional; order type is limit if this is specified; otherwise market
Valu
Name Type e Description
orderPrice number 0.3067 optional; order type is limit if this is specified; otherwise market
Response format
id number 9596912
orderId number 123123 [DEPRECATED] ID of the order sent on the most recent trigger,
Name Type Value Description
if exists
orderPrice number null price of the order sent when this stop loss triggered
triggeredAt string null time at which this stop loss order triggered
Request parameters
type string market One of market or limit. Determines the type of order that each TWAP
execution sends.
durationSeconds number 600 In seconds, the duration this TWAP order will run for.
randomizeSize boolea false If true, each individual order for this TWAP will be sent with size bound by
Name Type Value Description
maxSpread number 0.01 Optional; When specified, an individual order for this TWAP will not be sent
if market spread is higher than maxSpread. For %1 spread, this value will be
0.01.
maxIndividualOrderSize number 0.01 Optional; When specified, an individual order for this TWAP will be capped at
maxIndividualOrderSize
maxDistanceThroughBook number 0.01 Optional; Max allowed distance of order price from market price. For 1%
distance, this field will be 0.01.
priceBound number 5500 Optional; When specified, an individual order for this TWAP will not be sent
if market price is above (for buys) or below (for sells) this price bound.
Response format
id number 50001
05T09:56:55.728933+00:00
type string market One of market or limit. Determines the type of order
that each TWAP execution sends.
durationSeconds number 600 In seconds, the duration this TWAP order will run for.
randomizeSize boolea false If true, each individual order for this TWAP will be sent
n with size bound by some [lower, upper] bound.
Name Type Value Description
maxSpread number 0.01 Optional; When specified, an individual order for this
TWAP will not be sent if market spread is higher than
maxSpread. For %1 spread, this value will be 0.01.
maxIndividualOrderSize number 0.01 Optional; When specified, an individual order for this
TWAP will be capped at maxIndividualOrderSize
maxDistanceThroughBook number 0.01 Optional; Max allowed distance of order price from
market price. For 1% distance, this field will be 0.01.
priceBound number 5500 Optional; When specified, an individual order for this
TWAP will not be sent if market price is above (for buys)
or below (for sells) this price bound.
filledSize number 0 Total filled size of this TWAP. This value is updated
throughout the execution of the TWAP.
avgFillPrice number null Average price paid for the filled size.
Modify order
Request
POST /orders/{order_id}/modify
{
"size": 31431,
"price": 0.326525,
}
Response
{
"success": true,
"result": {
"createdAt": "2019-03-05T11:56:55.728933+00:00",
"filledSize": 0,
"future": "XRP-PERP",
"id": 9596932,
"market": "XRP-PERP",
"price": 0.326525,
"remainingSize": 31431,
"side": "sell",
"size": 31431,
"status": "open",
"type": "limit",
"reduceOnly": false,
"ioc": false,
"postOnly": false,
"clientId": null,
}
}
Please note that the order's queue
priority will be reset, and the order
ID of the modified order will be
different from that of the original
order. Also note: this is
implemented as cancelling and
replacing your order. There's a
chance that the order meant to be
cancelled gets filled and its
replacement still gets placed.
Requires authentication.
Payload format
Name Type Value Description
Response format
id number 9596932
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
Requires authentication.
Payload format
Response format
id number 9596932
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
Name Type Value Description
Request
POST /conditional_orders/{order_id}/modify
Stop
{
"triggerPrice": 0.306225,
"size": 31431.0,
}
Trailing stop
{
"trailValue": -0.06,
"size": 31432.0,
}
Take profit
{
"triggerPrice": 0.367885,
"size": 31433.0,
}
Response
{
"success": true,
"result": {
"createdAt": "2019-03-05T09:56:55.728933+00:00",
"future": "XRP-PERP",
"id": 9596912,
"market": "XRP-PERP",
"triggerPrice": 0.306225,
"orderId": null,
"side": "sell",
"size": 31431,
"status": "open",
"type": "stop",
"orderPrice": null,
"error": null,
"triggeredAt": null,
"reduceOnly": false,
"orderType": "market",
"filledSize": 0,
"avgFillPrice": null,
"retryUntilFilled": false
}
}
Requires authentication.
Payload format
Response format
id number 9596912
orderId number 123123 [DEPRECATED] ID of the order sent on the most recent trigger,
Name Type Value Description
if exists
orderPrice number null price of the order sent when this stop loss triggered
triggeredAt string null time at which this stop loss first triggered
id number 9596912
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
Response format
id number 9596912
status string new (accepted but not processed yet), open, or closed (filled or
cancelled)
Cancel order
Request
DELETE /orders/{order_id}
Response
{
"success": true,
"result": "Order queued for cancelation"
}
Requires authentication.
Request
DELETE /orders
{
"market": "BTC-PERP",
}
Response
{
"success": true,
"result": "Orders queued for cancelation"
}
Requires authentication.
Payload format
Name Type Value Description
market string USDTBEAR optional; restrict to cancelling orders only on this market
side string buy optional; restrict to cancelling orders only on this side
limitOrdersOnly boolean false optional; restrict to cancelling existing limit orders (non-conditional orders)
only
Payload format
Typ
Name e Value Description
Response format
result list [1234, Ids of orders that were successfully queued for cancellation.
456]
Response format
Nam
e Type Value Description
result list [1234, Client order ids that were successfully queued for cancellation.
456]
Fills
Request
GET /fills?market={market}
Response
{
"success": true,
"result": [
{
"fee": 20.1374935,
"feeCurrency": "USD",
"feeRate": 0.0005,
"future": "EOS-0329",
"id": 11215,
"liquidity": "taker",
"market": "EOS-0329",
"baseCurrency": null,
"quoteCurrency": null,
"orderId": 8436981,
"tradeId": 1013912,
"price": 4.201,
"side": "buy",
"size": 9587,
"time": "2019-03-27T19:15:10.204619+00:00",
"type": "order"
}
]
}
Requires authentication.
Supports pagination
Request parameters
start_time number 1564146934 optional; minimum time of fills to return, in Unix time (seconds since 1970-01-01)
end_time number 1564233334 optional; maximum time of fills to return, in Unix time (seconds since 1970-01-01)
Name Type Value Description
order string null optional; default is descending, supply 'asc' to receive fills in ascending order of time
Response format
Funding Payments
Requires authentication.
Supports pagination
Request
GET /funding_payments
Name Type Value Description
Response
{
"success": true,
"result": [
{
"future": "ETH-PERP",
"id": 33830,
"payment": 0.0441342,
"time": "2019-05-15T18:00:00+00:00",
"rate": 0.0001
}
]
}
Response format
id number 33830
positionsPerShare dict {"BTC-PERP": -0.001966859604267557} Futures positions per share: one element for
each item in targetComponents
change1h number -0.008438973233561787 change in the price of the token over the past
hour
Name Type Value Description
change24h number 0.014631456489264717 change in the price of the token over the past
day
Response format
Response format
Name Type Value Description
id number 123
createdSize number 10 number of tokens created; may be less than the requested
number
price number 1234 price at which the creation request was fulfilled
cost number 12340 cost of creating the tokens, not including fees
Request parameters
e E
Payload format
Response format
id number 123
cost number 12340 amount of collateral deducted for the creation request
Supports pagination
Response format
Name Type Value Description
id number 123
price number 1234 price at which the redemption request was fulfilled
Request parameters
Payload format
Response format
id number 123
Response
{
"BNBBEAR": {
"orderSizeList": [
"751.80000000",
"751.80000000",
"751.80000000",
"1.10000000"
],
"side": "buy",
"time": "2021-05-03 13:03:48.585349"
},
"DOGEBEAR2021": {
"orderSizeList": [
"440614.00000000"
],
"side": "buy",
"time": "2021-05-03 13:31:44.577947"
},
"DOGEBEAR": {
"orderSizeList": [
"118599.00000000"
],
"side": "buy",
"time": "2021-05-03 13:31:45.746563"
}
}
Response format
Options
id numbe 512
r
08T22:35:54.626023+00:00
limitPrice numbe 10.2 optional; omitted when the request has no limit price or it is
r hidden
Request
GET /options/my_requests
Response
{
"success": true,
"result": [
{
"id": 512,
"option": {
"underlying": "BTC",
"type": "call",
"strike": 7800,
"expiry": "2020-01-08T03:00:00+00:00",
},
"side": "buy",
"size": 1.2,
"time": "2020-01-07T22:35:54.626023+00:00",
"requestExpiry": "2020-01-08T22:35:54.626023+00:00",
"status": "open",
"hideLimitPrice": true,
"limitPrice": 1.2,
"quotes": [
{
"collateral": 8762.71757981,
"id": 1029,
"price": 1.0,
"quoteExpiry": null,
"status": "open",
"time": "2020-01-07T22:49:31.367379+00:00".
},
],
},
],
}
Response format
id number 512
Name Type Value Description
quotes array list of quotes for your quote request; see below
hideLimitPrice bool true whether or not to hide your limit price if it exists
limitPrice number 1.2 optional; omitted if your request does not have a limit price
id number 1029
POST /options/requests
{
"underlying": "BTC",
"type": "call",
"strike": 7800,
"expiry": 1578625200,
"side": "buy",
"size": 5,
}
Payload format
expiry number 1578625200 unix timestamp of option expiry. Must be in the future and at 03:00 UTC.
size number 5
hideLimitPrice bool true whether or not to hide your limit price from potential quoters, default true
requestExpiry number null optional; unix timestamp of request expiry, defaults to 5 minutes in the future
Name Type Value Description
counterpartyId number 1234567 optional; when specified, makes the request private to the specified counterparty
Response
{
"success": true,
"result": {
"id": 3,
"option": {
"expiry": "2020-01-10T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC"
},
"expiry": "2020-01-10T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC",
"requestExpiry": "2020-01-08T23:05:44.047653+00:00",
"side": "buy",
"size": 5,
"status": "open",
"time": "2020-01-07T23:05:44.047653+00:00"
},
}
Request
DELETE /options/requests/{request_id}
Response
{
"id": 3,
"option": {
"expiry": "2020-01-10T03:00:00+00:00",
"strike": 7800.0,
"type":"call",
"underlying": "BTC"
},
"requestExpiry": "2020-01-08T23:05:44.047653+00:00",
"side": "buy",
"size": 5.0,
"status": "cancelled",
"time": "2020-01-07T23:05:44.047653+00:00",
}
Request
GET /options/requests/{request_id}/quotes
Response
{
"success": true,
"result": {
"collateral": 26862.33468643,
"id": 2,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike"': 10.0,
"type": "call",
"underlying": "BTC"
},
"price": 11.0,
"quoteExpiry": null,
"quoterSide": "sell",
"requestId": 4,
"requestSide": "buy",
"size": 3.0,
"status": "open",
"time": "2020-01-07T23:43:24.772581+00:00"
},
}
Name Type Value Description
requestLimitPrice numbe null the quote request's limit price. omitted if does not
r exist or hidden
Create quote
Requires authentication.
Request
POST /options/requests/{request_id}/quotes
{
"price": 11.0,
}
Payload format
Nam
e Type Value Description
Response
{
"success": true,
"result": {
"collateral": 26862.33468643,
"id": 2,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike"': 10.0,
"type": "call",
"underlying": "BTC"
},
"price": 11.0,
"quoteExpiry": null,
"quoterSide": "sell",
"requestId": 4,
"requestSide": "buy",
"size": 3.0,
"status": "open",
"time": "2020-01-07T23:43:24.772581+00:00"
},
}
Get my quotes
Requires authentication.
Request
GET /options/my_quotes
Response
{
"success": true,
"result": {
"collateral": 26862.33468643,
"id": 2,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike": 10.0,
"type": "call",
"underlying": "BTC"
},
"price": 11.0,
"quoteExpiry": null,
"quoterSide": "sell",
"requestId": 4,
"requestSide": "buy",
"size": 3.0,
"status": "open",
"time": "2020-01-07T23:43:24.772581+00:00"
},
}
Cancel quote
Requires authentication.
Request
DELETE /options/quotes/<quote_id>
Response
{
"success": true,
"result": {
"collateral": 0,
"id": 4,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC",
},
"price": 11,
"quoteExpiry": null,
"quoterSide": "sell",
"requestId": 4,
"requestSide": "buy",
"size": 3,
"status": "cancelled",
"time": "2020-01-08T00:20:00.532812+00:00",
},
}
Request
POST /options/quotes/<quote_id>/accept
Response
{
"success": true,
"result": {
"collateral": 0,
"id": 5,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC",
},
"price": 11,
"quoteExpiry": null,
"quoterSide": "sell",
"requestId": 4,
"requestSide": "buy",
"size": 3,
"status": "filled",
"time": "2020-01-08T00:20:00.532812+00:00",
},
}
Request
GET /options/account_info
Response
{
"success": true,
"result": {
"usdBalance": 34.0,
"liquidationPrice": 1900.2,
"liquidating": false,
},
}
Name Type Value Description
maintenanceMarginRequirement number 1200.1 you will be liquidated if your account collateral + options usdBalance
2 drops below this number
Request
GET /options/positions
Response
{
"success": true,
"result": [
{
"entryPrice": 11.0,
"netSize": 3.0,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC",
},
"side": "buy",
"size": 3,
},
]
}
Name Type Value Description
pessimisticValuation number 1.1 optional; pessimistic valuation of this position used for
margin purposes
Request
GET /options/trades
Request parameters
start_time number 1559881511 optional; only fetch orders created after this time
end_time number 1559901511 optional; only fetch orders created before this time
Name Type Value Description
Response
{
"success": true,
"result": [
{
"id": 31,
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC",
},
"price": 3,
"size": 1,
"time": "2020-01-08T02:59:57.270744+00:00",
},
]
}
Name Type Value Description
id number 31
Supports pagination
Request
GET /options/fills
Request parameters
start_time number 1559881511 optional; only fetch orders created after this time
end_time number 1559901511 optional; only fetch orders created before this time
Response
{
"success": true,
"result": [
{
"fee": 1.782852614186007,
"feeRate": 0.0001729,
"id": 5,
"liquidity": "taker",
"option": {
"expiry": "2020-01-08T03:00:00+00:00",
"strike": 7800,
"type": "call",
"underlying": "BTC"
},
"price": 3,
"quoteId": 6,
"side": "sell",
"size": 1,
"time": "2020-01-08T02:59:57.270744+00:00",
},
]
}
Name Type Value Description
id number 5
}
Name Type Value Description
contracts number 216.6842 Number of contracts traded over the last 24 hours
underlying_total number 2111838.071037173 Notional value of the contracts traded over the last 24 hours
Name Type Value Description
Request
GET /options/historical_volumes/BTC
Request parameters
start_time number 1559881511 optional; only fetch orders created after this time
end_time number 1559901511 optional; only fetch orders created before this time
Response
{
"success": true,
"result": [
{
"numContracts": 1.0,
"endTime": "2020-07-01T04:06:00.584303+00:00",
"startTime": "2020-07-01T03:06:00.543341+00:00"
}
]
}
Name Type Value Description
start_time number 1559881511 optional; only fetch orders created after this time
end_time number 1559901511 optional; only fetch orders created before this time
Response
{
"success": true,
"result": [
{
"numContracts": 5870.6395,
"time": "2020-07-01T04:06:00.589877+00:00"
}
]
}
Name Type Value Description
Get stakes
Request
GET /staking/stakes
Response
{
"success": true,
"result": [
{
"coin": "SRM",
"createdAt": "2020-08-12T12:13:56.900236+00:00",
"id": 2447,
"size": 0.1,
}
]
}
Name Type Value
id int 2447
id int 121
Request
GET /staking/balances
Response
{
"success": true,
"result": [
{ "coin": "SRM",
"lifetimeRewards": 1.98e-06,
"scheduledToUnstake": 0.1,
"staked": 0.0},
{ "coin": "MSRM",
"lifetimeRewards": 0,
"scheduledToUnstake": 0,
"staked": 0.0},
{ "coin": "MSRM_LOCKED",
"lifetimeRewards": 0,
"scheduledToUnstake": 0,
"staked": 0.0},
{ "coin": "SRM_LOCKED",
"lifetimeRewards": 1.98e-06,
"scheduledToUnstake": 0,
"staked": 0.0,
}
]
}
Unstake request
Request parameters
Request
POST /staking/unstake_requests
Response
{
"success": true,
"result": [
{ "coin": "SRM",
"createdAt": "2020-08-12T21:03:21.539419+00:00",
"id": 122,
"size": 0.1,
"status": "pending",
"unlockAt": "2020-08-19T21:03:21.543783+00:00",
}
]
}
Name Type Value
Request
GET /staking/staking_rewards
Response
{
"success": true,
"result": [
{ "coin": "SRM",
"id": 99730,
"size": 0.1,
"status": "complete",
"time": "2020-08-12T20:15:25.260879+00:00"},
}
]
}
Nam
e Type Value
id int 99730
Stake request
Request parameters
Request
POST /srm_stakes/stakes
Response
{
"success": true,
"result": [
{ "coin": "SRM",
"createdAt": "2020-08-12T21:17:39.884879+00:00",
"id": 3001,
"size": 0.1,
}
]
}
Name Type Value
id int 3001
Request quote
Request
POST /otc/quotes
{
"fromCoin": "BTC",
"toCoin": "USD",
"size": 0.05
}
Response
{
"success": true,
"result": {
"quoteId": 1031
}
}
Requires authentication.
Payload format
Request parameters
Name Type Value Description
Response format
expired bool false if the quote is expired (if so, cannot accep tit)
id number 1031
Accept quote
Request
POST /otc/quotes/{quote_id}/accept
Response
{
"success": true,
"result": null
}
Requires authentication.
Payload format
Request parameters
start_time number 155988151 optional; only fetch history after this time
1
end_time number 155990151 optional; only fetch history before this time
1
Response
{
"success": true,
"result": [
{
"coin": "BTC",
"time": "2021-04-06T20:00:00+00:00",
"rate": 0.00002283,
"size": 615974048.2224404
}
]
}
Response format
Nam
e Type Value Description
size number 615974048.2224404 total size matched between borrowers and lenders
Response format
Name Type Value Description
estimate number 1.45e-06 estimated hourly borrow rate for the next spot margin cycle
previous number 1.44e-06 hourly borrow rate in the previous spot margin cycle
estimate number 1.45e- estimated hourly lending rate for the next spot margin cycle
06
previous number 1.44e- hourly lending rate in the previous spot margin cycle
06
Nam
e Type Value Description
size number 120.1 average matched borrowed and lent amount over the last 24h
Response format
Name Type Value Description
free numbe 3.87278021 amount of coin that can be spent buying the other coin in the supplied market,
r including what's borrowable with margin
estimatedRate numbe 1.45e-06 estimated hourly borrow rate for the next spot margin cycle
r
previousRate numbe 1.44e-06 hourly borrow rate in the previous spot margin cycle
r
Supports pagination
Request parameters
start_time number 155988151 optional; only fetch history after this time
1
end_time number 155990151 optional; only fetch history before this time
1
Response format
cost numbe 0.00047864470072 amount of coin you paid as interest on the borrow
r
Name Type Value Description
GET /spot_margin/lending_history
Response
{
"success": true,
"result": [
{
"coin": "BTC",
"proceeds": 0.00047864470072,
"rate": 1.961096e-05,
"size": 24.407,
"time": "2020-11-30T12:00:00+00:00"
}
]
}
Requires authentication.
Supports pagination
Request parameters
start_time number 155988151 optional; only fetch history after this time
1
end_time number 155990151 optional; only fetch history before this time
1
Response format
proceed number 0.00047864470072 amount of coin you were paid as interest on the loan
s
30T12:00:00+00:00
Response format
rate numbe 1e-06 hourly rate at which you will lend, if matched
r
Name Type Value Description
Response format
locked number 100.0 size either in lending offers or not yet unlocked from lending offers
minRate number 1e-6 minimum rate at which your offers will lend
Payload format
Nam Valu
e Type e Description
NFTs
Rest API for NFTs on FTX.
List NFTs
Request
GET /nft/nfts
Response
{
"success": true,
"result": [
{
"id": 123456,
"name": "Rare NFT",
"description": "Rare art",
"issuer": "FTX",
"collection": "FTX rare art",
"series": "Art for charity",
"solMintAddress": "8Jntdo3RMxQyGvuRkRjFA3aJ",
"ethContractAddress": "0x014Dc156cA770baC5475186834ecd2f624C990K",
"imageUrl": "https://www.static.ftx.com/art.jpg",
"videoUrl": "https://www.static.ftx.com/art.mp4",
"attributes": null,
"redeemable": true,
"redeemed": false,
"offerPrice": 1000.00,
"auction": {
"bestBid": 120.00,
"minNextBid": 125.00,
"endTime": "2021-06-11T07:23:24.106062+00:00",
"bids": 10
}
}
]
}
Response format
auction array
auction array
Request
GET /nft/{nft_id}/trades
Request parameters
Name Type Value Description
Response
{
"success": true,
"result": [
{
"id": 490,
"price": 333.0,
"time": "2021-06-10T19:48:34.313252+00:00"
}, {
"id": 47,
"price": 350.0,
"time": "2021-06-03T14:18:40.496298+00:00"
}, {
"id": 42,
"price": 139.0,
"time": "2021-06-03T13:57:00.467274+00:00"
}
]
}
Response format
Nam
e Type Value Description
id number 42
Nam
e Type Value Description
Request
GET /nft/all_trades
Request parameters
Response
{
"success":true,
"result": [
{
"id":123,
"nft": {
"id": 123456,
"name": "Rare NFT",
"description": "Rare art",
"issuer": "FTX",
"collection": "FTX rare art",
"series": "Art for charity",
"solMintAddress": "8Jntdo3RMxQyGvuRkRjFA3aJ",
"ethContractAddress": "0x014Dc156cA770baC5475186834ecd2f624C990K",
"imageUrl": "https://www.static.ftx.com/art.jpg",
"videoUrl": "https://www.static.ftx.com/art.mp4",
"attributes": null,
"redeemable": true,
"redeemed": false,
"offerPrice": 1000.00,
"auction": {
"bestBid": 120.00,
"minNextBid": 125.00,
"endTime": "2021-06-11T07:23:24.106062+00:00",
"bids": 10
}
},
"price": 1450.0,
"time": "2021-06-09T15:39:15.364317+00:00"
}, {
"id": 124,
......
}
]
}
Response format
Request
GET /nft/balances
Response
{
"success": true,
"result": [
{
"id": 123456,
"name": "Rare NFT",
"description": "Rare art",
"issuer": "FTX",
"collection": "FTX rare art",
"series": "Art for charity",
"solMintAddress": "8Jntdo3RMxQyGvuRkRjFA3aJ",
"ethContractAddress": "0x014Dc156cA770baC5475186834ecd2f624C990K",
"imageUrl": "https://www.static.ftx.com/art.jpg",
"videoUrl": "https://www.static.ftx.com/art.mp4",
"attributes": null,
"redeemable": true,
"redeemed": false,
"offerPrice": 1000.00,
"auction": {
"bestBid": 120.00,
"minNextBid": 125.00,
"endTime": "2021-06-11T07:23:24.106062+00:00",
"bids": 10
}
}
]
}
Response format
auction array
Request
POST /nft/offer
Request parameters
Nam
e Type Value Description
Response
See /nft/{nftId}
Buy NFT
Requires authentication.
Request
POST /nft/buy
Request parameters
Nam
e Type Value Description
Response
See /nft/{nftId}
Create Auction
Requires authentication.
Request
POST /nft/auction
Request parameters
Response
See /nft/{nftId}
Edit Auction
Requires authentication.
Request
POST /nft/edit_auction
Request parameters
Name Type Value Description
Response
See /nft/{nftId}
Cancel Auction
Requires authentication.
Request
POST /nft/cancel_auction
Request parameters
Response
See /nft/{nftId}
Get bids
Requires authentication.
Request
GET /nft/bids
Response
See /nft/nfts
Place bid
Requires authentication.
Request
POST /nft/bids
Request parameters
Nam
e Type Value Description
Response
See /nft/{nftId}
Supports pagination
Request
GET /nft/deposits
Request parameters
Name Type Value Description
Response
{
"success": true,
"result": [
{
"id": 999899,
"nft": {
See /nfts,
},
"status": "confirmed",
"time": "2021-06-10T09:15:43.136561+00:00",
"sentTime": "2021-06-11T07:23:24.106062+00:00",
"confirmedTime": "2021-06-11T07:27:40.237006+00:00",
"confirmations": 8,
}, {
"id": 777877,
.....
},
]
}
Response format
id int 999899
Name Type Value Description
confirmations int 8
Supports pagination
Request
GET /nft/withdrawals
Request parameters
Name Type Value Description
Response
{
"success": true,
"result": [
{
"id": 12345,
"nft": {
See /nfts,
},
"address": "0x014Dc156cA770baC5475186834ecd2f624C990K",
"method": "erc20",
"txid": "0x8078356ae4b06a036d64747546c274af19581f1c78c510b60505798a7ffcaf1",
"fee": "20.0",
"status": "sent",
"time": "2021-06-11T07:23:24.106062+00:00",
"notes": null
}, {
"id": 45678,
.....
},
]
}
Response format
id number 12345
Name Type Value Description
Supports pagination
Request
GET /nft/fills
Request parameters
Response
{
"success": true,
"result": [
{
"id": 12345,
"nft": {
See /nfts,
},
"side": "buy",
"price": 150.0,
"fee": 7.5,
"time": "2021-06-11T07:23:24.106062+00:00"
}, {
"id": 45678,
.....
},
]
}
Response format
Name Type Value Description
id number 12345
Redeem NFT
Requires authentication.
Request
POST /nft/redeem
Request parameters
Name Type Value Description
addres string
s
notes string
Response
{
"success": true,
"result": {
"id": 12345,
"nft": {
See /nfts,
},
"time": "2021-06-11T07:23:24.106062+00:00",
"notes": null
"address": "0x014Dc156cA770baC5475186834ecd2f624C990K",
"status": "redeemed",
"supportTicketId": 1014
}
}
Response format
id numbe 12345
r
Name Type Value Description
Request
GET /nft/gallery/{gallery_id}
Request parameters
Name Type Value Description
Response
{
"success": true
"result": {
"name": "My-Awesome-NFTs",
"nfts": [
See /nfts
]
}
}
Response format
Nam
e Type Value Description
Request
GET /nft/gallery_settings
Response
{
"success": true
"result": {
"id": 888789,
"public": true
}
}
Response format
Nam
e Type Value Description
Request
POST /nft/gallery_settings
Request parameters
Nam
e Type Value Description
Latency statistics
See latency statistics for a period of
time and for one or all subaccounts.
Request
GET /stats/latency_stats?days={days}&subaccount_nickname={subaccount_nickname}
Parameters
Name Type Value Description
subaccount_nicknam str '_main Optional. Subaccount name to get stats for specific subaccount (or main).
e '
Response format
Response
{
"success": true,
"result": [
{
"bursty": true,
"p50": 0.059,
"requestCount": 43,
},
{
"bursty": false,
"p50": 0.047,
"requestCount": 27
},
]
}
Name Type Value Description
bursty boolean true Whether the orders are "bursty" (two or more orders sent from the same account
simultaneously)
p50 number 0.059 50th-percentile latency experienced by your account in the last 24 hours
Name Type Value Description
requestCount number 43 Number of orders placed by your account in the last 24 hours
Support tickets
Requires authentication.
Request
GET /support/tickets
Response
{
"success": true,
"result": [
{
"id": 42,
"title": "Support ticket for your GBP deposit",
"time": "2021-07-14T22:27:11.041873+00:00",
"category": "fiat deposit",
"status": "open",
"error": None,
"fiatDeposit": {
"id": 37,
"coin": "GBP",
"size": 12.34,
"status": "complete",
"time": "2021-07-13T22:27:11.041873+00:00",
"confirmedTime": "2021-07-13T22:27:12.041873+00:00",
"uploadedFile": None,
"uploadedFileName": None,
"cancelReason": None,
"fiat": True,
"ach": False,
"type": "bank"
},
"depositHelpRequest": None,
"autoExpireAt": None
},
{
"id": 43,
"title": "BUSD not arriving.",
"time": "2021-07-15T22:27:11.041873+00:00",
"category": "crypto deposit",
"status": "open",
"error": None,
"fiatDeposit": None,
"depositHelpRequest": {
"id": 73,
"coin": "BUSD",
"wallet": "bsc",
"txid": "0xd232f8a398c8ed84a4344ab0076a0af0735a30fab7698541bee96230274de13e",
"size": None,
"transactionTime": "2021-07-14T21:27:11.041873+00:00",
"creditedSize": None
},
"autoExpireAt": None
},
{
"id": 44,
"title": "Help",
"time": "2021-07-16T22:27:11.041873+00:00",
"category": "other",
"status": "closed",
"error": None,
"fiatDeposit": None,
"depositHelpRequest": None,
"autoExpireAt": None
}
]
}
Response format
title string "Support ticket for your GBP Support ticket title
deposit"
fiatDeposit dict None Fiat deposit this support ticket relates to; null if not a fiat
deposit ticket
depositHelpRequest dict None Deposit help request this support ticket relates to; null if
not a crypto deposit ticket
Name Type Value Description
autoExpireAt strong None Time at which the ticket expires; null by default
Requires authentication.
Request
GET /support/tickets/<int:ticket_id>/messages
Response
{
"ticket": {
"id": 44,
"title": "Help",
"time": "2021-07-16T22:27:11.041873+00:00",
"category": "other",
"status": "closed",
"error": None,
"fiatDeposit": None,
"depositHelpRequest": None,
"autoExpireAt": None
},
"messages": [
{
"id": 164,
"message": "I need help.",
"uploadedFileName": None,
"authorIsCustomer": True,
"time": "2021-07-16T22:27:11.041873+00:00"
},
{
"id": 173,
"message": "Can you elaborate?",
"uploadedFileName": None,
"authorIsCustomer": False,
"time": "2021-07-16T22:47:11.041873+00:00"
},
{
"id": 189,
"message": "I don't know where to find the FTX API documentation.",
"authorIsCustomer": True,
"time": "2021-07-16T23:27:11.041873+00:00"
},
{
"id": 191,
"message": "You can find it at https://docs.ftx.com/.",
"authorIsCustomer": False,
"time": "2021-07-16T23:29:11.041873+00:00"
},
{
"id": 201,
"message": "Great, thank you!",
"authorIsCustomer": True,
"time": "2021-07-16T23:30:11.041873+00:00"
}
]
}
Parameters
Response format
Typ
Name e Value Description
uploadedFileName string None File attached to the message; null if no such file
authorIsCustomer bool True True if the author of the message is the customer, false if
the author is one of our support team members
time string "2021-07- The time at which the message was sent
16T23:30:11.041873+00:00"
Send a support message
Send a new message to one of your
support tickets. Note that there is a
limit of 100 messages per ticket.
Requires authentication.
Request
POST /support/tickets
Content-Type: multipart/form-data
Response
{
"success": true,
"result": null
}
Payload format
message string "I need help." Initial message for your new support ticket.
fiatDepositId int None Optional. ID of the fiat deposit relating to your new support ticket.
supportFile file None Optional. Supported file formats (.png .jpg .pdf .doc .docx)
Send a support message
Send a new message to one of your
support tickets. Note that there is a
limit of 100 messages per ticket.
Requires authentication.
Request
POST /support/tickets/<int:ticket_id>/messages
Content-Type: multipart/form-data
Response
{
"success": true,
"result": null
}
Payload format
supportFil file None Optional. Supported file formats (.png .jpg .pdf .doc .docx)
e
Request
POST /support/tickets/<int:ticket_id>/status
{
"status": "closed"
}
Response
{
"success": true,
"result": null
}
Payload format
status string "closed "closed" to close an open support ticket and "open" to reopen a closed one.
"
Requires authentication.
Request
GET /support/tickets/count_unread
Response
{
"success": true,
"result": 42
}
Requires authentication.
Request
POST /support/tickets/<int:ticket_id>/mark_as_read
Response
{
"success": true,
"result": null
}
Websocket API
Streaming API with the most up-to-
date market and account order
data. With this API, you can send
messages to a server and receive
event-driven responses without
having to poll the server for a reply.
Websocket endpoint
URL: wss://ftx.com/ws/
Request process
Websocket connections go through
the following lifecycle:
Establish a websocket
connection
with wss://ftx.com/ws/
(Optional) Authenticate
with {'op': 'login', 'args':
{'key': <api_key>, 'sign':
<signature>, 'time': <ts>}}
Send pings at regular
intervals (every 15
seconds): {'op': 'ping'}. You
will see an {'type':
'pong'} response.
Subscribe to a channel
with {'op': 'subscribe',
'channel': 'trades',
'market': 'BTC-PERP'}
Receive subscription
response {'type':
'subscribed', 'channel':
'trades', 'market': 'BTC-
PERP'}
Receive data {'type':
'update', 'channel':
'trades', 'market': 'BTC-
PERP', 'data': {'id':
15884651, 'price': 5231.0,
'size': 0.07, 'side': 'sell',
'liquidation': false, 'time':
'2021-08-
12T03:03:31.656050+00:00'}}
Unsubscribe {'op':
'unsubscribe', 'channel':
'trades', 'market': 'BTC-
PERP'}
Receive unsubscription
response {'type':
'unsubscribed', 'channel':
'trades', 'market': 'BTC-
PERP'}
Request format
Messages sent to the server should
contain the following dictionary
items:
Public Channels
Ticker
The ticker channel provides the
latest best bid and offer market
data. All messages are updates
(update), and the data field contains:
- bid: Best bid price if a bid exists,
else null - ask: Best ask price if an
ask exists, else null - last: Last
trade price if it exists,
else null - time: Timestamp
Markets
The markets channel provides
information on the full set of
tradable markets and their
specifications. After subscription
and whenever any market lists,
delsists, or changes, you will receive
a partial message with information
on all markets. The data field both
types of messages will contain a list
of market information dictionaries,
each of which contains:
Orderbooks
The orderbook channel provides data
about the orderbook's best 100
orders on either side.
Initial snapshot
action: partial
bids
asks
checksum: see below
time: Timestamp
action: update
bids
asks
checksum: see below
time: Timestamp
Checksum
<best_bid_price>:<best_bid_si
ze>:<best_ask_price>:<best_as
k_size>:<second_best_bid_pric
e>:<second_best_bid_size>:...
Grouped Orderbooks
The grouped orderbooks channel
supplies orderbook data with
grouped (collapsed) prices.
Disclaimer
Messages
Private Channels
Authentication
You can log in by sending a message like so %{code}
{
"args": {
"key": "<api_key>",
"sign": "<signature>",
"time": <ts>
},
"op": "login"
}
key: your API key
time: integer current
timestamp (in milliseconds)
sign: SHA256 HMAC of the
following string, using your
API
secret: <time>websocket_login
subaccount: (optional)
subaccount name
As an example, if:
time: 1557246346499
secret: 'Y2QTHI23f23f23jfjas2
3f23To0RfUwX3H42fvN-'
sign would
be d10b5a67a1a941ae9463a60b285ae845
cdeac1b11edc7da9977bef0228b96de9
Fills
You will receive messages like so:
{
"channel": "fills",
"data": {
"fee": 78.05799225,
"feeRate": 0.0014,
"future": "BTC-PERP",
"id": 7828307,
"liquidity": "taker",
"market": "BTC-PERP",
"orderId": 38065410,
"tradeId": 19129310,
"price": 3723.75,
"side": "buy",
"size": 14.973,
"time": "2019-05-07T16:40:58.358438+00:00",
"type": "order"
},
"type": "update"
}
This channel streams your fills
across all markets. You can
subscribe to it on an authenticated
connection by sending {'op':
'subscribe', 'channel': 'fills'}.
Orders
You will receive messages like so:
{
"channel": "orders",
"data": {
"id": 24852229,
"clientId": null,
"market": "XRP-PERP",
"type": "limit",
"side": "buy",
"size": 42353.0,
"price": 0.2977,
"reduceOnly": false,
"ioc": false,
"postOnly": false,
"status": "closed",
"filledSize": 42353.0,
"remainingSize": 0.0,
"avgFillPrice": 0.2978,
"createdAt": "2021-05-02T22:40:07.217963+00:00"
},
"type": "update"
}
This channel streams updates to
your orders across all markets. You
can subscribe to it on an
authenticated connection by
sending {'op': 'subscribe',
'channel': 'orders'}.
FTX Pay
You will receive messages like so:
{
"channel": "ftxpay",
"data": {
"app": app object,
"payment": payment object,
"status": "paid"
},
"type": "update"
}
This channel streams updates for
each completed payment and each
returned payment. You can
subscribe to it on an authenticated
connection by sending {'op':
'subscribe', 'channel': 'ftxpay'}.
FIX API
FIX (Financial Information
eXchange) is a standard electronic
messaging protocol which can be
used to place orders, receive order
updates and executions, and cancel
orders. Our FIX api is based on the
FIX 4.2 specification and modeled
after FIX implementations of other
popular cryptocurrency exchanges.
Messages
8=FIX.4.2|9=162|35=A|49=zyfvB4QPg0A3kkVgqUE9V1fOA-Y6jhdG3seqIIZx|56=FTX
All messages should include the
following header:
49 SenderCompID zyfvB4QPg0A3kkVgqUE9V1fOA-Y6jhdG3seqIIZx Client API key (for messages from the client)
56 TargetCompID FTX Must be set to "FTX" (for messages from the client)
34=1|52=20190525-07:17:48
Messages should also include a
sequence number MsgSeqNum (34)
and a timestamp SendingTime (52).
Sequence numbers start at 1 and
must be incremented with every
message. Messages with duplicate
or out-of-order sequence numbers
will be rejected. Sequence numbers
are reset on new connections.
Logon (A)
Sent by the client to initiate a FIX
session. Must be the first message
sent after a connection is
established. Only one session can
be established per connection;
additional Logon messages are
rejected.
Request
8=FIX.4.2|9=162|35=A|49=zyfvB4QPg0A3kkVgqUE9V1fOA-Y6jhdG3seqIIZx|56=FTX|34=1|52=20190525-07:51:51|98=0|108=30|
96=8f7e7d37f8033ad249c1833687c230b6f4663f0dd72752899776bab9aa064783|10=237|
Tag Name Example Description
35 MsgType A
801 CancelOrdersOnDisconnect Y "Y": all account orders will be cancelled at the end of the session. "S":
3 all orders placed during the session will be cancelled at the end of the
session. Default: no orders will be cancelled.
1 Account "my_subaccount" Optional subaccount name; can be omitted if authenticating for main
account
Signature
let signTarget = [
sendingTime, // SendingTime
'A', // MsgType
'1', // MsgSeqNum
apiKey, // SenderCompID
'FTX', // TargetCompID
].join('\x01');
SendingTime (52)
MsgType (35)
MsgSeqNum (34)
SenderCompID (49)
TargetCompID (56)
Response
8=FIX.4.2|9=98|35=A|49=FTX|56=zyfvB4QPg0A3kkVgqUE9V1fOA-Y6jhdG3seqIIZx|34=1|98=0|108=30|52=20190525-07:51:51.838|10=099
Tag Name Value
35 MsgType A
98 EncryptMetho 0
d
108 HeartBInt 30
Heartbeat (0)
Sent by either side if a message has
not been received in the past 30
seconds. Should also be sent in
response to a TestRequest (1).
8=FIX.4.2|9=86|35=1|49=zyfvB4QPg0A3kkVgqUE9V1fOA-Y6jhdG3seqIIZx|56=FTX|34=2|52=20190525-07:52:24.029|10=049|
Tag Name Value Description
35 MsgType 0
112 TestReqID 123 If this heartbeat is in response to a TestRequest, copied from the TestRequest.
Test Request (1)
May be sent by either side at any
time.
8=FIX.4.2|9=112|35=1|49=zyfvB4QPg0A3kkVgqUE9V1fOA-Y6jhdG3seqIIZx|56=FTX|34=3|112=20190525-08:26:38.989|52=20190525-
08:26:38.989|10=140|
Valu
Tag Name e Description
35 MsgType 1
Logout (5)
Sent by either side to terminate the
session. The other side should
respond with another Logout
message to acknowledge session
termination. The connection will be
closed afterwards.
Ta
g Name Value
35 MsgType 5
New Order Single (D)
Sent by the client to submit a new
order. Only limit orders are currently
supported by the FIX API.
35 MsgType D
11 ClOrdID order123 Arbitrary client-selected string to identify the order; must be unique
59 TimeInForce 1 Must be set to "1" (Good Till Cancel) or "3" (Immediate or Cancel)
18 ExecInst E This parameter is optional. "E": reduce only, "6": post only, not supplied: standard
136 RejectOnPriceBand 'Y' This parameter is optional. 'Y' for rejecting the order if its price would instead be
8 adjusted due to price bands. 'N' (or omitted) otherwise.
136 RejectAfterTs 1640080635 This parameter is optional. If the order would be put into the placement queue
9 after this timestamp, instead reject it. If it would be placed on the orderbook after
the timestamp, then immediately close it instead (as if it were, for instance, a post-
only order that would have taken)
35 MsgType F
8=FIX.4.2 9=124 35=9 49=FTX 56=**** 34=1294846 52=20210908-07:18:48.023 434=1 102=0 41=cancel123 10=191
Tag Name Value Description
35 MsgType 9
35 MsgType q
53 MassCancelRequestType 7 7 for cancelling all orders on all markets, 1 for cancelling all orders on a specific
0 market
55 Symbol BTC- optional; symbol name. This field is is required if MassCancelRequestType is set to
PERP 1, and ignored otherwise
35 MsgType r
Tag Name Value Description
35 MsgType H
Tag Name Value Description
37 OrderID 123456 OrderID of the order to request, or "*" to request all pending orders
1366 FillTradeID 101293 Fill trade ID. This will be shared by the fill corresponding to the other side of
the trade.
new order:
8=FIX.4.2 9=261 35=8 49=FTX 56=**** 34=1063736 52=20210520-12:41:43.416 150=0 17=bbf0ac39-91e4-47bd-aacf-f2ff356c6891
60=20210520-16:46:47.411 37=501249457 11=order123 55=BTC-PERP 38=0.98 44=35593.0 54=1 39=0 14=0.0 151=0.98 6=0 10=081
fully filled/done:
8=FIX.4.2 9=261 35=8 49=FTX 56=**** 34=20 52=20210520-12:41:47.123 150=3 17=c9c8a56e-2159-445e-bb9d-acfeede977b2
60=20210520-12:41:47.112 37=501249457 11=order123 55=BTC-PERP 38=0.98 44=35593.0 54=2 39=3 14=0.98 151=0.0 6=35593.0
10=125
pending cancel:
8=FIX.4.2 9=251 35=8 49=FTX 56=**** 34=1063738 52=20210520-12:41:43.434 150=6 17=5f18f089-a9bc-414a-b0c2-452642e670c7
37=5012978452 11=order456 55=BTC-PERP 38=0.94000000 44=34933.0 54=1 39=6 14=0 151=0.94000000 6=0 10=055
Tag Name Value Description
35 MsgType 8
17 ExecID d840c87b-ad98-47b1-95d3- unique execution ID. Equal to Fill ID if this message was the result
4d41950fa776 of a fill
60 TransactTime 20190525-08:26:38.989 Time of the order update. Only present on order updates
31 LastPx 7999.25 Fill price. Only present if this message was the result of a fill
32 LastQty 0.4 Fill quantity. Only present if this message was the result of a fill
105 AggressorIndicator Y "Y": taker fill; "N": maker fill. Only present if this message was the
7 result of a fill
136 FillTradeID 101293 Fill trade ID. Only present if this message was the result of a fill
6
6 AvgPx 7999.25 Average fill price for all fills in order. Only present if this message
was the result of a fill
12 Commission 0.0067307233000000 Fee for trade, reported in USD. Only present if this message was
the result of a fill
Tag Name Value Description
103 OrdRejReason 3 Reason the order was rejected (see below). Only present on
rejected NewOrderSingle (D) requests
58 Text 58 Description of the reason the order was rejected (e.g., Too many
requests). Only present on rejected NewOrderSingle (D) requests
ExecType values
ExecType Description
0 New order
4 Order cancelled
OrdStatus Description
A Pending order
0 New order
4 Cancelled order
5 Resized order
6 Pending cancel
OrdRejReason values
OrdRejReaso
n Description
0 Other errors
Reject (3)
Sent by the server in response to an
invalid message.
35 MsgType 3
58 Text Missing quantity Human-readable description of the reason for the rejection
SessionRejectReaso
n Description
11 Invalid MsgType
pythonjavascriptcsharp