Skip to main content

Figure Markets High Frequency Trading Exchange Trader API (1.0)

Download OpenAPI specification:Download

Orders

Cancel an order

Authorizations:
TraderAuth
path Parameters
orderId
required
string

Responses

Response samples

Content type
application/json
{
  • "symbol": "string",
  • "marketId": "string",
  • "marketDisplayName": "string",
  • "denom": "string",
  • "priceDenom": "string",
  • "orderId": "string",
  • "quantity": "string",
  • "price": "string",
  • "direction": "UNKNOWN_DIRECTION",
  • "orderType": "UNKNOWN_ORDER_TYPE",
  • "clientOrderId": "string",
  • "remainingQuantity": "string",
  • "filledQuantity": "string",
  • "state": "UNKNOWN_ORDER_STATE",
  • "created": "2019-08-24T14:15:22Z",
  • "expiration": "2019-08-24T14:15:22Z",
  • "feeTotal": "string",
  • "executionType": "ALLOW_TAKER",
  • "failureReason": "string",
  • "stopPrice": "string",
  • "timeInForce": "DAY",
  • "cashOrderQty": "string",
  • "totalFilledValue": "string",
  • "maxFeeTotal": 0,
  • "feeBasisPoints": 0
}

Creates a new order

Restricted to YLDS stablecoin markets only. Please use the low-latency trading endpoint for other markets.

Authorizations:
TraderAuth
path Parameters
symbol
required
string

Market id

Request Body schema: application/json
required
quantity
number > 0

A quantity must be provided for non market orders

direction
required
string (Direction)
Enum: "UNKNOWN_DIRECTION" "ASK" "BID"
orderType
required
string (OrderType)
Enum: "UNKNOWN_ORDER_TYPE" "LIMIT" "STOP_LIMIT" "MARKET"
price
number > 0
stopPrice
number
clientOrderId
required
string <uuid>
expiration
string <date-time>
executionType
string (OrderExecutionType)
Enum: "ALLOW_TAKER" "MAKER_ONLY"
timeInForce
string (TimeInForce)
Enum: "DAY" "IMMEDIATE_OR_CANCEL" "GOOD_TILL_TIME" "GOOD_TILL_CANCEL" "FILL_OR_KILL" "TIME_IN_FORCE_GOOD_TILL_CANCEL" "TIME_IN_FORCE_FILL_OR_KILL"

Use 'GOOD_TILL_CANCEL' and 'FILL_OR_KILL' instead of 'TIME_IN_FORCE_GOOD_TILL_CANCEL' and 'TIME_IN_FORCE_FILL_OR_KILL'

cashOrderQty
number > 0

Total value of a market order

shortSell
required
boolean

Responses

Request samples

Content type
application/json
{
  • "quantity": 0,
  • "direction": "UNKNOWN_DIRECTION",
  • "orderType": "UNKNOWN_ORDER_TYPE",
  • "price": 0,
  • "stopPrice": 0,
  • "clientOrderId": "2af8d1c2-f2bf-4061-b3ad-acd950a272bb",
  • "expiration": "2019-08-24T14:15:22Z",
  • "executionType": "ALLOW_TAKER",
  • "timeInForce": "DAY",
  • "cashOrderQty": 0,
  • "shortSell": true
}

Response samples

Content type
application/json
{
  • "symbol": "string",
  • "marketId": "string",
  • "marketDisplayName": "string",
  • "denom": "string",
  • "priceDenom": "string",
  • "orderId": "string",
  • "quantity": "string",
  • "price": "string",
  • "direction": "UNKNOWN_DIRECTION",
  • "orderType": "UNKNOWN_ORDER_TYPE",
  • "clientOrderId": "string",
  • "remainingQuantity": "string",
  • "filledQuantity": "string",
  • "state": "UNKNOWN_ORDER_STATE",
  • "created": "2019-08-24T14:15:22Z",
  • "expiration": "2019-08-24T14:15:22Z",
  • "feeTotal": "string",
  • "executionType": "ALLOW_TAKER",
  • "failureReason": "string",
  • "stopPrice": "string",
  • "timeInForce": "DAY",
  • "cashOrderQty": "string",
  • "totalFilledValue": "string",
  • "maxFeeTotal": 0,
  • "feeBasisPoints": 0
}

