Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
AscendEx
Backpack
BigONE
Binance
Bitfinex
bitFlyer
Bitget
Bithumb
Bitstamp
Bybit
Coincheck
Coinone
CoinW
Crypto.com
DeepCoin
Deribit
DigiFinex
Gate
Gemini
HashKey
HitBTC
HTX
Korbit
Kraken
KuCoin
LBank
MEXC
OKX
Poloniex
Upbit
WEEX
WOO X
Zaif
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Spot trading on AscendEX (formerly BitMax); only spot pairs are served. The account has a cash wallet (the default) and a margin wallet, switched with exchange.IO("trade_margin") and exchange.IO("trade_normal"); after switching, account, order placement and order queries use that wallet's endpoints. Access uses an API Key and Secret Key.

Names and Configuration

exchange.GetName(): AscendEx (Spot); aliases: AscendEX, BitMax.

FieldRequired
Access KeyYes
Secret KeyYes

Trading Pairs and Contract Codes

Pair examples: BTC_USDT, ETH_USDT

Trading pairs are written BASE_QUOTE, matching the AscendEx native code BTC/USDT.

Exchange-specific IO Commands
CommandArgumentsDescriptionReturns
trade_margin—Switch to the margin wallet. Account, order placement, cancellation, order queries, open and historical orders and exchange.GetMarkets() then use the margin wallet endpoints; exchange.GetTickers() fails on the margin wallet. Kept locally; no request is sent to the exchange.The command name itself.
trade_normal—Switch back to the cash wallet (the default).The command name itself.
apimethod, path[, params[, raw]]Call an AscendEX endpoint directly; requests are signed by default. (more below the table)The full exchange response (including code); an error is raised when code is not 0.

The rest of the longer descriptions in the table:

  • api: The signature covers only the timestamp and the endpoint name, and the path of a signed request must contain /api/pro; private endpoints need the account group prefix in the path, such as /<accountGroup>/api/pro/v1/cash/balance (the account group can be read with GET /api/pro/v1/info). A non-empty raw replaces params entirely: an encoded query string for GET, the request body for POST and DELETE.

For the common commands base and currency see exchange.IO.

Common Usage
Look up the account group, then call private endpoints
javascript
function main() { // Paths of private endpoints need the account group prefix var info = exchange.IO("api", "GET", "/api/pro/v1/info") var group = info.data.accountGroup // The whole reply (with code) is returned var bal = exchange.IO("api", "GET", "/" + group + "/api/pro/v1/cash/balance") Log(bal.data) var path = "/" + group + "/api/pro/v1/cash/order/open" var orders = exchange.IO("api", "GET", path, "symbol=BTC/USDT") Log(orders.data) }

Function Support

Not supported (the call fails with an error and returns null): exchange.ModifyOrder, exchange.CreateConditionOrder, exchange.ModifyConditionOrder, exchange.CancelConditionOrder, exchange.GetConditionOrder, exchange.GetConditionOrders, exchange.GetHistoryConditionOrders.

Served through a fallback:

  • exchange.GetRecords: Native periods are 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 1w, 1M; other periods are synthesized by the docker.

Notes
  • The exchange has ceased operation.
  • The amount of a spot market buy order is in the base currency, not a quote-currency amount.
  • The order Time comes from the exchange's createTime field; the endpoints behind exchange.GetOrders() and exchange.GetOrder() do not return it, so Time is 0 there.