Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Hyperliquid
Lighter
edgeX
Aster
Aevo
Pendle
WOOFi Pro
Uniswap / PancakeSwap
Aerodrome / Velodrome
KyberSwap
1inch
EVM DEX Common Commands
Jupiter
OKX DEX
DEX Strategy Examples
Prediction Markets
Securities and Futures
On-chain & Custom

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.

FieldRequiredDescription
AccountIDYesThe Orderly account ID.
Access KeyYesThe public key of the Orderly API key (ed25519), with or without the ed25519: prefix.
Secret KeyYesThe 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 codeDescription
swapPerpetual 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
CommandArgumentsDescriptionReturns
apimethod, 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-signature and related headers; the account ID and API key must be configured); sign set to true/false (it may also be given directly as the 4th argument) forces signing on or off. GET parameters go into the query string, DELETE sends a form body and other methods a JSON body. raw is not a request body but a parameter table (a JSON object or a=1&b=2) that replaces params entirely 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's IOC, FOK and POST_ONLY order 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 Price is 0; the average fill price is in AvgPrice (the exchange's average_executed_price).
  • MarginLevel in exchange.GetPositions() is the position's leverage (the exchange's leverage on the position row, or the reciprocal of the initial margin ratio imr when it is absent), and Margin is the initial margin in use (position value ÷ leverage).
  • The order book and K-line endpoints also require a signature: exchange.GetDepth(), exchange.GetRecords() and exchange.GetTicker() (best bid and ask come from the order book) all need a configured API key; exchange.GetTickers(), exchange.GetTrades(), exchange.GetFundings() and exchange.GetMarkets() need no signature.