Estimate fees for a proposed order

Authorizations:
TraderAuth
path Parameters
marketId
required
string

Market id

Request Body schema: application/json
required
quantity
number > 0

A quantity must be provided for non market orders

direction
required
string (Direction)
Enum: "UNKNOWN_DIRECTION" "ASK" "BID"
orderType
required
string (OrderType)
Enum: "UNKNOWN_ORDER_TYPE" "LIMIT" "STOP_LIMIT" "MARKET"
price
number > 0
stopPrice
number
clientOrderId
required
string <uuid>
expiration
string <date-time>
executionType
string (OrderExecutionType)
Enum: "ALLOW_TAKER" "MAKER_ONLY"
timeInForce
string (TimeInForce)
Enum: "DAY" "IMMEDIATE_OR_CANCEL" "GOOD_TILL_TIME" "GOOD_TILL_CANCEL" "FILL_OR_KILL" "TIME_IN_FORCE_GOOD_TILL_CANCEL" "TIME_IN_FORCE_FILL_OR_KILL"

Use 'GOOD_TILL_CANCEL' and 'FILL_OR_KILL' instead of 'TIME_IN_FORCE_GOOD_TILL_CANCEL' and 'TIME_IN_FORCE_FILL_OR_KILL'

cashOrderQty
number > 0

Total value of a market order

shortSell
required
boolean
buyNowLimit
number

When estimating for a buy now order, this should be the ACH/Debit limit. maxCashOrderQty will be based on this instead of current account balances.

Responses

Request samples

Content type
application/json
{
  • "quantity": 0,
  • "direction": "UNKNOWN_DIRECTION",
  • "orderType": "UNKNOWN_ORDER_TYPE",
  • "price": 0,
  • "stopPrice": 0,
  • "clientOrderId": "2af8d1c2-f2bf-4061-b3ad-acd950a272bb",
  • "expiration": "2019-08-24T14:15:22Z",
  • "executionType": "ALLOW_TAKER",
  • "timeInForce": "DAY",
  • "cashOrderQty": 0,
  • "shortSell": true,
  • "buyNowLimit": 0
}

Response samples

Content type
application/json
{
  • "marketId": "string",
  • "quantity": 0,
  • "price": 0,
  • "cashOrderQty": 0,
  • "estimatedFee": 0,
  • "basisPoints": 0,
  • "makerBasisPoints": 0,
  • "minCashOrderQty": 0,
  • "maxCashOrderQty": 0
}

Cancel all open orders

Authorizations:
TraderAuth
Request Body schema: application/json
required
marketId
string (Market id)
baseAsset
string

Base asset for all markets to cancel orders on

Responses

Request samples

Content type
application/json
{
  • "marketId": "string",
  • "baseAsset": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

Get orders

Authorizations:
TraderAuth
query Parameters
symbol
string
Deprecated

Market id

marketId
string
type
string (OrderType)
Enum: "UNKNOWN_ORDER_TYPE" "LIMIT" "STOP_LIMIT" "MARKET"
direction
string (Direction)
Enum: "UNKNOWN_DIRECTION" "ASK" "BID"
status
Array of strings (OrderState)
Items Enum: "UNKNOWN_ORDER_STATE" "NEW" "PARTIALLY_FILLED" "FILLED" "CANCELED" "REPLACED" "REJECTED" "EXPIRED" "PENDING_NEW" "PENDING_REPLACE" "PENDING_CANCEL" "PENDING_RISK"
size
integer <int32> [ 1 .. 100 ]
token
string

pagination token

baseAsset
string

Search by markets with base asset

startTime
string <date-time>
endTime
string <date-time>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "nextPageToken": "string",
  • "totalCount": 0
}

Get order

Authorizations:
TraderAuth
path Parameters
orderId
required
string

