For the complete documentation index, see llms.txt. This page is also available as Markdown.

REST API

REST API for Astros

Base URL: https://api.astros.ag

Unless noted otherwise, private endpoints require:

Header
Required
Description

APIKEY

Yes

Your API key

signature

Yes

HMAC-SHA256 of the string to sign

Complete request walkthrough

Example: create a market order.

  1. Endpoint: POST /api/third/hot/order/create

  2. Build parameters, then sort by key:

clientOrderId=1711176054830&isLong=false&isMarket=true&lever=20&matchType=2&pairName=ETH-USD&positionType=3&price=3500&quantity=0.2&timestamp=1711176054830
  1. Sign with HMAC-SHA256 → lowercase hex.

  2. Send the request:

curl --location --request POST \
  'https://api.astros.ag/api/third/hot/order/create?clientOrderId=1711176054830&isLong=false&isMarket=true&lever=20&matchType=2&pairName=ETH-USD&positionType=3&price=3500&quantity=0.2&timestamp=1711176054830' \
  --header 'APIKEY: xx' \
  --header 'signature: bf95dc1b92b4e5b334fbd7a55138163a90df8d862d7ec74981afc017552ff631' \
  --header 'Content-Type: text/plain' \
  --data ''
  1. Response:


Order operations

Private write endpoints.

Create order

POST /api/third/hot/order/create

Content-Type: application/x-www-form-urlencoded Signature required: Yes

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair, e.g. ETH-USD

isLong

Boolean

Yes

true long, false short

isMarket

Boolean

Yes

true market, false limit

matchType

Number

Yes

Match type

price

String / Number

Yes

Order price (required for limits; still sent for markets)

quantity

String / Number

Yes

Order size

lever

Number

Yes

Leverage

positionType

Number

Yes

Position mode / type

clientOrderId

String

Yes

Client order id

timestamp

Number

Yes

Unix time in milliseconds

Example

Batch create orders

POST /api/third/hot/order/batchCreate

Content-Type: application/json Signature required: Yes (sign the exact JSON body)

Request body

Name
Type
Required
Description

orders

Array

Yes

Order objects (same fields as create order)

timestamp

Number / String

Yes

Unix time in milliseconds

Example

String to sign (no spaces):

Batch create orders with per-order results

POST /api/third/hot/order/batchCreateWithRes

Content-Type: application/json Signature required: Yes

Same request shape as batch create. Response returns a result per order.

Cancel order

POST /api/third/order/cancelEntrust

Content-Type: application/x-www-form-urlencoded Signature required: Yes

Parameters

Name
Type
Required
Description

entrustId

Number

Yes

Exchange order id

timestamp

Number

Yes

Unix time in milliseconds

Example

Cancel order by client order id

POST /api/third/order/cancelEntrustByCli

Content-Type: application/x-www-form-urlencoded Signature required: Yes

Parameters

Name
Type
Required
Description

clientOrderId

String

Yes

Client order id

timestamp

Number

Yes

Unix time in milliseconds

Batch cancel orders

POST /api/third/order/batchCancelEntrust

Cancels orders one by one and stops on the first failure.

Parameters

Name
Type
Required
Description

entrustIds

String

Yes

Comma-separated order ids

timestamp

Number

Yes

Unix time in milliseconds

Batch cancel orders with results

POST /api/third/order/batchCancelWithRes

Cancels orders one by one, skips failures, and returns a result per id.


Position operations

Add or reduce margin

POST /api/third/order/callMarginAmount

Content-Type: application/x-www-form-urlencoded Signature required: Yes

Parameters

Name
Type
Required
Description

positionId

Number

Yes

Position id

call

Boolean

Yes

true add margin, false reduce

marginAmount

String / Number

Yes

Margin delta

timestamp

Number

Yes

Unix time in milliseconds

Example

Set user leverage

POST /api/third/v1/trade/setUserLever

Content-Type: application/json Signature required: Yes

Request body

Name
Type
Required
Description

contractPairId

Number

Yes

Pair id

lever

Number

Yes

Leverage

positionType

Number

Yes

Position type

timestamp

Number

Yes

Unix time in milliseconds


Account, order, position, and trade queries

Private read endpoints.

Query account balance

POST /api/third/hot/order/balance

Parameters

Name
Type
Required
Description

symbol

String

Yes

Settlement coin, e.g. USD

timestamp

Number

