WOOFi Pro
Perpetual contracts (the WOO ecosystem's perpetual DEX built on Orderly Network, a different product and account from the WOO X exchange). Only USDC-settled perpetual contracts; the account is cross margin with one-way positions. Requires the Orderly account ID and an Orderly API key (ed25519 key pair).
Names and Configuration
exchange.GetName(): Futures_WOOFi (Futures); aliases: WOOFi, Orderly.
| Field | Required | Description |
|---|---|---|
| AccountID | Yes | The Orderly account ID. |
| Access Key | Yes | The public key of the Orderly API key (ed25519), with or without the ed25519: prefix. |
| Secret Key | Yes | The private key of the Orderly API key (base58-encoded), with or without the ed25519: prefix. |
Trading Pairs and Contract Codes
Pair examples: BTC_USDC, ETH_USDC
Only USDC-settled contracts exist; the quote currency must be USDC, for example ETH_USDC maps to the native code PERP_ETH_USDC; other quote currencies are rejected.
| Contract code | Description |
|---|---|
swap | Perpetual contract. |
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
| Command | Arguments | Description | Returns |
|---|---|---|---|
api | method, path[, params[, raw[, sign]]] | Call an Orderly endpoint directly. (more below the table) | The whole response (with success, data and timestamp; data is not unwrapped); an error is raised when success is false. |
The rest of the longer descriptions in the table:
api: Paths starting with/v1/public/or/v1/tv/are unsigned by default and other paths are signed with the ed25519 key (orderly-key,orderly-signatureand related headers; the account ID and API key must be configured);signset totrue/false(it may also be given directly as the 4th argument) forces signing on or off.GETparameters go into the query string,DELETEsends a form body and other methods a JSON body.rawis not a request body but a parameter table (a JSON object ora=1&b=2) that replacesparamsentirely when non-empty.
For the common commands base and currency see exchange.IO.
Common Usage
Call public and signed endpoints with api
javascript
function main() {
// Paths starting with /v1/public/ are unsigned by default; the whole response is
// returned, with the payload in data
var info = exchange.IO("api", "GET", "/v1/public/info/PERP_ETH_USDC")
Log("Tick:", info.data.quote_tick, "min size:", info.data.base_min)
var fr = exchange.IO("api", "GET", "/v1/public/funding_rate/PERP_ETH_USDC")
Log("Estimated funding rate:", fr.data.est_funding_rate)
// Other paths are signed with the ed25519 key by default
var orders = exchange.IO("api", "GET", "/v1/orders", {status: "INCOMPLETE"})
Log("Open orders:", orders.data.rows.length)
var pos = exchange.IO("api", "GET", "/v1/positions")
Log("Positions:", pos.data.rows.length, "success:", pos.success)
}
Function Support
No unsupported standard functions.
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. At most 1000 bars per call.
Margin, Account and Simulation
Margin mode: The account is always cross margin, with no isolated margin; exchange.IO("cross", ...) is not supported. exchange.SetMarginLevel() sets leverage, which must be an integer; the exchange applies it to the whole account, so setting one contract's leverage also changes the other contracts.
Position mode: One-way (net) positions only; exchange.IO("dual", ...) is not supported, and exchange.SetDirection() only distinguishes opening from closing.
Account: The equity of exchange.GetAccount() is the USDC holding, and the unrealized PnL is the sum of the positions' unsettled PnL (unsettled_pnl). exchange.GetAssets() lists holdings per currency: frozen = frozen + pending_short, available = holding − frozen.
Notes
- Conditional orders support take-profit and stop-loss only, not OCO (place the take-profit and stop-loss legs as two conditional orders); they trigger on the mark price, and with an order price of -1 (market) they execute at market once triggered.
- Limit orders accept
{tif: "ioc"},{tif: "fok"}or{postOnly: true}in the last object argument, mapped to the exchange'sIOC,FOKandPOST_ONLYorder types; other keys are merged into the order request body as they are (overriding fields of the same name built by the connector). exchange.ModifyOrder()modifies in place and the order ID stays the same; a price or amount that is not passed keeps its current value.exchange.ModifyConditionOrder()modifies the trigger price, order price and amount in place, and the order ID stays the same as well.- For market orders
Priceis 0; the average fill price is inAvgPrice(the exchange'saverage_executed_price). MarginLevelinexchange.GetPositions()is the position's leverage (the exchange'sleverageon the position row, or the reciprocal of the initial margin ratioimrwhen it is absent), andMarginis the initial margin in use (position value ÷ leverage).- The order book and K-line endpoints also require a signature:
exchange.GetDepth(),exchange.GetRecords()andexchange.GetTicker()(best bid and ask come from the order book) all need a configured API key;exchange.GetTickers(),exchange.GetTrades(),exchange.GetFundings()andexchange.GetMarkets()need no signature.