Responses

Response samples

Content type
application/json
{
  • "symbol": "string",
  • "marketId": "string",
  • "marketDisplayName": "string",
  • "denom": "string",
  • "priceDenom": "string",
  • "orderId": "string",
  • "quantity": "string",
  • "price": "string",
  • "direction": "UNKNOWN_DIRECTION",
  • "orderType": "UNKNOWN_ORDER_TYPE",
  • "clientOrderId": "string",
  • "remainingQuantity": "string",
  • "filledQuantity": "string",
  • "state": "UNKNOWN_ORDER_STATE",
  • "created": "2019-08-24T14:15:22Z",
  • "expiration": "2019-08-24T14:15:22Z",
  • "feeTotal": "string",
  • "executionType": "ALLOW_TAKER",
  • "failureReason": "string",
  • "stopPrice": "string",
  • "timeInForce": "DAY",
  • "cashOrderQty": "string",
  • "totalFilledValue": "string",
  • "maxFeeTotal": 0,
  • "feeBasisPoints": 0
}

Get all fills (matches) for the order and the user

Authorizations:
TraderAuth
path Parameters
orderId
required
string
query Parameters
state
Array of strings (TradeState)
Items Enum: "UNKNOWN_TRADE_STATE" "NEW" "CLEARED" "BUSTED" "INFLIGHT" "PENDING_RISK" "PENDING_CLEARED" "REJECTED" "CLEARING_ACKNOWLEDGED" "RETRY_REQUEST"
token
string

pagination token

size
integer <int32> [ 1 .. 200 ]
Default: 20
sort
string (SortOrder)
Enum: "ASC" "DESC"

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "nextPageToken": "string",
  • "totalCount": 0
}

Get all fills (matches) for the user

Authorizations:
TraderAuth
query Parameters
symbol
string
direction
string (Direction)
Enum: "UNKNOWN_DIRECTION" "ASK" "BID"
state
Array of strings (TradeState)
Items Enum: "UNKNOWN_TRADE_STATE" "NEW" "CLEARED" "BUSTED" "INFLIGHT" "PENDING_RISK" "PENDING_CLEARED" "REJECTED" "CLEARING_ACKNOWLEDGED" "RETRY_REQUEST"
token
string

pagination token

size
integer <int32> [ 1 .. 200 ]
Default: 20
sort
string (SortOrder)
Enum: "ASC" "DESC"

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "nextPageToken": "string",
  • "totalCount": 0
}

Margin Trading

Make a loan payment

Authorizations:
TraderAuth
Request Body schema: application/json
required
id
required
string <uuid>

Client generated unique payment id

leveragePoolId
required
string <uuid>
amount
required
number

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "leveragePoolId": "3229a80e-6400-4afe-a15e-c4b4652ff574",
  • "amount": 0
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "asset": "string",
  • "leveragePoolId": "3229a80e-6400-4afe-a15e-c4b4652ff574",
  • "amount": 0,
  • "status": "PENDING"
}

Take out a new loan

Authorizations:
TraderAuth
Request Body schema: application/json
required
id
required
string <uuid>

Client generated unique loan id

amount
required
number > 0
leveragePoolId
required
string <uuid>
loanType
required
string (LoanType)
Default: "MARGIN"
Enum: "MARGIN" "OFF_PLATFORM_MARGIN"

Type of loan to create

object (WithdrawRequest)

Optional MPC withdraw request for off platform loan

object (FiatWithdrawRequest)

Optional fiat withdraw request for off platform loan

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "amount": 0,
  • "leveragePoolId": "3229a80e-6400-4afe-a15e-c4b4652ff574",
  • "loanType": "MARGIN",
  • "withdrawRequest": {
    },
  • "fiatWithdrawRequest": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "rate": {
    }
}

Fetch a loan payment

Authorizations:
TraderAuth
path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "asset": "string",
  • "leveragePoolId": "3229a80e-6400-4afe-a15e-c4b4652ff574",
  • "amount": 0,
  • "status": "PENDING"
}

