AscendEx
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.
| Field | Required |
|---|---|
| Access Key | Yes |
| Secret Key | Yes |
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
| Command | Arguments | Description | Returns |
|---|---|---|---|
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. |
api | method, 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 withGET /api/pro/v1/info). A non-emptyrawreplacesparamsentirely: an encoded query string forGET, the request body forPOSTandDELETE.
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
Timecomes from the exchange'screateTimefield; the endpoints behindexchange.GetOrders()andexchange.GetOrder()do not return it, soTimeis 0 there.