Yes

Unix time in milliseconds

Query current open orders

POST /api/third/order/selectContractCurrentEntrustList

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

pageNo

Number

No

Optional. Uses the API default page number

pageSize

Number

No

Optional. Uses the API default page size; maximum 100

timestamp

Number

Yes

Unix time in milliseconds

Query order by id

POST /api/third/order/queryOrder

Query a current or completed order by exchange order id.

Parameters

Name
Type
Required
Description

entrustId

Number

Yes

Exchange order id

timestamp

Number

Yes

Unix time in milliseconds

Query match / fill list

POST /api/third/order/selectContractMatchPairList

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

pageNo

Number

No

Optional. Uses the API default page number

pageSize

Number

No

Optional. Uses the API default page size; maximum 100

matchId

Number

No

Cursor / filter match id

timestamp

Number

Yes

Unix time in milliseconds

Query position list

POST /api/third/hot/order/selectContractPositionList

Parameters

Name
Type
Required
Description

pairName

String

No

Trading pair. Omit for all pairs

pageNo

Number

No

Optional. Uses the API default page number

pageSize

Number

No

Optional. Uses the API default page size; maximum 100

timestamp

Number

Yes

Unix time in milliseconds

Get trade history

GET /api/third/v1/trade/fillHistory

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

timestamp

Number

Yes

Unix time in milliseconds

orderId

Number

No

Filter by order id

limit

Number

No

Max rows

idLe

Number

No

Return ids ≤ this value

idGe

Number

No

Return ids ≥ this value

beginTime

Number

No

Start time (ms)

endTime

Number

No

End time (ms)

isAsc

Boolean

No

Ascending id order

Get maker earning trade history

GET /api/third/v1/rebates/maker/earnings/trade

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

timestamp

Number

Yes

Unix time in milliseconds

beginTime

Number

No

Start time (ms)

endTime

Number

No

End time (ms)

idLe

Number

No

Cursor

limit

Number

No

Max rows

Get maker earning info

GET /api/third/v1/rebates/maker/earningsInfo

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

timestamp

Number

Yes

Unix time in milliseconds

idLe

Number

No

Cursor

limit

Number

No

Max rows

Query order history

GET /api/third/v1/orders/histories

Parameters

Name
Type
Required
Description

symbol

String

Yes

Trading pair

timestamp

Number

Yes

Unix time in milliseconds

beginTime

Number

No

Start time (ms)

limit

Number

No

Max rows

Get user leverage

GET /api/third/v1/trade/getUserLever

Parameters

Name
Type
Required
Description

contractPairId

Number

Yes

Pair id

timestamp

Number

Yes

Unix time in milliseconds

Query trade config list

POST /api/third/hot/order/tradeConfigList

Parameters

Name
Type
Required
Description

timestamp

Number

Yes

Unix time in milliseconds

Query funding / tariff history

POST /api/third/hot/order/selectContractTariffList

Parameters

Name
Type
Required
Description

pairName

String

No

Trading pair. Omit for all pairs

pageNo

Number

No

Optional. Uses the API default page number

pageSize

Number

No

Optional. Uses the API default page size; maximum 100

timestamp

Number

Yes

Unix time in milliseconds


Public queries

No API key required unless noted.

System time

GET /api/third/info/time

Index price

GET /api/third/info/indexPrice

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

Mark price

GET /api/third/info/markPrice

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

Last trades

GET /api/third/info/trades

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

limit

Number

No

Max rows

Pair list

GET /api/third/info/pairs

Order book depth

GET /api/third/info/depth

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

limit

Number

No

Depth levels

Kline

GET /api/third/info/kline

Returns candles in reverse chronological order.

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

period

String

Yes

e.g. 1MIN

limit

Number

No

Max candles

endTime

Number

No

End time (ms)

Historical funding rates

GET /api/third/v1/market/funding/history

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

beginTime

Number

No

Start time (ms)

endTime

Number

No

End time (ms)

idLe

Number

No

Cursor

limit

Number

No

Max rows

Current funding rate

GET /api/third/v1/market/funding/current

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

24h ticker

GET /api/third/info/ticker/24hr

Parameters

Name
Type
Required
Description

pairName

String

Yes

Trading pair

Open interest

GET /api/third/info/oi

Parameters

Name
Type
Required
Description

pairName

String

No

Trading pair. Omit for all pairs if supported

Last updated