Transfers

Gets a list of historical transfers for the current wallet

Authorizations:
TraderAuth
query Parameters
actions
Array of strings (TransferAction)
Items Enum: "DEPOSIT" "WITHDRAW" "INTEREST" "REFUND" "RETURN" "REWARD" "ISSUANCE" "RECEIVE_YLDS_PAYMENT" "P2P" "CBL_DISBURSEMENT" "CBL_PAYMENT" "REPAYMENT_TRANSFER" "MARGIN" "NMS_SEND" "NMS_RECEIVE" "SEND" "RECEIVE" "SEND_COLLATERAL" "RECEIVE_COLLATERAL"
status
Array of strings (TransferHistoryStatus)
Items Enum: "PENDING" "TRANSFER_PENDING" "TRANSFER_AWAITING_EXECUTION" "TRANSFER_EXECUTED" "COMPLETE" "ERROR" "CANCELED" "INVITATION_ACCEPTANCE_PENDING" "PENDING_CANCELED" "UNKNOWN" "DECLINED" "REVIEW"
statusToExclude
Array of strings (TransferHistoryStatus)
Items Enum: "PENDING" "TRANSFER_PENDING" "TRANSFER_AWAITING_EXECUTION" "TRANSFER_EXECUTED" "COMPLETE" "ERROR" "CANCELED" "INVITATION_ACCEPTANCE_PENDING" "PENDING_CANCELED" "UNKNOWN" "DECLINED" "REVIEW"
assets
Array of strings
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Borrowers

Get paginated loan history

Authorizations:
TraderAuth
query Parameters
size
integer <int32> [ 1 .. 50 ]
Default: 20
page
integer <int32> >= 1
Default: 1
period
string (PeriodSpan)
Enum: "HOUR" "DAY" "WEEK" "MONTH" "YEAR"
leverage_pool_uuid
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get loan history summary

Authorizations:
TraderAuth
query Parameters
leverage_pool_uuid
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "leveragePoolId": "3229a80e-6400-4afe-a15e-c4b4652ff574",
  • "denomTypeCode": "string",
  • "startDate": "2019-08-24T14:15:22Z",
  • "interestRateRange": {
    },
  • "interestPaid": 0
}

Get outstanding loan balances

Authorizations:
TraderAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "ltv": 0,
  • "status": "HEALTHY",
  • "collateralValue": 0,
  • "loansValue": 0
}

Get past liquidations

Authorizations:
TraderAuth
query Parameters
size
integer <int32> [ 1 .. 100 ]
Default: 20
page
integer <int32> >= 1
Default: 1

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Accounts

Get portfolio balances for the account

Authorizations:
TraderAuth

Responses

Response samples

Content type
application/json
{
  • "totalValue": 0,
  • "assets": [
    ],
  • "loans": [
    ],
  • "offers": [
    ],
  • "smartContractLendingBalances": [
    ],
  • "cryptoBackedLoans": [
    ]
}

Get portfolio balance history for the account

Returns the most recent count days of historical portfolio balances for the account.The time range is determined by the most recent daily snapshot, or the current time if no snapshot is in range.

Authorizations:
TraderAuth
query Parameters
period
string (Period between data points)
Default: "P1D"

In ISO 8601 duration format

count
integer
Default: 7

The number of periods to go back in time.

includeCurrent
boolean (Include the current balance in addition to the historical balances)
Default: true
endTime
string (The last time to retrieve)

Defaults to now. Typically when set, includeCurrent will be set to "false"

Responses

Response samples

Content type
application/json
{
  • "totalValue": 0,
  • "totalValue24h": 0,
  • "history": [
    ],
  • "balances24h": {
    }
}

Get market data for a specific asset

Returns the latest market data for the specified asset.

Authorizations:
TraderAuth
path Parameters
assetId
required
string

Responses

Response samples

Content type
application/json
{
  • "averageOpen": 0,
  • "averageClose": 0,
  • "netBalance": 0,
  • "unrealizedPL": 0
}