Last updated
Last updated
Endpoint URL:
Method:
GET
Query Parameters:
marketId
(Required) - The ID of the market you want information about.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Market Information:
The following TypeScript/Node.js script demonstrates how to call the Get Market Info API using the axios
library.
Method:
GET
Query Parameters:
marketId
(Required) - The ID of the market you want information about.
address (Required) - The wallet address for which the account balance is being fetched.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Wallet Account Balance Information:
The following TypeScript/Node.js script demonstrates how to call the Get Wallet Account Balance API using the axios
library.
Method:
GET
Query Parameters:
marketId
(Required) - The ID of the market you want information about.
address (Required) - The wallet address for which the account balance is being fetched.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Trading Account Balance Information:
The following TypeScript/Node.js script demonstrates how to call the Get Trading Account Balance API using the axios
library.
Method:
GET
Query Parameters:
amount
(Required) - The amount of the quote coin to deposit.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Depsoit a quote coin:
The following TypeScript/Node.js script demonstrates how to call the Get Deposit API using the axios
library.
Method:
GET
Query Parameters:
marketId
(Required) - The ID of the market you want to withdraw.
amount
(Required) - The amount of the quote coin to withdraw.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Depsoit a quote coin:
The following TypeScript/Node.js script demonstrates how to call the Get Withdraw API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market where the limit order will be placed.
tradeSide (Required) - Indicates the trade side:
true
for the long side.
false
for the short side.
direction (Required) - Indicates the direction of the trade:
false
to open a position.
true
to close a position.
size (Required) - The size of the order.
price (Required) - The price at which the order is to be placed.
leverage (Required) - The leverage to be used for the order.
restriction - Specifies the type of order restriction: (Default: 0
)
0
- NO_RESTRICTION
: Optionally fill as a taker, then post to the book as a maker.
1
- FILL_OR_ABORT
: Abort if any size posts as a maker (only fill).
3
- POST_OR_ABORT
: Abort if any size fills as a taker (only post).
takeProfit - The take profit value can be either a number or undefined
if not provided.
stopLoss - The stop loss value can be either a number or undefined
if not provided.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Place a limit order:
The following TypeScript/Node.js script demonstrates how to call the Get Place Limit Order API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market where the limit order will be placed.
tradeSide (Required) - Indicates the trade side:
true
for the long side.
false
for the short side.
direction (Required) - Indicates the direction of the trade:
false
to open a position.
true
to close a position.
size (Required) - The size of the order.
leverage (Required) - The leverage to be used for the order.
takeProfit - The take profit value can be either a number or undefined
if not provided.
stopLoss - The stop loss value can be either a number or undefined
if not provided.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Place a market order:
The following TypeScript/Node.js script demonstrates how to call the Get Place Market Order API using the axios
library.
Method:
POST
Request Body:
marketId: The ID of the market for which the orders will be canceled.
orderIds: A list of order IDs to cancel.
cancelTradeSides: The sides of the orders to cancel (true for long, false for short).
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Cancel multiple orders:
The following TypeScript/Node.js script demonstrates how to call the Post Cancel Multiple Orders API using the axios
library.
Method:
POST
Request Body :
marketId (Required) - The ID of the market where the orders will be placed.
orderTypes (Required) - An array of order types for each order:
true for limit orders.
false for market orders.
tradeSides (Required) - An array indicating the trade sides for each order:
true for long positions.
false for short positions.
directions (Required) - An array indicating the direction of each trade:
false to open a position.
true to close a position.
sizes (Required) - An array of sizes for each order.
leverages (Required) - An array of leverages for each order.
prices (Required) - An array of prices at which each order is to be placed.
restrictions (Optional) - An array specifying the type of order restriction for each order (Default: 0):
0 - NO_RESTRICTION: Optionally fill as a taker, then post to the book as a maker.
1 - FILL_OR_ABORT: Abort if any size posts as a maker (only fill).
3 - POST_OR_ABORT: Abort if any size fills as a taker (only post).
takeProfit - The take profit value can be either a number or undefined
if not provided.
stopLoss - The stop loss value can be either a number or undefined
if not provided.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Place a multiple orders:
The following TypeScript/Node.js script demonstrates how to call the Get Place Multiple Orders API using the axios
library.
Method:
POST
Request Body :
marketId (Required) - The ID of the market where the orders will be placed.
orderIds (Required) - An array of strings representing the IDs of the orders to be canceled.
cancelTradeSides (Required) - An array indicating the sides of the orders being canceled:
true
for long sides.
false
for short sides.
orderTypes (Required) - An array of order types for each order:
true for limit orders.
false for market orders.
orderTradeSides (Required) - An array indicating the trade sides for each order:
true for long positions.
false for short positions.
directions (Required) - An array indicating the direction of each trade:
false to open a position.
true to close a position.
sizes (Required) - An array of sizes for each order.
leverages (Required) - An array of leverages for each order.
prices (Required) - An array of prices at which each order is to be placed.
restrictions (Optional) - An array specifying the type of order restriction for each order (Default: 0):
0 - NO_RESTRICTION: Optionally fill as a taker, then post to the book as a maker.
1 - FILL_OR_ABORT: Abort if any size posts as a maker (only fill).
3 - POST_OR_ABORT: Abort if any size fills as a taker (only post).
takeProfit - The take profit value can be either a number or undefined
if not provided.
stopLoss - The stop loss value can be either a number or undefined
if not provided.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to cancel and Place a multiple orders:
The following TypeScript/Node.js script demonstrates how to call the Get Cancel And Place Multiple Orders API using the axios
library.
Method:
GET
Query Parameters:
address (Required) - The wallet address to retrieve open orders for.
marketId (Required) - The ID of the market to filter open orders.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Open Orders:
The following TypeScript/Node.js script demonstrates how to call the Get Open Orders API using the axios
library.
Method:
GET
Query Parameters:
address (Required) - The wallet address to retrieve the order history for.
type (Required) - The type of orders to fetch. Options include:
'limit'
for limit orders.
'market'
for market orders.
'all'
for both limit and market orders.
marketId (Required) - The ID of the market to filter the order history.
offset (Optional) - The number of records to skip for pagination (default is 0
if not provided).
limit (Optional) - The maximum number of records to retrieve (default is 10
if not provided).
order (Optional) - The sorting order for the results. Options:
'asc'
for ascending order.
'desc'
for descending order.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Order History:
The following TypeScript/Node.js script demonstrates how to call the Get Order History API using the axios
library.
Method:
GET
Query Parameters:
address (Required) - The wallet address of the user to view positions for.
marketId (Required) - The ID of the market to filter the positions.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Open Position:
The following TypeScript/Node.js script demonstrates how to call the Get Open Position API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market to retrieve all trades information.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Open Position:
The following TypeScript/Node.js script demonstrates how to call the Get Open Position API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market associated with the order.
orderId (Required) - The unique identifier of the order to retrieve its status.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Order Status B Order Id:
The following TypeScript/Node.js script demonstrates how to call the Get Order Status By Order Id API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market for which fills are retrieved.
address (Optional) - The address of the user to filter fills (if applicable).
from (Required) - The start time of the range in ISO 8601 format (e.g., 2024-11-21T00:00:00Z
).
to (Required) - The end time of the range in ISO 8601 format (e.g., 2024-11-21T23:59:59Z
).
orderId (Required) - The unique identifier of the order to retrieve its status.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Order Status B Order IdFills Data:
The following TypeScript/Node.js script demonstrates how to call the Get Fills Data API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market for which the price information is being retrieved.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Market Price:
The following TypeScript/Node.js script demonstrates how to call the Get Market Price API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market for which the last execution price information is being retrieved.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Last Execution Price:
The following TypeScript/Node.js script demonstrates how to call the Get Last Execution Price API using the axios
library.
Method:
GET
Query Parameters:
address (Required) - The address associated with the orders.
marketId (Required) - The ID of the market for which open order IDs are being retrieved.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Open Order Ids:
The following TypeScript/Node.js script demonstrates how to call the Get Open Order Ids API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market for which the take profit values will be updated.
tradeSide (Required) - The trade side:
true
for the long side.
false
for the short side.
newTakeProfitPrice (Required) - The new take profit price to be set for the trade.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Update take profit price:
The following TypeScript/Node.js script demonstrates how to call the Get Update Take Profit Price API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market for which the account's balance is being retrieved.
address (Required) - The address of the account whose balance will be
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Fetch Wallet Account Aptos Balance Information:
The following TypeScript/Node.js script demonstrates how to call the Get Wallet Account Aptos Balance API using the axios
library.
Method:
GET
Query Parameters:
marketId (Required) - The ID of the market for which the take profit values will be updated.
tradeSide (Required) - The trade side:
true
for the long side.
false
for the short side.
newStopLossPrice (Required) - The new stop loss price to be set for the trade.
Example Request:
Example Response:
Status Code: 200 OK
Response Body:
Example Code to Update stop loss price:
The following TypeScript/Node.js script demonstrates how to call the Get Update Stop Loss Price API using the axios
library.
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL:
Endpoint URL: