WOO X
WOO (Spot): WOO X spot trading over the WOO X REST API (api.woox.io), with native take-profit, stop-loss and OCO conditional orders. The API KEY configuration needs the Access Key, Secret Key and Application Id. The account can be switched between margin mode and pure spot mode with exchange.IO("trade_margin") and exchange.IO("trade_normal"); use Futures_WOO for perpetual contracts.
Futures_WOO (Futures): WOO X perpetual contracts over the WOO X REST API (api.woox.io), with no delivery contracts; native take-profit, stop-loss and OCO conditional orders are supported. The API KEY configuration needs the Access Key, Secret Key and Application Id (all three must be filled in).
Names and Configuration
exchange.GetName() | Type | Aliases |
|---|---|---|
WOO | Spot | WOOX |
Futures_WOO | Futures | — |
✓ marks the exchange objects that have the field.
| Field | WOO | Futures_WOO | Required | Description |
|---|---|---|---|---|
| Access Key | ✓ | ✓ | Yes | — |
| Secret Key | ✓ | ✓ | Yes | — |
| Application Id | ✓ | Yes | The Application ID of the API KEY shown on the WOO X API management page, used to check that balance responses belong to this account; required. | |
| Application Id | ✓ | Yes | The Application ID of the API KEY shown on the WOO X API management page, used to check that account responses belong to this account; required. |
Trading Pairs and Contract Codes
WOO (Spot)
Pair examples: BTC_USDT, ETH_USDT
Trading pairs are written BTC_USDT, matching the WOO X native code SPOT_BTC_USDT. This exchange object trades spot only; symbols with a contract suffix (such as BTC_USDT.swap) are rejected; use Futures_WOO for perpetual contracts.
Futures_WOO (Futures)
Pair examples: BTC_USDT
Trading pairs are written BTC_USDT, matching the WOO X native code PERP_BTC_USDT.
| Contract code | Description |
|---|---|
swap | Perpetual contract. |
WOO X lists perpetual contracts only; other contract codes are rejected. Order amounts are in the base currency (CtVal is 1 in exchange.GetMarkets()).
Exchange-specific IO Commands
WOO (Spot)
| Command | Arguments | Description |
|---|---|---|
trade_margin | — | Switches the account to margin mode (MARGIN) by sending a settings request to the exchange (POST /v1/client/account_mode); returns true once the exchange confirms. This is an account-level setting. |
trade_normal | — | Switches the account to pure spot mode (PURE_SPOT) by sending a settings request to the exchange; returns true once the exchange confirms. This is an account-level setting. |
api | method, path[, params[, raw]] | Call a WOO X endpoint directly; path may be a full URL. (more below the table) |
The rest of the longer descriptions in the table:
api: The signing rule follows/v1/or/v3/in the path;GETparameters go into the query string, other methods send a form body for v1 and a JSON body for v3. Paths containing/public/are unsigned by default and all others signed; the sign argument can set it explicitly, and unsigned requests are also sent with the given HTTP method.rawis not a request body but a parameter table (a JSON object) that replacesparamsentirely when non-empty and is signed as usual; for v3 JSON bodies its object, array, number and boolean values are kept as they are. Spot and futures behave the same for this command. Returns: The whole exchange response (datais not unwrapped for either v1 or v3 endpoints); an error is raised when the responsesuccessis nottrue.
For the common commands base and currency see exchange.IO.
Futures_WOO (Futures)
| Command | Arguments | Description |
|---|---|---|
cross | bool | Cross (true) / isolated (false) margin. Only changes the local setting without sending a request; subsequent orders, conditional orders and exchange.SetMarginLevel() carry it. Cross margin by default. |
dual | bool | Hedge (true) / one-way (false) position mode, sent to the exchange (POST /v1/client/position_mode); after it succeeds the connector places orders for hedge mode (both regular and conditional orders carry the position side). |
api | method, path[, params[, raw]] | Call a WOO X endpoint directly; path may be a full URL. (more below the table) |
The rest of the longer descriptions in the table:
api: The signing rule follows/v1/or/v3/in the path;GETparameters go into the query string, other methods send a form body for v1 and a JSON body for v3. Paths containing/public/are unsigned by default and all others signed; the sign argument can set it explicitly, and unsigned requests are also sent with the given HTTP method.rawis not a request body but a parameter table (a JSON object) that replacesparamsentirely when non-empty and is signed as usual; for v3 JSON bodies its object, array, number and boolean values are kept as they are. Spot and futures behave the same for this command. Returns: The whole exchange response (datais not unwrapped for either v1 or v3 endpoints); an error is raised when the responsesuccessis nottrue.
For the common commands base and currency see exchange.IO.
Function Support
All exchange objects
Not supported (the call fails with an error and returns null): exchange.GetTickers.
WOO (Spot)
Served through a fallback:
exchange.GetRecords: Native periods are 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w, 1M; other periods are synthesized by the docker.
Futures_WOO (Futures)
Served through a fallback:
exchange.GetRecords: Native periods are 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w, 1M, 1y; other periods are synthesized by the docker.
Margin, Account and Simulation
Futures_WOO (Futures)
Margin mode: Choose cross/isolated margin with exchange.IO("cross", bool); it is a local setting carried with every order (cross by default). exchange.SetMarginLevel() sets leverage per contract and carries the current cross/isolated setting.
Position mode: Switch hedge/one-way mode with exchange.IO("dual", bool). The connector does not detect the account's position mode: if the account is already in hedge mode, call exchange.IO("dual", true) at the start of every run, otherwise orders lack the position side and are rejected by the exchange. In hedge mode exchange.SetMarginLevel() sets the same leverage on both the long and the short side in one call (it fails if either side fails, and the error names the side that was already set), regardless of the direction set by exchange.SetDirection(); in one-way mode it is set once.
Notes
All exchange objects
exchange.ModifyOrder()modifies the price and amount in place, keeping the order ID.
WOO (Spot)
- The amount of a market buy order is the quote-currency amount to spend (WOO X's
order_amount); a market sell order is in the base currency. When queried, bothAmountandDealAmountof a regular market buy order are the filled base-currency quantity. - WOO X spot has no 24-hour ticker endpoint;
exchange.GetTicker()is built from the latest 24 one-hour K-lines (open, high, low, volume) and the order book (best bid and ask), requesting two endpoints per call. - Conditional orders support take-profit, stop-loss and OCO;
exchange.ModifyConditionOrder()can modify take-profit and stop-loss orders only, not OCO conditional orders. exchange.GetConditionOrders()queries one trading pair only: when omitted or empty it queries the current trading pair.exchange.GetHistoryOrders()andexchange.GetHistoryConditionOrders()query one trading pair only: withoutsymbolthey query the current trading pair, and an empty string fails.
Futures_WOO (Futures)
- Conditional orders support take-profit, stop-loss and OCO, with the trigger price type fixed to
MARKET_PRICE;exchange.ModifyConditionOrder()can modify take-profit and stop-loss orders only (trigger price, order price and amount, keeping the order ID), not OCO conditional orders. - The
Rateofexchange.GetFundings()is the exchange's estimated funding rate for the next settlement andTimeis the next settlement time; batch queries are supported. - In
exchange.GetPositions(),Profitis computed as (mark price − average open price) × position size andMarginis estimated as average open price × position size ÷ leverage; the position's margin mode is themarginModein the exchange's position data (one account can hold both cross and isolated positions), independent of the localexchange.IO("cross", bool)order setting. - Like the open-order queries,
exchange.GetHistoryOrders()andexchange.GetHistoryConditionOrders()accept ranges such asUSDT.swap: the exchange is queried without a trading pair and the results are filtered by the range, withlimitcounting only orders inside the range.