Introduction
The Open Trade REST API is a request/response counterpart to the WebSocket API. Every endpoint here is a direct REST equivalent of a WebSocket channel or command — if you'd rather poll or fire one-off requests instead of holding a persistent socket open, this is the interface to use.
REST Base URL
/hermes-ws-gateway/api/rest/balance — concatenate host + that full path.
Endpoint Groups
/public/. Send the Authorization header on all requests below.
/public/ path (market data, no account-specific data)
GET /public/asset-listGET /public/instrument-listGET /public/asset-mappingGET /public/order-book-publicGET /public/timeGET /public/tickersGET /public/candlesGET /public/perp/order-bookGET /public/perp/funding-rates
/trade-private/ path and account endpoints (account/order data)
POST / PUT / DELETE /trade-private/ordersGET /trade-private/trades-historyGET /trade-private/orders-historyGET /trade-private/active-ordersGET /client-portfolioGET /client-portfolio-historyGET /balance
/perp/ path (perpetual futures; needs the Trade permission)
GET /perp/positionsGET /perp/risk
/yield/ path (Yield contracts; needs the Trade permission)
GET /yield/productPOST /yield/subscriptionsGET /yield/contracts/open,GET /yield/contracts/closedGET /yield/contracts/{contractId}GET /yield/summary,GET /yield/contracts/{contractId}/performanceGET /yield/contracts/{contractId}/redemption-quotePOST /yield/contracts/{contractId}/redeem,POST /yield/contracts/{contractId}/cancel
/yield-basket/ path (Yield Basket units; needs the Trade permission)
GET /yield-basket/product,GET /yield-basket/holdingGET /yield-basket/activity,GET /yield-basket/requests/openPOST /yield-basket/subscriptions,POST /yield-basket/redemptionsPOST /yield-basket/requests/{reference}/cancel
/portfolio/ path (Portfolio Builder and managed portfolios; needs the Trade permission)
GET /portfolio/config,GET /portfolio/universe,GET /portfolio/suggestedPOST /portfolio/analytics,POST /portfolio/backtestGET / POST /portfolio/portfolios,GET / PUT / DELETE /portfolio/portfolios/{portfolioId}POST /portfolio/mandates,GET /portfolio/mandates,GET /portfolio/mandates/{mandateCode}POST /portfolio/mandates/{mandateCode}/stop,POST /portfolio/mandates/{mandateCode}/follow-model
Versioning & Headers
Every REST call — public or private — must include the X-API-Version header. This lets Open Trade evolve the REST contract without breaking existing integrations.
| Header | Required | Description |
|---|---|---|
| X-API-Version | Yes | API version to target. Current value: 1.0.0 |
| Authorization | Private only | Bearer JWT token, obtained via the authentication flow below. Required on every private endpoint. |
Authentication
Private REST endpoints use the exact same credential exchange as the Private Data API (WebSocket) — obtain your JWT once, then reuse it across both interfaces.
- Login with your API key’s API username and password to obtain a session cookie
- Use the session cookie to obtain a JWT token
- Send the JWT token as a Bearer token in the
Authorizationheader of every private REST request
Authentication Flow
Before You Start: Create an API Key
Create a key under Account → API Keys: name it, choose its permissions and confirm with your second factor. The platform generates the key's API username, password and secret and shows them once, so store all three straight away.
| Credential | Example | Where it goes |
|---|---|---|
| API username | 100123_mybot | The username field in Step 1, and the {api-username} in the Step 2 URL — the same value both times |
| Password | — | The password field in Step 1 |
| Secret | — | The clientSecret header in Step 2 |
The password expires one year after the key is created, and login is refused from then on — create a new key before that date.
Step 1: Login with the API Username and Password
Using POST method, send the API username and password to the login endpoint. Note that the credentials must be sent as form-data with keys in lowercase. This returns a SESSION cookie (not JSESSIONID).
POST https://auth.opentrade.exchange/login
// Form Data (lowercase keys!)
username: {api-username}
password: {password}
/login. Only the SESSION cookie of a successful login can obtain a token in the next step.
Step 2: Obtain JWT Token
Use the SESSION cookie from Step 1 to obtain your JWT token. This is a POST with the client secret sent as a header, not a query parameter, and an empty body.
POST https://auth.opentrade.exchange/auth/jwt/clients/{api-username}/token
// Headers
Cookie: SESSION={session_cookie_from_step_1}
clientSecret: {secret}
// Body: empty
/auth/jwt/clients/ (plural) — not /client/. And note this is a single /auth/, not the doubled /auth/auth/ some older references show.
Complete Authentication Flow with cURL
curl -s --cookie-jar cookies.txt -X POST \
"https://auth.opentrade.exchange/login" \
-d "username=[API_USERNAME]&password=[PASSWORD]" \
-o /dev/null -w "login redirected to %{redirect_url}\n" \
--next -s -b cookies.txt -X POST \
"https://auth.opentrade.exchange/auth/jwt/clients/[API_USERNAME]/token" \
-H "accept: */*" \
-H "clientSecret: [SECRET]" \
-d ""
Bearer eyJ.... Use it as-is in the Authorization header — don't add a second "Bearer " prefix. The response also includes a jwt-expire-at header (when the token expires) and jwt-scope header.
Using Your Token
The token returned from the authentication flow already includes the Bearer prefix (the response body reads Bearer eyJ...). Use it exactly as returned in the Authorization header — do not prepend a second Bearer , or the header will read Bearer Bearer eyJ... and be rejected.
Include it on every private REST call, alongside the required X-API-Version header.
GET /hermes-ws-gateway/api/rest/trade-private/active-orders HTTP/1.1
Host: gateway-public.opentrade.exchange
X-API-Version: 1.0.0
Authorization: Bearer eyJraWQiOiIwYWJmMGYwZS00YzliLTQ3NjItYjkxYS04NjE2YzkxMzJkMjkiLCJhbGciOiJSUzI1NiJ9...
Token Lifetime
The token response includes two headers you should read and store alongside the token itself:
| Header | Description |
|---|---|
| jwt-expire-at | ISO-8601 timestamp of when the token expires. Re-run the login + token exchange before this time to get a fresh token. |
| jwt-scope | Scope granted to this token, e.g. api.access. |
- Store your token securely and never expose it in client-side code
- Read
jwt-expire-atfrom the token response and refresh proactively before that time, rather than waiting for a 401 - Re-running the full login + token exchange is how you refresh — there is no separate refresh-token endpoint
- Use environment variables or a secrets manager to store credentials, never hardcode them in source control
REST equivalent of the WS ASSET_LIST channel. Returns the full list of assets supported across all connected exchanges.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
[
{
"class": "Currency",
"code": "BTC",
"name": "BTC"
}
]
REST equivalent of the WS INSTRUMENT_LIST channel. Returns each spot pair once, with its quote currency (the right-hand side of the pair) and the venues listing it in exchanges. Pass instrumentType=FUTURE to list the perpetual futures open to you instead.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
[
{
"class": "Instrument",
"quoteCurrencyCode": "USD",
"code": "BTC/USD",
"name": "BTC/USD",
"exchanges": ["BITGET", "HUOBI"]
}
]
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instrumentType | query | string | Optional | SPOT (default) or FUTURE, in capitals. Any other value answers 400 |
[
{
"class": "Instrument",
"quoteCurrencyCode": "USDT",
"code": "BTC/USDT",
"name": "BTC/USDT",
"instrumentType": "FUTURE",
"settleAsset": "USDT",
"exchanges": ["BITGET", "HUOBI"]
}
]
Maps each venue's own code for an asset to the Open Trade code used everywhere else in this API, such as usdt on HUOBI to USDT. One row per venue and venue code, sorted by venue and Open Trade code. Use it to translate what a venue shows you into the codes you send here.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | string | Optional | One venue, in capitals as in exchanges of Instrument List, such as BITGET or HUOBI. Leave it out for every venue |
[
{
"class": "AssetMapping",
"exchange": "HUOBI",
"venueCode": "btc",
"code": "BTC"
},
{
"class": "AssetMapping",
"exchange": "HUOBI",
"venueCode": "usdt",
"code": "USDT"
}
]
REST equivalent of a WS ORDER_BOOK_PUBLIC channel GET snapshot. Returns an L2 order book snapshot (bids/asks) for the requested instrument(s).
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruments | query | array<string> | Yes | Instrument codes to fetch, e.g. BTC/USD |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/public/order-book-public?instruments=BTC/USD HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
[
{
"class": "OrderBook",
"exchange": "OKEX",
"symbol": "BTC/USDT",
"bids": [
[63985.5, 0.50735545]
],
"asks": [
[63985.6, 1.08926571]
],
"eventTime": 1783442361532
}
]
[price, amount] pair, ordered best-price-first. The response returns one entry per exchange with liquidity for the requested instrument — expect multiple entries per instrument (e.g. one each for OKEX, BITGET, HUOBI), not a single merged book.
The Open Trade gateway's clock. Use it as "now" when deciding whether a candle has closed: a candle opened at T with length L has closed once serverTime >= T + L. Candles serves it about two minutes later, so a period that is still missing once serverTime >= T + L + 120000 had no trades.
GET /hermes-ws-gateway/api/rest/public/time HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"serverTime": 1790593200123
}
eventTime on the order book.
One consolidated price per spot pair: the mid of the best bid and the best ask across every connected venue, with the number of venues quoting both sides. Prices are at most two seconds old. For depth, use Order Book.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruments | query | string | Yes | 1 to 20 pair codes, comma separated, e.g. BTC/USDT,ETH/USDT. A code that is not a pair is answered 400 |
| Authorization | header | string | Yes | Bearer JWT token |
GET /hermes-ws-gateway/api/rest/public/tickers?instruments=BTC/USDT,ETH/USDT HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
[
{
"instrument": "BTC/USDT",
"mid": 80048.075,
"venues": 5
},
{
"instrument": "ETH/USDT",
"mid": 2324.135,
"venues": 4
}
]
mid is that side's best price and venues is 0.
Closed OHLCV candles for one pair, newest first. A backtest session serves the same path, parameters and rows for a venue's own trades; pass exchange explicitly so one call works on both.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instrument | query | string | Yes | Pair code, e.g. LTC/USDT |
| exchange | query | string | Optional | Default OPENTRADE: candles built from public trades on every connected venue, the series the Open Trade chart shows and the reference for SMART orders. Pass a venue code (HUOBI, OKEX, BITGET…) for that venue's own trades |
| period | query | string | Optional | One of ONE_MIN (default), FIVE_MIN, FIFTEEN_MIN, ONE_HOUR, FOUR_HOURS, ONE_DAY |
| to | query | integer | Optional | Epoch milliseconds. Only candles that end at or before to, rounded down to the period, are returned. Default: now. To page back, pass the oldest openTime you already have |
| limit | query | integer | Optional | How many periods to cover, 1 to 1000. Default 100 |
| Authorization | header | string | Yes | Bearer JWT token |
GET /hermes-ws-gateway/api/rest/public/candles?instrument=LTC/USDT&period=ONE_HOUR&limit=300 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
[
[1790589600000, 84.1, 85.0, 83.9, 84.7, 1520.5],
[1790586000000, 83.5, 84.2, 83.4, 84.1, 990.0]
]
[openTime, open, high, low, close, volume]. openTime is the start of the period in epoch milliseconds UTC, and periods line up with UTC boundaries (hours on :00, four hours on 00, 04, 08, 12, 16 and 20 UTC). Prices come from executed public trades, not the book midpoint, and volume is in the base asset. A period with no trades has no row.
REST equivalent of the WS TRADE_PRIVATE channel CREATE command. Accepts an array so multiple orders can be submitted in a single call.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| exchange | string | Optional | Name of exchange to send order to, such as BITFINEX, LMAX, OKX. If not provided, order will be set as SMART |
| globalInstrumentCd | string | Yes | Instrument code, e.g. BTC/USD |
| clientOrderId | string | Optional | Recommend unique Unix timestamp; server will assign one if omitted |
| direction | string | Yes | BUY or SELL |
| orderType | string | Yes | MARKET, LIMIT, POST_ONLY, BUY_STOP, SELL_STOP, STOP_LOSS, TAKE_PROFIT |
| timeInForce | string | Optional | GTC, IOC, FOK. GTC when omitted. |
| price | number | Yes | The limit price for LIMIT and POST_ONLY, and the trigger for BUY_STOP and SELL_STOP. For MARKET, STOP_LOSS and TAKE_PROFIT send the current price as a reference |
| sl | number | Optional | Stop loss trigger. Required for STOP_LOSS. On a LIMIT, MARKET, BUY_STOP or SELL_STOP entry it attaches a stop loss. On a TAKE_PROFIT it links a stop loss to it |
| tp | number | Optional | Take profit trigger. Required for TAKE_PROFIT. On a LIMIT, MARKET, BUY_STOP or SELL_STOP entry it attaches a take profit. On a STOP_LOSS it links a take profit to it |
| amount | number | Yes | Order quantity |
| instrumentType | string | Optional | SPOT (default) or FUTURE. FUTURE places the order on the perpetual of the pair, for example BTC/USDT. See Perpetual Orders |
| leverage | number | Optional | Perpetual orders only. From 1 up to your leverage cap |
| reduceOnly | boolean | Optional | Perpetual orders only. true lets the order only shrink or close your position, never open or grow one. Default false |
[
{
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USD",
"clientOrderId": "0989876565",
"direction": "SELL",
"orderType": "LIMIT",
"timeInForce": "GTC",
"price": 0.215,
"amount": 1.0
}
]
[
{
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USD",
"clientOrderId": "0989876565",
"direction": "SELL",
"orderType": "LIMIT",
"timeInForce": "GTC",
"price": 0.215,
"amount": 1.0,
"orderStatus": "NEW",
"exchangeOrderId": "1928374650",
"filledPrice": 0.0,
"filledAmount": 0.0,
"orderDateTime": "2026-07-07T13:04:43.792Z",
"message": "",
"processInstanceId": "string"
}
]
Take profit and stop loss
A LIMIT, MARKET, BUY_STOP or SELL_STOP entry may carry tp, sl or both. With both, the two exits are one-cancels-other. Leave exchange out: take profit and stop loss need smart routing. For a BUY set sl below and tp above the entry price, for a SELL the reverse; for a BUY_STOP or SELL_STOP the entry price is its stop price. The exits arm as the entry fills, sized to what you received. The rules are the same as on the WebSocket TRADE_PRIVATE channel.
To protect a position you already hold, send one STOP_LOSS or TAKE_PROFIT order carrying both sl and tp, with direction set to the side that closes the position and amount to the quantity to protect. The two exits are one-cancels-other and the quantity is reserved once for the pair. Leave exchange out. For a SELL set sl below and tp above the current price, for a BUY the reverse.
clientOrderId must be unique per order. Reusing an ID will be rejected.
REST equivalent of the WS TRADE_PRIVATE channel UPDATE command (order modification — e.g. price/amount changes on a resting order).
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
Uses the same request/response body shape as Create Orders, but requires an existing clientOrderId or exchangeOrderId to identify the order being modified.
[
{
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USD",
"clientOrderId": "0989876565",
"direction": "SELL",
"orderType": "LIMIT",
"timeInForce": "GTC",
"price": 0.22,
"amount": 1.0
}
]
REST equivalent of the WS TRADE_PRIVATE channel CANCEL command.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
Note that DELETE requests here carry a request body — identify the order(s) to cancel via clientOrderId, exchangeOrderId, and globalInstrumentCd.
- You must provide either
clientOrderIdorexchangeOrderId— at least one is required to identify the order. - If
clientOrderIdis provided, it is used (takes precedence overexchangeOrderId). - If only
exchangeOrderIdis provided, that order is cancelled. - If neither is provided, all orders for the selected pair(s) will be cancelled.
[
{
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USD",
"clientOrderId": "0989876565",
"exchangeOrderId": "1928374650"
}
]
[
{
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USD",
"clientOrderId": "0989876565",
"orderStatus": "CANCELLED",
"exchangeOrderId": "1928374650",
"orderDateTime": "2026-07-07T13:04:52.249Z",
"message": ""
}
]
REST equivalent of the WS TRADE_PRIVATE channel active orders GET. Returns all currently open (not filled/cancelled/rejected) orders.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruments | query | array<string> | Optional | Filter to specific instruments; omit for all |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
[
{
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USD",
"clientOrderId": "0989876565",
"direction": "SELL",
"orderType": "LIMIT",
"timeInForce": "GTC",
"price": 0.215,
"amount": 1.0,
"orderStatus": "ACTIVE",
"exchangeOrderId": "1928374650",
"filledPrice": 0.0,
"filledAmount": 0.0,
"orderDateTime": "2026-07-07T13:06:29.441Z",
"message": "",
"processInstanceId": "string"
}
]
REST equivalent of the WS TRADE_PRIVATE channel trades history GET. Returns executed trades (fills) within a date range.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruments | query | array<string> | Optional | Filter to specific instruments |
| fromDtm | query | string ($date-time) | Optional | Range start (ISO-8601) |
| toDtm | query | string ($date-time) | Optional | Range end (ISO-8601) |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/trade-private/trades-history?instruments=BTC/USDT&fromDtm=2026-06-01T00:00:00&toDtm=2026-07-01T00:00:00 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
[
{
"class": "Order",
"exchange": "OKEX",
"globalInstrumentCd": "BTC/USDT",
"clientOrderId": "11781606906612",
"direction": "BUY",
"orderType": "MARKET",
"timeInForce": "GTC",
"price": 66591.4,
"amount": 0.0002,
"orderStatus": "FILLED",
"exchangeOrderId": "3660939752535318528",
"filledPrice": 66558.0,
"filledAmount": 0.0002,
"orderDateTime": "2026-06-16T10:48:26.747Z",
"message": null,
"processInstanceId": null
},
{
"class": "Order",
"exchange": "BITGET",
"globalInstrumentCd": "BTC/USDT",
"clientOrderId": "11787796637216",
"direction": "BUY",
"orderType": "LIMIT",
"timeInForce": "GTC",
"price": 66540.2,
"amount": 0.0005,
"orderStatus": "PARTIALLY_FILLED",
"exchangeOrderId": "~",
"filledPrice": 66540.2,
"filledAmount": 0.0005,
"orderDateTime": "2026-06-18T14:02:11.310Z",
"message": null,
"processInstanceId": null,
"internal": true
}
]
"internal": true, and exchange names the venue whose balances funded it. Each internal fill is its own row with orderStatus PARTIALLY_FILLED, so an order filled entirely on our book never gets a FILLED row: read whether it is complete from Orders History, or add up filledAmount. On an internal row price and filledPrice are the price that fill crossed at, and amount and filledAmount are the quantity of that fill, not your order's own limit and size. exchangeOrderId is ~, since no exchange order exists. The field is present only on internal fills; a fill executed on an exchange leaves it out.
clientOrderId, one per fill (e.g. PARTIALLY_FILLED followed by FILLED; internal fills never end in FILLED, see above). Aggregate by clientOrderId if you need one row per order rather than per fill.
REST equivalent of the WS TRADE_PRIVATE channel orders history GET. Returns historical orders filtered by status and date range.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruments | query | array<string> | Yes | Instrument codes to filter by |
| statuses | query | array<string> | Yes | See status values below |
| fromDtm | query | string ($date-time) | Optional | Range start (ISO-8601) |
| toDtm | query | string ($date-time) | Optional | Range end (ISO-8601) |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
Available Status Values
NEW, SUBMITTED, PENDING, ACTIVE, IN_RECONCILIATION, PARTIALLY_FILLED, FILLED, CANCELLED, REJECTED, EXPIRED, FAILED, REJECTED_WRONG_ENV, DUPLICATE, UNKNOWN
One entry per action on your account — a fill, a transfer, a deposit, a withdrawal, a yield movement or a fee — assembled from the accounting ledger. Where /trade-private/trades-history reports what executed on an exchange, the journal reports what it did to your balances: the debits, the credits, the fees charged and the balances each action left behind.
debits, credits and fees list, not three unrelated rows. The postings array always carries the individual ledger rows behind the entry. Debits are negative and credits positive, so the postings of an entry sum to what it did to your balances. debits and credits are the net change to your balance in each asset, fees included; fees is the breakdown of what was charged.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| size | query | integer | Optional | Entries per page. Default: 50, maximum 500. Anything outside 1..500 is rejected with 400 |
| page | query | integer | Optional | Zero-based page number. Default: 0. A negative page is rejected with 400 |
| periodType | query | string | Optional | Default: L30D. See period values below |
| atdPeriodStart | query | string ($date-time) | Optional | Range start (ISO-8601), required when periodType=ATD |
| atdPeriodEnd | query | string ($date-time) | Optional | Range end (ISO-8601), required when periodType=ATD |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
The client is taken from the token, so there is no way to request another account’s journal.
Period Values
L24H, DTD (today), L7D, WTD, L30D, MTD, L6M, L12M, YTD, ATD (the window given by atdPeriodStart and atdPeriodEnd)
Statuses
COMPLETED, FAILED. A failed entry also carries statusDescription with the reason the ledger recorded.
Fee Types
EXCHANGE, BROKER, CLIENT, SWAP, NETWORK
Action Types
BUY, SELL, DEPOSIT, WITHDRAWAL, TRANSFER, YIELD_SUBSCRIPTION, YIELD_HARVEST, YIELD_REDEMPTION, YIELD_MOVEMENT, DAILY_SETTLEMENT, TRADING_FEE, EXCHANGE_FEE, BROKER_FEE, NETWORK_FEE, FINANCING_FEE, ADJUSTMENT
Perpetual Futures Entries
A perpetual fill or a funding settlement is one entry with instrumentType FUTURE. Its debits and credits are the net change to your futures wallet in the settle asset, fees included, and its balances are the futures wallet after the entry, with scope FUTURES. perpFills lists the fills behind the entry; a funding entry has no fills and no fees. A perpetual entry's postings is always empty: read its debits, credits and balances instead.
| actionName | actionType | When |
|---|---|---|
Opened Long | BUY | A buy that opened or grew a long |
Opened Short | SELL | A sell that opened or grew a short |
Closed Long | SELL | A sell that shrank or closed a long |
Closed Short | BUY | A buy that shrank or closed a short |
Closed Long, Opened Short | SELL | One order that closed a long and opened a short |
Closed Short, Opened Long | BUY | One order that closed a short and opened a long |
Liquidated Long | SELL | The platform closed a long that reached its liquidation price |
Liquidated Short | BUY | The platform closed a short that reached its liquidation price |
Funding Fee | FINANCING_FEE | Funding you paid at a settlement |
Funding Income | FINANCING_FEE | Funding you received at a settlement |
Liquidation shortfall covered | ADJUSTMENT | A liquidation lost more than the wallet held and the platform covered the difference |
perpFills
| Field | Type | Description |
|---|---|---|
| time | string | Fill time |
| contractCode | string | The venue's contract, e.g. BTC-USDT |
| settleAsset | string | Asset the contract settles in |
| quantity | number | Signed size filled, in the base asset: positive bought, negative sold |
| price | number | Fill price |
| sizeAfter | number | Signed position size after the fill |
| realisedPnl | number | Profit or loss the fill realised |
| fees | array | Fees on the fill, in the shape of the entry's fees |
| walletAfter | number | Futures wallet balance after the fill |
| tradeId | string | The venue's trade id |
{
"actionType": "BUY",
"actionName": "Opened Long",
"instrumentType": "FUTURE",
"time": "2026-10-11T14:02:11",
"baseAsset": "BTC",
"quoteAsset": "USDT",
"quantity": 0.01,
"price": 112380.5,
"route": ["HUOBI"],
"debits": [{"asset": "USDT", "amount": -0.45}],
"credits": [],
"fees": [
{"asset": "USDT", "amount": 0.22, "feeType": "EXCHANGE"},
{"asset": "USDT", "amount": 0.23, "feeType": "CLIENT"}
],
"balances": [{"asset": "USDT", "amount": 999.55, "scope": "FUTURES"}],
"status": "COMPLETED",
"perpFills": [
{
"time": "2026-10-11T14:02:11",
"contractCode": "BTC-USDT",
"settleAsset": "USDT",
"quantity": 0.01,
"price": 112380.5,
"sizeAfter": 0.01,
"realisedPnl": 0,
"fees": [
{"asset": "USDT", "amount": 0.22, "feeType": "EXCHANGE"},
{"asset": "USDT", "amount": 0.23, "feeType": "CLIENT"}
],
"walletAfter": 999.55,
"tradeId": "1196418723"
}
]
}
{
"content": [
{
"actionKey": "11788521799959",
"actionType": "BUY",
"actionName": "Bought",
"clientId": 1000123,
"time": "2026-08-31T14:02:11",
"startTime": "2026-08-31T14:02:09",
"baseAsset": "BTC",
"quoteAsset": "USDT",
"quantity": 0.25,
"price": 88012.4,
"route": ["OKEX"],
"debits": [{"asset": "USDT", "amount": -22014.1}],
"credits": [{"asset": "BTC", "amount": 0.25}],
"fees": [{"asset": "USDT", "amount": 11.0, "feeType": "EXCHANGE"}],
"balances": [{"asset": "BTC", "amount": 1.35}],
"status": "COMPLETED",
"statusDescription": null,
"clientOrderId": "a7c1f0e2-5d44-4e21-9f0b-6e2b8f0d1c33",
"transactionGroupId": "4a248fbd-1cd8-3164-b081-26f40e8248ac",
"postings": [
{
"id": 11788521799959,
"clientId": 1000123,
"assetType": "BTC",
"amount": 0.25,
"price": 88012.4,
"priceCurrency": "USDT",
"time": "2026-08-31T14:02:11",
"description": "Buy BTC/USDT",
"transactionType": "BUY",
"operation": "EXECUTE_WITH_UNLOCK",
"origin": "TOMS",
"status": "SUCCESS",
"assetTypeBalance": 1.35,
"priceCurrBalance": 150244.02,
"transactionGroupId": "4a248fbd-1cd8-3164-b081-26f40e8248ac",
"exchange": "OKEX",
"clientOrderId": "a7c1f0e2-5d44-4e21-9f0b-6e2b8f0d1c33"
}
]
}
],
"number": 0,
"size": 50,
"totalElements": 120
}
REST equivalent of the WS CLIENT_PORTFOLIO channel GET snapshot. Returns current holdings by asset type, including exposure, PnL, and available balances.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
[
{
"class": "ClientPortfolio",
"assetType": "BTC",
"quantity": 0.0019553,
"avgPriceUsd": 90550.7416782,
"index": 88010.42919245128,
"onOrders": 0.0,
"available": 0.0019553,
"marketValue": 172.0867922,
"unrealizedPnl": -4.967073,
"notional": 177.0538652
}
]
avgPriceUsd is the average price paid for the quantity still open, which is your cost basis over that quantity; index is the current mark price used for valuation. notional is that cost basis in USD, so marketValue less notional is unrealizedPnl, which can be negative. quantity and available can be negative for a short position.
Historical counterpart to Client Portfolio — returns portfolio snapshots over a date range instead of the live snapshot.
REST equivalent of the WS BALANCE channel. Returns account balances by currency.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
[
{
"class": "Balance",
"currencyCode": "BTC",
"balance": 0.0019553,
"available": 0.0019553,
"locked": 0.0
}
]
balance is total holdings for that currency; available is free/withdrawable; locked is held against open orders (balance = available + locked).
REST equivalent of the WS CLIENT_BALANCE_DISTRIBUTION channel GET. Returns where your tokens actually sit: one row per asset per venue, with cost basis, valuation and PnL for that venue.
/balance and /client-portfolio both report the aggregate across every venue, but an order is routed to exactly one exchange and is checked against that venue's balance alone. Read this endpoint to decide where an order can actually be filled, and how much can be withdrawn or transferred off a given venue.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
There are no query parameters. The client is taken from the token, so there is no way to request another account's distribution.
[
{
"class": "ClientBalanceDistribution",
"clientId": 1000123,
"asset": "BTC",
"exchange": "OKEX",
"finalBalance": 0.35,
"costBasisUsd": 30642.7595,
"marketValueUsd": 30803.6502,
"avgPriceUsd": 87550.7414,
"lockedAmount": 0.05,
"availableAmount": 0.3,
"unrealizedPnl": 160.8907,
"returnPercent": 0.525
},
{
"class": "ClientBalanceDistribution",
"clientId": 1000123,
"asset": "BTC",
"exchange": "BITGET",
"finalBalance": 0.12,
"costBasisUsd": 10866.089,
"marketValueUsd": 10561.2515,
"avgPriceUsd": 90550.7417,
"lockedAmount": 0.0,
"availableAmount": 0.12,
"unrealizedPnl": -304.8375,
"returnPercent": -2.8054
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| clientId | number | Your Open Trade client identifier, taken from the token. |
| asset | string | Asset code, e.g. BTC, USDT, GALA. |
| exchange | string | Venue holding the asset: OKEX, HUOBI, BITGET, BITMART, BINANCE, DERIBIT, LMAX, GEMINI, BLOCKCHAIN, OPENTRADE. |
| finalBalance | number | Total amount of the asset held on that venue. |
| availableAmount | number | Amount free to trade, withdraw or transfer from that venue. |
| lockedAmount | number | Amount reserved on that venue, typically against open orders or a pending transfer. |
| avgPriceUsd | number | Average price paid for the quantity still open on that venue, in USD. Equal to costBasisUsd divided by finalBalance. |
| costBasisUsd | number | USD paid for the quantity still open on that venue. Anything already closed is excluded. |
| marketValueUsd | number | Current USD market value of the holding on that venue. |
| unrealizedPnl | number | Unrealized PnL on the holding, in USD, measured as market value less cost basis. Negative when the position is under water, and zero when nothing was paid for the holding. |
| returnPercent | number | Return on the holding, in percent, measured against the cost basis. Zero when nothing was paid for the holding. |
| futuresVenue | string | On a FUTURES row, the venue your futures wallet is held at, as one of the exchange codes, when all of it sits at that venue; balances that round to zero are ignored. null otherwise, and on every venue row. |
An asset held on three exchanges comes back as three rows. Sum finalBalance over the rows sharing an asset to reconcile against /balance, and never assume a single row carries the whole position.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| includeFutures | query | boolean | Optional | Default false. true adds your futures wallet as one row per settle asset, summed across venues, with exchange FUTURES. Answers 409 PERPS_NOT_AVAILABLE while perpetual futures are switched off |
The futures row counts the whole wallet as locked: its availableAmount is 0. What is free to trade or to move back to spot is availableMargin in Futures Risk. /balance does not count the futures wallet, so leave the FUTURES rows out when you reconcile against it.
{
"class": "ClientBalanceDistribution",
"clientId": 1000123,
"asset": "USDT",
"exchange": "FUTURES",
"finalBalance": 999.43,
"costBasisUsd": 999.43,
"marketValueUsd": 999.43,
"avgPriceUsd": 1,
"lockedAmount": 999.43,
"availableAmount": 0,
"unrealizedPnl": 0,
"returnPercent": 0,
"futuresVenue": "HUOBI"
}
CLIENT_BALANCE_DISTRIBUTION channel returns, carrying the same "class" discriminator. Only the envelope differs: the WS message wraps them in a data array, while REST returns the array on its own.
REST equivalent of the WS DEPOSIT_WALLET channel. Returns the client's deposit wallet addresses, one per supported asset.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
[
{
"class": "DepositWallet",
"id": 1000003606,
"clientId": 100882,
"symbol": "XRP",
"walletAddress": "rnSffMjADGXG9apHR6gjKz8THc1FtZGCov",
"status": "ACTIVE",
"comment": "tag: 1000003606",
"exchange": "OPENTRADE"
},
{
"class": "DepositWallet",
"id": 1000003615,
"clientId": 100882,
"symbol": "AAVE",
"walletAddress": "0x649590c78f702ed0cdeab07daf722673d2510afe",
"status": "ACTIVE",
"comment": null,
"exchange": "OPENTRADE"
}
]
comment carries the destination tag/memo when the asset requires one (e.g. XRP); otherwise null.
REST equivalent of the WS DEPOSIT_WORKFLOW channel GET. Tracks the lifecycle of incoming on-chain deposits as they are detected, confirmed, and credited to your account. /active returns the deposits still in progress as a plain list and takes no parameters; /completed returns the finished ones a page at a time.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| removeFailed | query | boolean | Optional | Excludes failed/errored processes when true. Default false. Completed only |
| dateFrom | query | string ($date) | Optional | Range start (YYYY-MM-DD). Completed only |
| dateTo | query | string ($date) | Optional | Range end (YYYY-MM-DD). Completed only |
| page | query | integer | Optional | Zero-indexed page number. Default 0. Completed only |
| pageSize | query | integer | Optional | Results per page, 1 to 200. Default 50. Completed only |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/deposit/processes/completed?removeFailed=true&dateFrom=2026-01-01&dateTo=2026-07-14&page=0&pageSize=50 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
/active body; items of a /completed page)
[
{
"walletAddress": "0x649590c78f702ed0cdeab07daf722673d2510afe",
"cryptoAssetCode": "USDT",
"transferAmount": 20.0002,
"feeAmount": 0.00001613542206867,
"feeAssetCode": "ETH",
"walletTransferId": "a31a5f77-1826-4e20-a416-ba282c4fd864",
"tag": null,
"processInstanceId": "96ece4ff-463e-11f1-af10-22add62dcf14",
"state": "Update Transfer Status - Complete",
"message": null,
"startTime": "2026-05-02T15:50:05.922Z",
"endTime": "2026-05-02T15:53:27.104Z",
"suspended": false,
"tokenPriceUsd": 0.9997792134,
"errorMessage": null
},
{
"walletAddress": "0x649590c78f702ed0cdeab07daf722673d2510afe",
"cryptoAssetCode": "ETH",
"transferAmount": 0.000811907277365572,
"feeAmount": null,
"feeAssetCode": null,
"walletTransferId": null,
"tag": null,
"processInstanceId": "b6a8edc5-44f0-11f1-bce8-7a2b3ca44423",
"state": "Check Deposit Amount",
"message": null,
"startTime": "2026-05-01T00:00:07.255Z",
"endTime": "2026-05-01T00:00:08.580Z",
"suspended": false,
"tokenPriceUsd": 2255.9838392777,
"errorMessage": null
}
]
/completed returns a page: { "items": [...], "page": 0, "pageSize": 50, "totalItems": 2, "totalPages": 1 }. Its items carry the fields shown above; /active items also carry the processing detail of a deposit still in flight: hotWalletAddress, retryCount, maxRetries, batchId, batchTransactionId, batchStatus and tasks.
state reflects the current step in the deposit pipeline; a state ending in Complete indicates the deposit has been credited. feeAmount, feeAssetCode, and walletTransferId populate once the deposit has been processed on-chain.
REST equivalent of the WS TRANSFER_FEE_QUOTE channel GET. Prices a transfer or withdrawal before it is created: the venue and network fees it will be charged, and what will reach the destination. Show it to the client, then pass its feeAmount as confirmedFee on Create Transfer.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cryptoAssetCode | query | string | Yes | Asset to transfer, e.g. USDT |
| amount | query | number | Yes | Whole amount to be debited. Must be greater than zero; a missing asset, venue or amount is rejected with 400 |
| fromExchange | query | string | Yes | Source venue code, e.g. OKEX or OPENTRADE |
| toExchange | query | string | Yes | Destination venue code, or BLOCKCHAIN for a withdrawal |
| walletToAddress | query | string | Optional | Destination address of a withdrawal |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/transfer/fee-quote?cryptoAssetCode=USDT&amount=15&fromExchange=OKEX&toExchange=BLOCKCHAIN&walletToAddress=0x1c93969dce56d7eeeb00679dcfe89d7e0f719979 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"class": "TransferFeeQuote",
"cryptoAssetCode": "USDT",
"amount": 15,
"fromExchange": "OKEX",
"toExchange": "BLOCKCHAIN",
"quoted": true,
"sendable": true,
"feeAssetCode": "USDT",
"feeAmount": 1.35,
"venueFee": 1,
"networkFee": 0.35,
"receiveAmount": 13.65,
"minimumAmount": 2,
"refusal": null,
"reason": null
}
Quote Fields
| Field | Type | Description |
|---|---|---|
| quoted | boolean | false when the venue or network could not price the fee right now; reason says why |
| sendable | boolean | false when the transfer would be refused, for example because the amount does not cover the fee and the venue's minimum; refusal says why |
| feeAssetCode | string | Asset the fee is charged in — the transferred asset |
| feeAmount | number | Total fee, venueFee plus networkFee. Send it back as confirmedFee when you create the transfer |
| venueFee | number | Withdrawal fee of the source venue, null when the transfer does not leave a venue |
| networkFee | number | Network fee of the on-chain send from the platform wallet, null when there is none |
| receiveAmount | number | What reaches the destination: amount less feeAmount, rounded down to what the venue can send |
| minimumAmount | number | Smallest amount the source venue will send |
| refusal | string | Why the transfer is not sendable, null when it is |
| reason | string | Why the fee could not be quoted, null when it was |
REST equivalent of the WS TRANSFER_WORKFLOW channel CREATE command. Initiates a transfer either between two connected exchanges/venues, or from an exchange out to an external blockchain wallet address.
Headers
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| fromExchange | string | Yes | Source venue code, e.g. OPENTRADE, OKEX |
| toExchange | string | Yes | Destination venue code, or BLOCKCHAIN to send to an external wallet |
| walletToAddress | string | Optional | Required only when toExchange is BLOCKCHAIN |
| cryptoAssetCode | string | Yes | Asset to transfer, e.g. USDT |
| transferAmount | number | Yes | Whole amount to debit; the fees come out of it |
| confirmedFee | number | Optional | The feeAmount of the fee quote the client confirmed. The transfer is never charged more, and is refused with 409 if the fee has risen |
transferAmount is the whole amount debited from your balance. The venue's withdrawal fee and the network fee are taken out of it and the destination receives the rest. Quote it first with Transfer Fee Quote and pass its feeAmount as confirmedFee: the transfer is then never charged more than the client confirmed, and is refused rather than sent if the fee has risen. Without confirmedFee the fee is priced again as the funds are sent and charged at that price, which may be higher than the quote, and when no fee can be quoted it is sent in full and the venue may charge its fees afterwards.
Exchange to Exchange
{
"fromExchange": "OPENTRADE",
"toExchange": "BITMART",
"cryptoAssetCode": "USDT",
"transferAmount": 4
}
Exchange to Blockchain Wallet (Withdrawal)
This is the same POST /hermes-ws-gateway/api/rest/transfer/start endpoint used above — a withdrawal is simply a transfer where toExchange is set to BLOCKCHAIN and walletToAddress is the external destination address.
{
"fromExchange": "OKEX",
"toExchange": "BLOCKCHAIN",
"walletToAddress": "0x1c93969dce56d7eeeb00679dcfe89d7e0f719979",
"cryptoAssetCode": "USDT",
"transferAmount": 15,
"confirmedFee": 1.35
}
walletToAddress and cryptoAssetCode before submitting.
/transfer/processes/active (in flight) or /transfer/processes/completed (finished) to follow the withdrawal's progress. The response's txId is populated once the withdrawal is broadcast on-chain.
Fee Refusals (409 Conflict)
| Code | Description |
|---|---|
| FEE_CHANGED | The fee has risen above confirmedFee. Quote again and ask the client to confirm the new fee |
| FEE_UNAVAILABLE | confirmedFee was sent but the fee cannot be quoted right now. Retry later |
| FEE_REFUSED | The amount does not cover the fee and the venue's minimum |
A refused transfer starts nothing and locks nothing. Each fee is priced again just before its leg is sent. If the venue's fee has risen above the one quoted at start (above confirmedFee itself when the quote has no networkFee), or the network fee above what confirmedFee leaves for it before anything has left the venue, the transfer ends without sending, your balance is released, and it appears among the completed transfers with its errorMessage. Once the funds have left the venue, a network fee over that is charged at the limit and the platform bears the rest.
{
"class": "TransferWorkflow",
"state": "FEE_CHANGED",
"message": "The fee on this transfer is now 1.6 USDT, above the 1.35 USDT confirmed"
}
REST equivalent of the WS TRANSFER_WORKFLOW channel GET. Tracks the lifecycle of transfers created via Create Transfer, whether between exchanges or out to a blockchain wallet. /active returns the transfers still in progress as a plain list and takes no parameters; /completed returns the finished ones a page at a time.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| removeFailed | query | boolean | Optional | Excludes failed/errored processes when true. Default false. Completed only |
| dateFrom | query | string ($date) | Optional | Range start (YYYY-MM-DD). Completed only |
| dateTo | query | string ($date) | Optional | Range end (YYYY-MM-DD). Completed only |
| page | query | integer | Optional | Zero-indexed page number. Default 0. Completed only |
| pageSize | query | integer | Optional | Results per page, 1 to 200. Default 50. Completed only |
| transferSubType | query | string | Optional | ALL (default), TRANSFER_ONLY for transfers between venues, or WITHDRAWAL_ONLY for withdrawals to a blockchain address. Completed only |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/transfer/processes/completed?removeFailed=true&dateFrom=2026-07-01&dateTo=2026-07-14&page=0&pageSize=50&transferSubType=ALL HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
/active body; items of a /completed page)
[
{
"fromExchange": "OPENTRADE",
"toExchange": "OKEX",
"cryptoAssetCode": "USDT",
"transferAmount": 5,
"confirmedFee": null,
"walletTransferId": "ffa280b4-3c95-4741-bb25-d154193b6510",
"tag": null,
"processInstanceId": "b0d4b1a1-78ec-11f1-86a3-b6505867aca1",
"state": "Completed",
"message": null,
"startTime": "2026-07-06T03:42:19.954Z",
"endTime": "2026-07-15T18:36:19.707Z",
"suspended": false,
"walletFromAddress": "0x375b9d792d38105bee4b87f72941a6af071d9218",
"feeAmount": 0.00001031880686044,
"feeAssetCode": "ETH",
"txId": "0x205cce2e2077c709a2c9f2b8fffe8861b30c2421bce308bdc87e662d8f90edfb",
"exchangeTxId": null,
"exchangeTransferId": null,
"errorMessage": null,
"tasks": null
},
{
"fromExchange": "OKEX",
"toExchange": "OPENTRADE",
"cryptoAssetCode": "USDT",
"transferAmount": 5,
"confirmedFee": null,
"walletTransferId": "916e31ee-700b-4e60-b6c2-9d14ad651fe9",
"tag": null,
"processInstanceId": "fe8858c3-78dd-11f1-86a3-b6505867aca1",
"state": "Completed",
"message": null,
"startTime": "2026-07-06T01:57:07.865Z",
"endTime": "2026-07-06T01:59:28.529Z",
"suspended": false,
"walletFromAddress": "OKEX",
"feeAmount": 0.097,
"feeAssetCode": "USDT",
"txId": null,
"exchangeTxId": "413425468",
"exchangeTransferId": "413425468",
"errorMessage": null,
"tasks": null
}
]
/active returns these objects as a plain list; /completed returns the same objects in a page: { "items": [...], "page": 0, "pageSize": 50, "totalItems": 2, "totalPages": 1 }.
confirmedFee is always null on these two endpoints; the fee a client confirmed is not read back here. walletFromAddress holds the source wallet address for on-chain transfers, or the source exchange name for exchange-internal transfers. txId is populated only for blockchain transfers; exchangeTxId/exchangeTransferId only for exchange-to-exchange transfers.
Perpetual Futures
Perpetual futures are traded through the same order calls as spot. Add "instrumentType": "FUTURE" to an order and it opens, grows, shrinks or closes a position on the perpetual of that pair, margined from your futures wallet. Your positions, your margin and risk, the perpetual order book and funding rates have their own calls, below; the WebSocket equivalents are on the Private and Public pages.
- Move collateral into your futures wallet with Futures Collateral. Only what is in the futures wallet is at risk on a position; your spot balances are never used as margin.
- List the perpetuals open to you, and the venues quoting each, with Instrument List and
instrumentType=FUTURE. An order on a perpetual that is not listed there is refused. - Leverage is capped per account. Send a
leveragefrom1up to your cap, or leave it out.
409 with {"code": "PERPS_NOT_AVAILABLE", "message": "Perpetual futures are not available"}; a new perpetual order comes back REJECTED with that message; an update to a perpetual order answers 409 PERPS_NOT_AVAILABLE; a futures transfer is refused with WALLET_REFUSED; new WebSocket subscriptions answer an ERROR event, and a perpetual subscription already open stops receiving updates without one, so when updates stop, read the REST calls; unsubscribing always works.
The same call as Create Orders, with instrumentType set to FUTURE. BUY opens or grows a long and closes a short; SELL opens or grows a short and closes a long. amount is in the base asset. exchange names a venue quoting the perpetual (see exchanges in Instrument List); leave it out to let the platform route the order.
Perpetual Fields
| Field | Type | Required | Description |
|---|---|---|---|
| instrumentType | string | Yes | FUTURE |
| leverage | number | Optional | From 1 up to your leverage cap; a value above the cap is refused. Left out, the order takes the leverage of the position you hold on the contract (the lowest across venues when the order is routed), or 1, capped at your cap |
| reduceOnly | boolean | Optional | true only shrinks or closes your position. Default false |
[
{
"exchange": "HUOBI",
"globalInstrumentCd": "BTC/USDT",
"clientOrderId": "1760191200001",
"direction": "BUY",
"orderType": "MARKET",
"price": 112400.0,
"amount": 0.01,
"instrumentType": "FUTURE",
"leverage": 2
}
]
[
{
"exchange": "HUOBI",
"globalInstrumentCd": "BTC/USDT",
"clientOrderId": "1760191200001",
"direction": "BUY",
"orderType": "MARKET",
"amount": 0.01,
"orderStatus": "NEW",
"instrumentType": "FUTURE",
"leverage": 2,
"reduceOnly": false
}
]
[
{
"globalInstrumentCd": "BTC/USDT",
"clientOrderId": "1760191200001",
"orderStatus": "REJECTED",
"message": "Choose a leverage between 1x and 3x",
"instrumentType": "FUTURE",
"leverage": 5,
"reduceOnly": false
}
]
orderStatus REJECTED and the reason in message. An order on a venue that does not offer the perpetual of that pair comes back FAILED with the reason. Check each order in the array. The response carries leverage only when you sent one. Perpetual orders cannot be modified: an update comes back FAILED with the message "a perpetual order cannot be modified, cancel it and place a new one", and the order is left as it was. Cancel with Cancel Orders and place a new one. A cancel needs only the order's exchange, globalInstrumentCd and clientOrderId; the platform knows it is a perpetual. Active orders and order history show instrumentType, leverage and reduceOnly on perpetual orders; spot orders do not carry these fields.
REST equivalent of the WS PERP_POSITION channel snapshot. Your open perpetual positions, one per venue and contract. A closed position is not listed. Needs the Trade permission.
Response Fields
| Field | Type | Description |
|---|---|---|
| exchange | string | Venue holding the position |
| instrument | string | The pair, e.g. BTC/USDT |
| contractCode | string | The venue's contract, e.g. BTC-USDT |
| side | string | LONG or SHORT |
| size | number | Position size in the base asset, always positive; side gives the direction |
| averageEntryPrice | number | Average price the position was opened at |
| markPrice | number | Price the position is valued at |
| leverage | number | Leverage of the position |
| notional | number | Size times mark price, in the settle asset |
| unrealisedPnl | number | Profit or loss if closed at the mark price |
| initialMargin | number | Margin held for the position: its entry notional divided by its leverage |
| maintenanceMargin | number | Maintenance margin of the position at the venue's rate |
| liquidationPrice | number | Mark price at which the platform liquidates the position. Your positions share the margin of the futures wallet (cross margin), so this price moves with the wallet balance and your other positions |
| distanceToLiquidation | number | How far the mark price is from liquidationPrice, as a fraction of the mark price |
| state | string | State of your futures account, the same on each of its positions: HEALTHY, WARN, MARGIN_CALL or LIQUIDATING |
| updatedAt | string | When the figures were last computed (ISO-8601, UTC) |
[
{
"class": "PerpPosition",
"exchange": "HUOBI",
"instrument": "BTC/USDT",
"contractCode": "BTC-USDT",
"side": "LONG",
"size": 0.01,
"averageEntryPrice": 112380.5,
"markPrice": 112910.2,
"leverage": 2,
"notional": 1129.1,
"unrealisedPnl": 5.3,
"initialMargin": 561.9,
"maintenanceMargin": 5.65,
"liquidationPrice": 14123.21,
"distanceToLiquidation": 0.8749,
"state": "HEALTHY",
"updatedAt": "2026-10-11T14:02:11.204Z"
}
]
REST equivalent of the WS PERP_RISK channel snapshot. The margin and risk of your futures wallet, one row per venue and settle asset. Needs the Trade permission.
Response Fields
| Field | Type | Description |
|---|---|---|
| exchange | string | Venue of the futures wallet |
| settleAsset | string | Asset the wallet and its positions settle in, e.g. USDT |
| walletBalance | number | Collateral in the futures wallet |
| equity | number | walletBalance plus unrealisedPnl |
| unrealisedPnl | number | Unrealised profit or loss of all positions |
| initialMarginUsed | number | Margin held by open positions |
| orderMargin | number | Margin held by open orders |
| availableMargin | number | Margin free for new orders and for moving back to spot |
| maintenanceMargin | number | Sum of the positions' maintenance margins at the venue's rate |
| marginRatio | number | The platform's maintenance margin over equity. The platform's maintenance rate is the venue's rate plus a liquidation buffer, so this is higher than maintenanceMargin over equity. WARN, MARGIN_CALL and liquidation are judged on it; liquidation starts at 1 |
| nearestLiquidationPrice | number | The closest liquidation price among your positions |
| realisedPnl | number | Profit or loss realised by closed positions |
| cumulativeFees | number | Trading fees on futures net of rebates: a charge is positive and is taken from walletBalance |
| cumulativeFunding | number | Funding paid (negative) and received (positive) |
| state | string | HEALTHY, WARN, MARGIN_CALL or LIQUIDATING |
| tradingBlocked | boolean | true while new risk-increasing orders are refused |
| markStale | boolean | true when the mark price is out of date and the figures may lag |
| updatedAt | string | When the figures were last computed (ISO-8601, UTC) |
[
{
"class": "PerpRisk",
"exchange": "HUOBI",
"settleAsset": "USDT",
"walletBalance": 999.43,
"equity": 1004.73,
"unrealisedPnl": 5.3,
"initialMarginUsed": 561.9,
"orderMargin": 0,
"availableMargin": 442.83,
"maintenanceMargin": 5.65,
"marginRatio": 0.0169,
"nearestLiquidationPrice": 14123.21,
"realisedPnl": 0,
"cumulativeFees": 0.45,
"cumulativeFunding": -0.12,
"state": "HEALTHY",
"tradingBlocked": false,
"markStale": false,
"updatedAt": "2026-10-11T14:02:11.204Z"
}
]
Moves collateral between your spot wallet and your futures wallet on one exchange, through Create Transfer. Name the same exchange as fromExchange and toExchange, set the two wallets, and move the settle asset, USDT.
Additional Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| fromAccountType | string | Optional | Wallet the funds leave: SPOT (default) or USDT_FUTURES |
| toAccountType | string | Optional | Wallet the funds reach: SPOT (default) or USDT_FUTURES |
{
"fromExchange": "HUOBI",
"toExchange": "HUOBI",
"cryptoAssetCode": "USDT",
"transferAmount": 1000,
"fromAccountType": "SPOT",
"toAccountType": "USDT_FUTURES"
}
{
"class": "TransferWorkflow",
"fromExchange": "HUOBI",
"toExchange": "HUOBI",
"cryptoAssetCode": "USDT",
"transferAmount": 1000,
"fromAccountType": "SPOT",
"toAccountType": "USDT_FUTURES",
"processInstanceId": "b1f4c0de-5b8e-11f1-9a51-0242ac120004",
"state": "STARTED"
}
409 with state WALLET_REFUSED and the reason in message: futures transfers switched off, a move between two exchanges, a move other than spot to futures or back, an exchange without a futures wallet, an asset other than the settle asset, or an amount that is not positive or has more than 8 decimals. A managed-portfolio account is refused with 403. A move out of futures takes only what is not held as margin: check availableMargin in Futures Risk first, because a larger amount is accepted at start and then fails, leaving the collateral in the futures wallet. Your futures balance is also in Balance Distribution with includeFutures=true.
{
"class": "TransferWorkflow",
"state": "WALLET_REFUSED",
"message": "Only USDT moves between Spot and Futures"
}
REST equivalent of the WS PERP_ORDER_BOOK_PUBLIC snapshot. The order book of each perpetual asked for, one book per venue quoting it, 20 levels a side, best first, in the shape of Order Book. Amounts are in the base asset.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruments | query | string[] | Yes | Perpetual pairs, e.g. BTC/USDT. A pair not open to clients returns no book |
[
{
"class": "OrderBook",
"symbol": "BTC/USDT",
"exchange": "HUOBI",
"bids": [[112399.9, 1.204], [112399.5, 0.37]],
"asks": [[112400.0, 0.851], [112400.6, 2.06]],
"eventTime": 1760191331204
}
]
The funding rates a perpetual open to clients settled on one exchange between two times. A positive rate means longs pay shorts. What funding did to your own wallet is in the Journal as Funding Fee and Funding Income.
Query Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | string | Yes | Venue, e.g. HUOBI |
| instrument | query | string | Yes | The pair (BTC/USDT) or the contract (BTC-USDT) |
| from | query | long | Yes | Start, Unix epoch milliseconds |
| to | query | long | Yes | End, Unix epoch milliseconds; after from and at most 90 days after it |
A missing or negative bound, to before from, a window over 90 days, an unknown exchange or a perpetual not open on that exchange answers 400. 503 means the rates could not be read; try again.
Response Fields
| Field | Type | Description |
|---|---|---|
| exchange | string | Venue |
| instrumentCd | string | The venue's contract |
| fundingTime | long | Settlement time, Unix epoch milliseconds |
| fundingRate | number | Rate settled at fundingTime |
| realizedRate | number | Not populated yet; always null |
[
{
"exchange": "HUOBI",
"instrumentCd": "BTC-USDT",
"fundingTime": 1760169600000,
"fundingRate": 0.0001,
"realizedRate": null
}
]
Yield
Yield earns the funding rate on a perpetual swap while holding the matching spot position, so the contract carries no net price exposure. You subscribe an amount of the quote asset, the platform buys the base asset spot and shorts the same quantity on the perpetual, and the funding it collects is credited to you daily, less the performance fee. A contract runs until you redeem it.
status and step.
The terms a subscription must meet, and how much you can subscribe from each funding venue right now.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/yield/product HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"enabled": true,
"quoteAsset": "USDT",
"baseAssets": ["DOGE"],
"minAmount": 50,
"maxAmount": 100000,
"performanceFeePercent": 15,
"venue": "HTX",
"venueExchange": "HUOBI",
"headlineApyPercent": 10.5,
"fundingVenues": [
{
"exchange": "HUOBI",
"freeBalance": 1250.4,
"maxSubscribable": 1250.4
},
{
"exchange": "OPENTRADE",
"freeBalance": 5000,
"maxSubscribable": 5000
}
]
}
Product Fields
| Field | Type | Description |
|---|---|---|
| enabled | boolean | false while Yield is closed to new subscriptions; open contracts keep running |
| quoteAsset | string | Asset you subscribe and are paid in |
| baseAssets | array | Assets a contract can be built on |
| minAmount / maxAmount | number | Limits on one subscription, in quoteAsset |
| performanceFeePercent | number | Share of the gross funding income kept as the performance fee |
| venue | string | Where the strategy runs |
| venueExchange | string | The exchange code of that venue. A fundingVenues entry other than it, such as OPENTRADE for your wallet, is moved there first and the network fee of that move comes out of the amount |
| headlineApyPercent | number | Indicative annual rate, when one is published; not a promise |
| fundingVenues | array | Per venue you can fund from, OPENTRADE being your wallet: its freeBalance in quoteAsset and the maxSubscribable amount after the limits |
Starts a contract with the amount you name, taken from one funding venue. Send a clientRequestId of your own on every subscription: a repeat of the same request, after a timeout say, returns the contract the first one started instead of starting a second.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| baseAsset | string | Yes | One of the product's baseAssets, e.g. DOGE |
| amount | number | Yes | Principal in quoteAsset, between minAmount and maxAmount |
| sourceExchange | string | Optional | Funding venue, one of fundingVenues. Defaults to the product's funding venue. OPENTRADE funds from your wallet: the amount is moved to venueExchange first, the network fee comes out of it, and minAmount applies to what arrives |
| confirmedNetworkFee | number | Optional | When funding from the wallet, the network fee you were quoted by Transfer Fee Quote for OPENTRADE to venueExchange. The subscription is refused if the fee has since risen beyond the tolerance |
| clientRequestId | string | Optional | Your idempotency key, up to 64 characters |
POST /hermes-ws-gateway/api/rest/yield/subscriptions HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"baseAsset": "DOGE",
"amount": 1000,
"sourceExchange": "HUOBI",
"clientRequestId": "bot-2026-09-22-001"
}
{
"contractId": "7c1d5e2a-5b8e-11f1-9a51-0242ac120004",
"created": true
}
202 means a new contract was started. 200 with "created": false means this clientRequestId had already started the contract named. A refused subscription starts nothing and moves nothing, and answers with the status below and a body of refusal and message:
{
"created": false,
"refusal": "INSUFFICIENT_FUNDS",
"message": "Only 420 USDT is free on HUOBI"
}
Refusal Codes
| refusal | HTTP | Meaning |
|---|---|---|
| PRODUCT_DISABLED | 409 | Yield is not open for subscriptions |
| INVALID_REQUEST | 400 | A required field is missing or malformed, e.g. no asset, a non-positive amount or a clientRequestId over 64 characters |
| ASSET_NOT_OFFERED | 409 | The asset is not in baseAssets |
| VENUE_NOT_OFFERED | 409 | sourceExchange is not one of fundingVenues |
| BELOW_MINIMUM / ABOVE_MAXIMUM | 409 | The amount is outside minAmount–maxAmount |
| INSUFFICIENT_FUNDS | 409 | The funding venue's free balance does not cover the amount |
| MONEY_MOVES_NOT_OFFERED | 409 | Your account's money is not moved by Open Trade, so it cannot fund from the wallet |
| FEE_UNAVAILABLE | 409 | The network fee of the move to the venue cannot be quoted right now |
| TRANSFER_REFUSED | 409 | The move to the venue is refused: the route is paused, the amount does not cover the fee, or the fee moved past the confirmedNetworkFee |
| CONTRACT_NOT_FOUND | 404 | No contract of yours has that id |
| NOT_REDEEMABLE | 409 | The contract cannot be redeemed now; message names its stage |
| NOT_CANCELLABLE | 409 | The contract is past subscribing and can only be redeemed |
/open returns every contract that has not settled, as a plain list. /closed returns the settled ones — redeemed, matured, cancelled or failed — a page at a time, newest first.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| dateFrom | query | string | Optional | Closed only. ISO date; contracts started on or after it |
| dateTo | query | string | Optional | Closed only. ISO date; contracts started on or before it |
| page | query | integer | Optional | Closed only. Zero-based page, default 0 |
| pageSize | query | integer | Optional | Closed only. Default 50, at most 200; outside that is rejected with 400 |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/yield/contracts/closed?page=0&pageSize=50 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Each entry is a contract as Get Contract returns it; /closed wraps them as { "items": [...], "page": 0, "pageSize": 50, "totalItems": 3, "totalPages": 1 }.
One contract, with its legs, its income so far, the income accrued since the last credit, and each credit. Answers 404 for an id that is not one of your contracts.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| contractId | path | string | Yes | The contract's contractId |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/yield/contracts/7c1d5e2a-5b8e-11f1-9a51-0242ac120004 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"contractId": "7c1d5e2a-5b8e-11f1-9a51-0242ac120004",
"clientId": 24240001,
"clientRequestId": "bot-2026-09-22-001",
"baseAsset": "DOGE",
"quoteAsset": "USDT",
"contractCode": "DOGE-USD",
"status": "ACTIVE",
"statusLabel": "Active",
"step": "Active — earning",
"redeemable": true,
"cancellable": false,
"redemptionRequested": false,
"fundingVenue": "HUOBI",
"fundedFrom": "HUOBI",
"requestedAmount": null,
"fundingNetworkFee": null,
"venue": "HUOBI",
"redemptionWithdrawsFromVenue": false,
"principal": 1000,
"performanceFeePercent": 15,
"openedAt": "2026-09-01T09:14:05",
"spotFilledQty": 4012,
"spotAvgPrice": 0.2489,
"perpContracts": 4012,
"perpAvgPrice": 0.2491,
"cumulativeYieldGross": 9.41,
"cumulativeFees": 1.41,
"cumulativeYieldNet": 8,
"pendingYieldBase": 2.5,
"pendingYieldQuote": 0.62,
"pendingYieldNet": 0.527,
"lastHarvestAt": "2026-09-22T00:10:00",
"credits": [
{
"creditedAt": "2026-09-22T00:10:00",
"grossAmount": 0.47,
"feeAmount": 0.07,
"netAmount": 0.4,
"baseAssetAmount": 1.89
}
]
}
Contract Fields
| Field | Type | Description |
|---|---|---|
| contractId | string | Identifier of the contract; use it on every per-contract endpoint |
| clientRequestId | string | The idempotency key the subscription was made with, null when none was sent |
| status | string | SUBSCRIBING, ACTIVE, HARVESTING, REDEEMING, PENDING_UNWIND, CLOSED, CANCELLED or FAILED |
| contractCode | string | The perpetual the hedge is held in, e.g. DOGE-USD; its second part is the currency perpAvgPrice is quoted in |
| statusLabel | string | The status in client wording, as the web app shows it |
| step | string | What the contract is doing right now, in client wording; null once it has settled |
| redeemable | boolean | true while the contract is earning and no redemption has been asked for |
| cancellable | boolean | true while the contract is still being built and no cancellation has been asked for |
| redemptionRequested | boolean | A redemption or cancellation has been asked for and is being worked |
| fundingVenue | string | Where the principal was taken from; OPENTRADE when it came from your wallet |
| fundedFrom | string | Same as fundingVenue |
| requestedAmount | number | Amount debited from your wallet when the contract was funded from it, before the network fee; null otherwise |
| fundingNetworkFee | number | Network fee charged on that move; null when the principal was already on the venue |
| venue | string | Venue the strategy runs on |
| redemptionWithdrawsFromVenue | boolean | true when a redemption comes back through a venue withdrawal, which carries that venue's fee |
| principal | number | Amount subscribed, in quoteAsset |
| performanceFeePercent | number | Share of the gross funding income kept as the performance fee |
| openedAt / closedAt / cancelledAt | string | When the contract started earning, settled, or was cancelled (UTC) |
| subscriptionTransferFee | number | Fee taken from the principal to move it to the venue, when it had to move |
| spotFilledQty / spotAvgPrice | number | The long spot leg: quantity bought and its average price |
| perpContracts / perpAvgPrice | number | The short perpetual leg: size and its average price |
| cumulativeYieldGross / cumulativeFees / cumulativeYieldNet | number | Funding income credited so far, the performance fee on it, and what reached you, in quoteAsset |
| pendingYieldBase / pendingYieldQuote | number | Income accrued since the last credit and not yet sold, in the base asset and its current quoteAsset value |
| pendingYieldNet | number | pendingYieldQuote less the performance fee: what the pending income would add to your balance |
| lastHarvestAt | string | When income was last credited |
| credits | array | One entry per credit: creditedAt, grossAmount, feeAmount, netAmount, baseAssetAmount |
| redemptionAmount / redemptionTransferFee | number | What a settled contract returned to you and the venue withdrawal fee taken from it |
| redemptionReason | string | CLOSE, CANCEL or MATURITY once a redemption has started |
| txId | string | On-chain transaction of the principal's move to the venue, when it had to move |
/summary totals every contract you have held; /contracts/{contractId}/performance gives the same figures for one contract. Both are what the web app's Yield page shows.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| contractId | path | string | Yes | Contract performance only |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/yield/summary HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"openPrincipal": 1000,
"currentValue": 1008.527,
"lifetimeIncome": 8,
"lifetimeFees": 1.41,
"openContracts": 1,
"deployedContracts": 1,
"apyPercent": 13.9,
"pendingByAsset": { "DOGE": 2.5 },
"pendingValue": 0.527,
"pendingUnreadable": false,
"estimatedDays": false,
"nav": [
{ "date": "2026-09-21", "value": 1007.6, "income": 0.41 },
{ "date": "2026-09-22", "value": 1008.53, "income": 0.4 }
]
}
Performance Fields
| Field | Type | Description |
|---|---|---|
| openPrincipal | number | Principal of the contracts still open |
| currentValue | number | openPrincipal plus the income they have earned, credited and pending, net of the performance fee |
| lifetimeIncome / lifetimeFees | number | Net income credited and performance fees charged, over every contract |
| openContracts / deployedContracts | integer | Contracts still open, and contracts that ever put principal to work |
| apyPercent | number | Annualised return on the principal-days deployed; null until a week of history exists |
| pendingByAsset / pendingValue | object / number | Income accrued since the last credit: gross per base asset, and in quoteAsset net of the performance fee |
| pendingUnreadable | boolean | true when pending income could not be read just now; it is then left out of the figures |
| estimatedDays | boolean | true when some income could not be placed on the day it was earned and is spread evenly over the contract's life, so the daily figures in nav are partly estimated |
| nav | array | Daily series over up to two years: the date, the position value at the end of it, and the income earned that day |
The fee a redemption would take from what it returns. When redemptionWithdrawsFromVenue is false the funds come back without a withdrawal and feeAmount is 0; otherwise it is the venue's current withdrawal fee, in the same shape as Transfer Fee Quote. The fee is charged at the price in force when the funds leave the venue, which may differ from this quote.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| contractId | path | string | Yes | The contract's contractId |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/yield/contracts/7c1d5e2a-5b8e-11f1-9a51-0242ac120004/redemption-quote HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"cryptoAssetCode": "USDT",
"amount": 1000,
"fromExchange": "HUOBI",
"toExchange": "OPENTRADE",
"quoted": true,
"sendable": true,
"feeAssetCode": "USDT",
"feeAmount": 0
}
/redeem closes an earning contract: both legs are unwound at market and the principal plus any income not yet credited comes back to your balance, less the fee in Redemption Fee Quote. /cancel stops a contract that is still being built and returns what had been deployed. Check redeemable or cancellable on the contract first. Neither can be undone.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| contractId | path | string | Yes | The contract's contractId |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
POST /hermes-ws-gateway/api/rest/yield/contracts/7c1d5e2a-5b8e-11f1-9a51-0242ac120004/redeem HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"contractId": "7c1d5e2a-5b8e-11f1-9a51-0242ac120004",
"contract": { "status": "ACTIVE", "redemptionRequested": true, ... }
}
202 means the request was accepted; contract is the contract as it now stands. A contract that cannot be redeemed or cancelled now answers 409 with NOT_REDEEMABLE or NOT_CANCELLABLE, and an id that is not yours answers 404 with CONTRACT_NOT_FOUND — see Refusal Codes.
{
"contractId": "7c1d5e2a-5b8e-11f1-9a51-0242ac120004",
"refusal": "NOT_REDEEMABLE",
"message": "The contract is subscribing and cannot be redeemed now"
}
Yield Basket
Yield Basket is a second way to hold Yield: one managed mix of assets, with funding paid in USDT. You subscribe USDT and receive OTY-B units at the net asset value (NAV) per unit. The mix is managed for you, and your holding is worth your units at the latest NAV.
403 with NOT_PERMITTED.
dealsAt on your request, and poll Open Requests to follow it.
The terms of Yield Basket, the latest NAV and what the basket holds.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/yield-basket/product HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"portfolioCode": "YIELD-BASKET",
"name": "Yield Basket",
"unitTicker": "OTY-B",
"description": "A managed mix of assets, with funding paid in USDT",
"status": "ACTIVE",
"enabled": true,
"subscriptionsPaused": false,
"redemptionsPaused": false,
"minSubscriptionUsd": 100,
"maxSubscriptionUsd": 250000,
"minRedemptionUsd": 100,
"dealingCadenceMinutes": 1440,
"nextDealingAt": "2026-11-03T00:00:00Z",
"factSheetUrl": null,
"navPerUnit": 1.0342,
"navStruckAt": "2026-11-02T00:00:00Z",
"composition": [
{ "asset": "SOL", "weightPercent": 60 },
{ "asset": "XRP", "weightPercent": 40 }
],
"venues": [
{ "venue": "HUOBI", "weightPercent": 100 }
],
"fundingAssets": ["USDT"],
"performanceFeePercent": 15,
"redemptionNoticeDays": 0,
"nextRedemptionDealingAt": "2026-11-03T00:00:00Z",
"marginUsdtShare": 0.2
}
Product Fields
| Field | Type | Description |
|---|---|---|
| portfolioCode / name / unitTicker | string | The product's code, its name and the ticker of its units |
| description | string | A short description of the product |
| status / enabled | string / boolean | The product's state, and whether it is open to clients. enabled stays true for an account that still holds units or a queued request after the product closes, so read the pause flags to decide whether you can subscribe or redeem |
| subscriptionsPaused / redemptionsPaused | boolean | true while new requests of that kind are held back. Subscriptions can pause on their own during fast markets. While the basket is closing, subscriptions stay paused, queued subscriptions are returned at the next dealing, and redemptions stay open |
| minSubscriptionUsd / maxSubscriptionUsd | number | Limits on one subscription, after any fee |
| minRedemptionUsd | number | Smallest redemption, by value at the latest NAV. It does not apply when you redeem all your free units |
| dealingCadenceMinutes | integer | Minutes between dealings: 1440 is daily |
| nextDealingAt | string | When the next dealing runs (UTC) |
| factSheetUrl | string | Link to the fact sheet, when one is published |
| navPerUnit / navStruckAt | number / string | The latest NAV per unit and when it was struck |
| composition | array | The coins held, each with its weightPercent at the latest NAV. The weights add up to 100 and leave out the USDT in marginUsdtShare. Before the first NAV they are the target mix. The mix changes as it is managed |
| venues | array | Where the basket is held, each with its weightPercent |
| fundingAssets | array | Assets you can subscribe with: USDT only |
| performanceFeePercent | number | Performance fee, charged only on a NAV above the high-water mark of your own units |
| redemptionNoticeDays | integer | Days a redemption waits before it can deal; 0 means the next dealing |
| nextRedemptionDealingAt | string | The first dealing a redemption asked now can reach, after the notice period (UTC) |
| marginUsdtShare | number | Target share of the basket kept in USDT, as a fraction: 0.2 is 20% |
Your units and what they are worth at the latest NAV. An account with no units gets zeros, with firstSubscribedAt, highWaterNav and feesPaidUsdt left null.
GET /hermes-ws-gateway/api/rest/yield-basket/holding HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"units": 994.17,
"lockedUnits": 0,
"costBasisUsd": 1000,
"investedUsd": 1000,
"marketValueUsd": 1028.17,
"firstSubscribedAt": "2026-10-01T00:00:00Z",
"markToMarketUsd": -4.1,
"tradingUsd": 38.3,
"highWaterNav": 1.0342,
"feesPaidUsdt": -6.03,
"navSeries": [
{ "date": "2026-11-02T00:00:00Z", "navPerUnit": 1.0342, "benchmark": null }
],
"venueSlices": [
{ "venue": "HUOBI", "valueUsd": 1028.17 }
]
}
Holding Fields
| Field | Type | Description |
|---|---|---|
| units | number | OTY-B units you hold |
| lockedUnits | number | Units held for a redemption that has not dealt yet |
| costBasisUsd | number | Cost of the units you still hold |
| investedUsd | number | Total subscribed through dealings that have settled |
| marketValueUsd | number | Your units at the latest NAV |
| firstSubscribedAt | string | When your first subscription dealt (UTC) |
| markToMarketUsd / tradingUsd | number | What has moved your value so far, split into market moves and trading. Signed |
| highWaterNav | number | The NAV your units must pass before a performance fee is charged again |
| feesPaidUsdt | number | Total performance fees charged so far, in USDT. Signed: a charge is negative |
| navSeries | array | NAV per unit over the time you have held, by date |
| venueSlices | array | Your value by venue |
What has happened to your holding, newest first: settled subscriptions and redemptions, fees, and each day's change in value.
GET /hermes-ws-gateway/api/rest/yield-basket/activity HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
[
{
"date": "2026-11-02T00:00:00Z",
"type": "FEE",
"description": "Performance fee",
"units": -5.83,
"amountUsd": -6.03,
"feeUsd": null,
"navPerUnit": 1.0342
},
{
"date": "2026-10-01T00:00:00Z",
"type": "SUBSCRIPTION",
"description": "Subscribed with USDT",
"units": 1000,
"amountUsd": 1000,
"feeUsd": 0,
"navPerUnit": 1
}
]
Activity Fields
| Field | Type | Description |
|---|---|---|
| date | string | When it happened (UTC) |
| type | string | SUBSCRIPTION, REDEMPTION, FEE, MARK_TO_MARKET or TRADING |
| description | string | A short line to show a person |
| units | number | Units added, or taken away when negative. null on a change in value |
| amountUsd | number | Value of the line. Signed: money out, losses and a FEE line are negative |
| feeUsd | number | Fee charged with a subscription or redemption. Signed: a charge is negative. null on a FEE line, whose fee is its amountUsd, and on a change in value |
| navPerUnit | number | The NAV the line dealt at. null on a change in value |
Your subscriptions and redemptions that have not finished, newest first.
GET /hermes-ws-gateway/api/rest/yield-basket/requests/open HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
[
{
"reference": "CPS-3f6c2a14-9d0e-4b7a-8e21-5c1f0a7d4b92",
"type": "SUBSCRIPTION",
"status": "AWAITING_DEALING",
"sourceAsset": "USDT",
"grossAmount": 1000,
"feeAmount": 0,
"netAmount": 1000,
"requestedUnits": null,
"createdAt": "2026-11-02T09:14:08Z",
"dealsAt": "2026-11-03T00:00:00Z"
}
]
Request Fields
| Field | Type | Description |
|---|---|---|
| reference | string | The id to quote when you cancel |
| type | string | SUBSCRIPTION or REDEMPTION |
| status | string | See the table below |
| sourceAsset | string | The asset subscribed: USDT |
| grossAmount / feeAmount / netAmount | number | On a subscription, the amount asked for and what remains after any fee. feeAmount is that fee as a positive figure, 0 on a redemption, which has no gross or net amount |
| requestedUnits | number | Units asked for in a redemption |
| createdAt / dealsAt | string | When you asked, and the dealing the request is due at (UTC). dealsAt is set only while the request is AWAITING_DEALING. On a redemption it already counts the notice period |
Request Status
| status | Meaning |
|---|---|
| AWAITING_DEALING | Queued for dealing. The only status you can cancel from |
| DEALING | In today's dealing |
| SETTLING | Dealt, with the units or USDT on their way |
| ON_HOLD | Held for a check by our team |
| SETTLED | Finished |
| CANCELLED | Cancelled, with nothing dealt |
| FAILED | Could not be completed |
Asks to buy units with USDT at the next dealing. The USDT is set aside straight away, and your units arrive after dealing, at that day's NAV. A repeat of the same request with the same clientRequestId, after a timeout say, answers with the request the first one made instead of making a second.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| sourceAsset | string | Yes | USDT |
| amount | number | Yes | USDT to subscribe, up to 8 decimal places, between minSubscriptionUsd and maxSubscriptionUsd |
| clientRequestId | string | Yes | Your idempotency key, up to 64 characters |
POST /hermes-ws-gateway/api/rest/yield-basket/subscriptions HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"sourceAsset": "USDT",
"amount": 1000,
"clientRequestId": "bot-2026-11-02-001"
}
{
"reference": "CPS-3f6c2a14-9d0e-4b7a-8e21-5c1f0a7d4b92",
"status": "AWAITING_DEALING",
"dealsAt": "2026-11-03T00:00:00Z"
}
202 means the request was accepted. A refused request moves nothing, and answers with the status below and a body of refusal and message:
{
"refusal": "SUBSCRIPTIONS_PAUSED",
"message": "New subscriptions are paused for now."
}
Refusal Codes
| refusal | HTTP | Meaning |
|---|---|---|
| PRODUCT_NOT_FOUND | 404 | Yield Basket is not offered |
| PRODUCT_DISABLED | 409 | Yield Basket is not open at the moment |
| SUBSCRIPTIONS_PAUSED / REDEMPTIONS_PAUSED | 409 | Requests of that kind are paused for now |
| INVALID_REQUEST | 400 | A required field is missing or malformed, or the clientRequestId was already used for a different request |
| ASSET_NOT_OFFERED | 409 | sourceAsset is not in fundingAssets |
| BELOW_MINIMUM / ABOVE_MAXIMUM | 409 | The amount after any fee is outside the product's limits, or a redemption is below minRedemptionUsd |
| INSUFFICIENT_FUNDS | 409 | Your free USDT does not cover the amount |
| INSUFFICIENT_UNITS | 409 | You hold fewer free units than you asked to redeem |
| REQUEST_NOT_FOUND | 404 | No request of yours has that reference |
| NOT_CANCELLABLE | 409 | The request has left AWAITING_DEALING |
| NOT_PERMITTED | 403 | This account may not do this |
| UNAVAILABLE | 503 | Try again shortly, with the same clientRequestId. A 503 can also come with no body, and the request may then have gone through, so repeat it with the same clientRequestId |
Asks to sell units for USDT at a daily dealing. The units are locked straight away and burned at that day's NAV. The USDT reaches your balance once the basket has raised it, which can take longer than the dealing itself. A notice period applies when redemptionNoticeDays is above zero.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| units | number | Yes | Units to redeem, no more than units less lockedUnits |
| clientRequestId | string | Yes | Your idempotency key, up to 64 characters |
POST /hermes-ws-gateway/api/rest/yield-basket/redemptions HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"units": 250,
"clientRequestId": "bot-2026-11-02-002"
}
{
"reference": "CPR-a81d47e6-2c35-4f09-b6d3-19e7c0f25a68",
"status": "AWAITING_DEALING",
"dealsAt": "2026-11-03T00:00:00Z"
}
A refused request locks nothing and answers as in Refusal Codes.
Cancels a subscription or redemption that is still AWAITING_DEALING and hands back the USDT or units set aside for it. Once dealing has started it answers 409 with NOT_CANCELLABLE. Cancelling a request that is already cancelled answers with that request again.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| reference | path | string | Yes | The request's reference |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
POST /hermes-ws-gateway/api/rest/yield-basket/requests/CPR-a81d47e6-2c35-4f09-b6d3-19e7c0f25a68/cancel HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"reference": "CPR-a81d47e6-2c35-4f09-b6d3-19e7c0f25a68",
"status": "CANCELLED",
"dealsAt": null
}
Portfolio Builder
The Portfolio Builder lets you design a portfolio of spot assets and Yield, study it, save it, and hand it to the platform to manage. Read the limits with Configuration, choose assets from Universe or start from a Suggested Portfolio, check a mix with Analytics and Backtest, and keep it with Saved Portfolios.
A saved portfolio becomes a managed portfolio when you subscribe it. The platform takes the amount from your free USDT and/or USDC, moves it into the managed portfolio's own sub-account (accountClientId), and buys each target asset. It then rebalances back to the target weights on the 1st of every month at 01:00 UTC (nextCycleAt), until you stop it. When you save a new version of the portfolio, a running managed portfolio keeps its version until you tell it to follow the latest one.
All paths are under /hermes-ws-gateway/api/rest/portfolio. Send Authorization and X-API-Version: 1.0.0 on every call, as elsewhere on this page.
clientId sent in a body is ignored.
0 to 100, never a share of 1: weightPercent, targetWeightPercent, targetWeight and currentWeight alike. A portfolio of 50% BTC is 50.
value, cashBalance and holdings.
stage.
The limits a portfolio must respect, and the defaults the other calls use when you leave a field out. Read it before you build a portfolio.
GET /hermes-ws-gateway/api/rest/portfolio/config HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"quoteAsset": "USDT",
"constituentCount": 7,
"maxWeightPercent": 25,
"minWeightPercent": 3,
"weightStepPercent": 0.5,
"maxYieldWeightPercent": 40,
"riskFreeRatePercent": 4.00,
"lookbackDays": 365,
"lookbackChoices": [90, 180, 365],
"ewmaLambda": 0.94,
"maxPortfoliosPerClient": 10,
"yieldProducts": [
{ "baseAsset": "DOGE", "trailingAprPercent": 9.8 }
],
"riskBands": [
{ "label": "Lower risk", "maxVolatilityPercent": 60 },
{ "label": "Medium risk", "maxVolatilityPercent": 80 },
{ "label": "High risk", "maxVolatilityPercent": null }
],
"yieldAssumedAprPercent": null
}
Configuration Fields
| Field | Type | Description |
|---|---|---|
| quoteAsset | string | Asset every value and price is expressed in, USDT |
| constituentCount | integer | Number of spot assets in the platform's own market-cap mix |
| maxWeightPercent | number | Default cap on one spot asset's weight. A saved portfolio may set its own cap between 5 and 100 in rules |
| minWeightPercent | number | Lowest weight the platform's own mix gives a spot asset. Your own portfolios only need weights above zero |
| weightStepPercent | number | Default step every weight must be a whole number of: 0.1, 0.5 or 1 |
| maxYieldWeightPercent | number | Most of a portfolio that Yield may take, all Yield constituents together. A portfolio may set a lower cap, never a higher one |
| riskFreeRatePercent | number | Annual risk-free rate used for Sharpe ratios when you send none |
| lookbackDays | integer | Default days of price history behind analytics, and the window every backtest covers |
| lookbackChoices | array | The lookbackDays values Analytics accepts |
| ewmaLambda | number | Decay of the exponentially weighted forecast of volatility |
| maxPortfoliosPerClient | integer | Most saved portfolios one account may keep |
| yieldProducts | array | Assets offered as Yield constituents: baseAsset and its trailingAprPercent, the annualised funding income of recent days after the performance fee |
| riskBands | array | Named bands of annualised volatility: label and maxVolatilityPercent, null for the top band |
| yieldAssumedAprPercent | number | When set, the steady APR analytics and backtests assume for Yield constituents instead of their funding history; null when the history is used |
The spot assets a portfolio may hold, largest market cap first. A spot constituent that is not listed here is refused when you save. Yield constituents are listed under yieldProducts in Configuration.
[
{
"asset": "BTC",
"marketCap": 2238000000000,
"rankPosition": 1,
"oneYearVolatilityPercent": 41.7
},
{
"asset": "ETH",
"marketCap": 501000000000,
"rankPosition": 2,
"oneYearVolatilityPercent": 63.2
},
{
"asset": "DOGE",
"marketCap": 37600000000,
"rankPosition": 8,
"oneYearVolatilityPercent": 88.5
}
]
| Field | Type | Description |
|---|---|---|
| asset | string | Asset code, as you send it in a constituent |
| marketCap | number | Market capitalisation in USD |
| rankPosition | integer | Position by market cap, 1 being the largest |
| oneYearVolatilityPercent | number | Annualised volatility over the last year; null when there is too little price history |
Ready-made portfolios to start from. Each carries its weights and its historical one-day tail risk. To use one, save its weights as a portfolio of your own with Saved Portfolios.
[
{
"asOf": "2026-10-16T08:00:00Z",
"name": "Balanced",
"weights": [
{
"asset": "BTC",
"targetWeight": 50,
"rawWeight": 50,
"marketCap": 2238000000000,
"rankPosition": 1,
"capped": false,
"constituentType": "SPOT"
},
{
"asset": "ETH",
"targetWeight": 30,
"rawWeight": 30,
"marketCap": 501000000000,
"rankPosition": 2,
"capped": false,
"constituentType": "SPOT"
},
{
"asset": "DOGE",
"targetWeight": 20,
"rawWeight": 20,
"marketCap": null,
"rankPosition": 3,
"capped": false,
"constituentType": "YIELD"
}
],
"var95Percent": -3.91,
"cvar95Percent": -5.62,
"tailSampleSize": 365
}
]
| Field | Type | Description |
|---|---|---|
| asOf | string | When the list was built (UTC) |
| name | string | Name of the suggested portfolio |
| weights | array | One entry per constituent, below |
| weights[].asset | string | Asset code |
| weights[].constituentType | string | SPOT (the asset is held) or YIELD (the asset's Yield is held) |
| weights[].targetWeight | number | Weight in percent, 0–100; the weights add up to 100 |
| weights[].rawWeight | number | Weight in percent before any cap was applied |
| weights[].capped | boolean | true when a cap lowered the weight |
| weights[].marketCap / rankPosition | number | Market cap in USD (null for Yield) and the constituent's position in the list |
| var95Percent / cvar95Percent | number | Historical one-day 95% value at risk and expected shortfall, in percent of value: the 5th-percentile daily return and the average of the worst 5% of days. Negative numbers are losses; null when there is too little history |
| tailSampleSize | integer | Number of daily returns the tail figures come from |
Risk and return of a mix you name, from daily price history: statistics for each constituent and for the whole portfolio, each constituent's share of the risk, the correlation matrix, the efficient frontier, and value at risk. Nothing is saved or traded.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| constituents | array | Yes | One entry per constituent: type (SPOT or YIELD), asset and weightPercent. Each pair of type and asset at most once, no negative weight, at most 50 constituents. The weights are scaled to the constituents that have price history, so they need not add up to 100 |
| lookbackDays | integer | Optional | One of lookbackChoices. Defaults to lookbackDays in Configuration |
| riskFreeRatePercent | number | Optional | Annual rate for the Sharpe ratios, between -100 and 100. Defaults to riskFreeRatePercent |
| maxWeightPercent | number | Optional | Cap on one spot asset for the capped frontier, 5–100 |
| maxYieldWeightPercent | number | Optional | Cap on Yield for the capped frontier, from 0 to the configured cap |
| weightStepPercent | number | Optional | 0.1, 0.5 or 1; both caps must be whole numbers of it |
POST /hermes-ws-gateway/api/rest/portfolio/analytics HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"constituents": [
{ "type": "SPOT", "asset": "BTC", "weightPercent": 50 },
{ "type": "SPOT", "asset": "ETH", "weightPercent": 30 },
{ "type": "SPOT", "asset": "DOGE", "weightPercent": 20 }
],
"lookbackDays": 365,
"riskFreeRatePercent": 4,
"maxWeightPercent": 50
}
{
"asOf": "2026-10-15",
"lookbackDays": 365,
"riskFreeRatePercent": 4,
"ewmaLambda": 0.94,
"constituents": [
{
"type": "SPOT",
"asset": "BTC",
"weightPercent": 50,
"expectedReturnPercent": 38.4,
"historicalVolatilityPercent": 41.7,
"forecastVolatilityPercent": 36.9,
"sharpe": 0.82,
"forecastSharpe": 0.93,
"riskContributionPercent": 38.6,
"var95Percent": -3.42,
"cvar95Percent": -4.95
},
...
],
"portfolio": {
"expectedReturnPercent": 41.2,
"historicalVolatilityPercent": 52.3,
"forecastVolatilityPercent": 47.8,
"sharpe": 0.71,
"forecastSharpe": 0.78,
"diversificationRatio": 1.16,
"maxDrawdownPercent": -31.8,
"drawdownPeakDate": "2026-01-06",
"drawdownTroughDate": "2026-04-08",
"var95Percent": -4.18,
"cvar95Percent": -6.07
},
"correlation": {
"labels": ["BTC", "ETH", "DOGE"],
"matrix": [[1, 0.81, 0.72], [0.81, 1, 0.74], [0.72, 0.74, 1]]
},
"frontier": {
"capped": [ { "volatilityPercent": 41.7, "returnPercent": 38.4 }, ... ],
"uncapped": [ ... ],
"minVariance": { "volatilityPercent": 41.5, "returnPercent": 38.2, "sharpe": 0.82, "weights": [ ... ], "var95Percent": -3.40, "cvar95Percent": -4.91 },
"maxSharpe": { ... },
"capitalMarketLine": [ ... ]
},
"volatilitySeries": [
{ "date": "2026-10-15", "realised30dPercent": 44.1, "forecastPercent": 47.8 },
...
],
"exclusions": [],
"tailSampleSize": 365
}
Analytics Fields
| Field | Type | Description |
|---|---|---|
| asOf | string | Last day of price history used |
| lookbackDays | integer | Days of history the figures cover |
| riskFreeRatePercent / ewmaLambda | number | The risk-free rate and forecast decay the figures were worked out with |
| constituents | array | One entry per constituent with history: type, asset, weightPercent as sent, and the figures below for that constituent alone, plus riskContributionPercent, its share of the portfolio's volatility (the shares add up to 100) |
| expectedReturnPercent | number | Annualised mean daily return over the lookback |
| historicalVolatilityPercent | number | Annualised standard deviation of daily returns over the lookback |
| forecastVolatilityPercent | number | Annualised exponentially weighted forecast of volatility |
| sharpe / forecastSharpe | number | Excess return over the risk-free rate per unit of historical or forecast volatility |
| var95Percent / cvar95Percent | number | Historical one-day 95% value at risk and expected shortfall, in percent of value; negative numbers are losses |
| portfolio | object | The same figures for the whole mix, plus diversificationRatio (weighted constituent volatility over portfolio volatility), maxDrawdownPercent (deepest fall, as a negative percent) and the drawdownPeakDate and drawdownTroughDate it ran between |
| correlation | object | labels and the matching matrix of correlations of daily returns. A Yield constituent is labelled like DOGE Yield |
| frontier | object | The efficient frontier as points of volatilityPercent and returnPercent: capped respects the weight and Yield caps, uncapped does not; minVariance and maxSharpe are those two portfolios with their weights (type, asset, weightPercent); capitalMarketLine runs from the risk-free rate through maxSharpe |
| volatilitySeries | array | The portfolio's volatility day by day: date, realised30dPercent and forecastPercent, both annualised |
| exclusions | array | Constituents left out of the figures, each with type, asset and the reason, e.g. too little price history |
| tailSampleSize | integer | Number of daily returns the tail figures come from |
Replays a mix over the last lookbackDays of price history (see Configuration) two ways: managed is rebalanced back to the target weights at the start of every month, as a managed portfolio is; buyAndHold buys once and lets the weights drift. Nothing is saved or traded.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| constituents | array | Yes | type, asset and weightPercent, as for Analytics. Here the weights must add up to exactly 100 |
| startValue | number | Optional | Value at the start, above zero. Default 100 |
POST /hermes-ws-gateway/api/rest/portfolio/backtest HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"constituents": [
{ "type": "SPOT", "asset": "BTC", "weightPercent": 50 },
{ "type": "SPOT", "asset": "ETH", "weightPercent": 30 },
{ "type": "SPOT", "asset": "DOGE", "weightPercent": 20 }
],
"startValue": 1000
}
{
"startDate": "2025-10-15",
"endDate": "2026-10-15",
"startValue": 1000,
"rebalanceCount": 12,
"buyAndHold": {
"points": [ { "date": "2025-10-15", "value": 1000 }, ... ],
"endValue": 1268.4,
"totalReturnPercent": 26.84,
"annualisedReturnPercent": 26.84,
"annualisedVolatilityPercent": 51.9,
"maxDrawdownPercent": -33.1,
"drawdownPeakDate": "2026-01-06",
"drawdownTroughDate": "2026-04-08"
},
"managed": {
"points": [ ... ],
"endValue": 1301.7,
"totalReturnPercent": 30.17,
"annualisedReturnPercent": 30.17,
"annualisedVolatilityPercent": 52.6,
"maxDrawdownPercent": -31.8,
"drawdownPeakDate": "2026-01-06",
"drawdownTroughDate": "2026-04-08"
},
"lateStarts": [],
"exclusions": []
}
Backtest Fields
| Field | Type | Description |
|---|---|---|
| startDate / endDate | string | First and last day of the replay |
| startValue | number | Value both series start from |
| rebalanceCount | integer | Number of monthly rebalances in the managed series |
| buyAndHold / managed | object | Each series: points (date and value per day), endValue, totalReturnPercent, annualisedReturnPercent and annualisedVolatilityPercent (null when the replay is too short), maxDrawdownPercent (negative) with its drawdownPeakDate and drawdownTroughDate |
| lateStarts | array | Constituents whose price history starts inside the window, each with type, asset and firstPricedDate |
| exclusions | array | Constituents left out, each with type, asset and reason; the rest are scaled up to 100% |
Your saved portfolios. GET /portfolios lists them; GET /portfolios/{portfolioId} returns one, or 404 when it is not yours. POST saves a new portfolio as version 1 and answers 201. PUT saves the portfolio as a new version and answers 200; send the version you are amending as expectedVersion, and a portfolio changed since then is refused with 409. DELETE retires the portfolio and answers 204: it leaves the list and can no longer be subscribed.
Request Body (POST and PUT)
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Your name for the portfolio |
| constituents | array | Yes | One entry per constituent: type (SPOT or YIELD), asset and weightPercent. A spot asset must be in Universe and a Yield asset in yieldProducts. Each weight is above zero and a whole number of weight steps, a spot weight is at most the max weight, all Yield weights together are at most the Yield cap, and the weights add up to exactly 100 |
| rules | object | Optional | maxWeightPercent (5–100), maxYieldWeightPercent (0 up to the configured cap) and weightStepPercent (0.1, 0.5 or 1); both caps must be whole numbers of the step. Left out, POST takes the defaults in Configuration and PUT keeps the portfolio's rules |
| expectedVersion | integer | PUT only | The version you are amending |
POST /hermes-ws-gateway/api/rest/portfolio/portfolios HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"name": "Majors and DOGE",
"constituents": [
{ "type": "SPOT", "asset": "BTC", "weightPercent": 50 },
{ "type": "SPOT", "asset": "ETH", "weightPercent": 30 },
{ "type": "SPOT", "asset": "DOGE", "weightPercent": 20 }
],
"rules": {
"maxWeightPercent": 50,
"maxYieldWeightPercent": 40,
"weightStepPercent": 0.5
}
}
{
"portfolioId": "PF-4141001-1",
"name": "Majors and DOGE",
"version": 1,
"status": "ACTIVE",
"createdAt": "2026-10-14T09:12:40",
"updatedAt": "2026-10-14T09:12:40",
"constituents": [
{ "type": "SPOT", "asset": "BTC", "targetWeightPercent": 50 },
{ "type": "SPOT", "asset": "ETH", "targetWeightPercent": 30 },
{ "type": "SPOT", "asset": "DOGE", "targetWeightPercent": 20 }
],
"rules": {
"maxWeightPercent": 50,
"maxYieldWeightPercent": 40,
"weightStepPercent": 0.5
}
}
Saved Portfolio Fields
| Field | Type | Description |
|---|---|---|
| portfolioId | string | Identifier of the portfolio; send it as portfolioCode to Subscribe |
| name | string | Your name for it |
| version | integer | Version number, 1 when first saved and one more on every PUT |
| status | string | ACTIVE for a portfolio in your list |
| createdAt / updatedAt | string | When the portfolio was first saved, and when this version was saved (UTC) |
| constituents | array | type, asset and targetWeightPercent, a percent; they add up to 100 |
| rules | object | The maxWeightPercent, maxYieldWeightPercent and weightStepPercent the portfolio was checked against |
A portfolio that breaks a rule is refused with 400 and the reason, e.g. {"code": "400", "message": "The weights must sum to 100%, not 95%"}. Saving more than maxPortfoliosPerClient portfolios is refused the same way.
Hands a saved portfolio to the platform to manage, with the amount you name. The platform moves the amount from your free USDT and/or USDC into the managed portfolio's own sub-account and buys each target asset. Send a new clientRequestId of your own on every subscription: repeat the same request, after a timeout say, and it answers 202 with the managed portfolio the first one started instead of starting a second.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| portfolioCode | string | Yes | The portfolioId of one of your saved portfolios, e.g. PF-4141001-1. Its latest version is subscribed |
| clientRequestId | string | Yes | Your idempotency key: up to 64 letters, digits or . _ : -. Reusing it for a different portfolio, amount or funding assets is refused with REQUEST_ID_REUSED |
| fundingAssets | array | Yes | What to pay with: ["USDT"], ["USDC"] or ["USDT", "USDC"] |
| amount | number | Optional | Total to invest, in USDT terms. With both funding assets, free USDT is used first and USDC makes up the rest |
| usdtAmount / usdcAmount | number | Optional | Send these instead of amount to name exactly how much of each to use. Each must be in fundingAssets; sent with amount, they must add up to it |
POST /hermes-ws-gateway/api/rest/portfolio/mandates HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"portfolioCode": "PF-4141001-1",
"clientRequestId": "bot-2026-10-14-001",
"amount": 1000,
"fundingAssets": ["USDT"]
}
{
"mandateCode": "MP-4141001-1",
"mandate": {
"mandateCode": "MP-4141001-1",
"portfolioCode": "PF-4141001-1",
"stage": "SUBSCRIBING",
"investedAmount": 1000,
"fundingAssets": ["USDT"],
...
}
}
202 means the subscription was accepted; mandate is the managed portfolio as it now stands, with the fields in Managed Portfolios. A refused subscription starts nothing and moves nothing; it answers with the status of its refusal code and a body of refusal and message:
{
"refusal": "BELOW_MINIMUM",
"message": "Invest at least 25 USDT so every asset can be bought"
}
/mandates lists every managed portfolio of the account, running or ended. /mandates/{mandateCode} returns one, with its value, its holdings against their targets and every rebalance with its trades; it answers 404 for a code that is not yours. value and currentWeight move with prices: read them again with GET whenever you need them fresh.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| mandateCode | path | string | Yes | The managed portfolio's mandateCode |
| Authorization | header | string | Yes | Bearer JWT token |
| X-API-Version | header | string | Optional | Default: 1.0.0 |
GET /hermes-ws-gateway/api/rest/portfolio/mandates/MP-4141001-1 HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"mandateCode": "MP-4141001-1",
"clientId": 4141001,
"accountClientId": 4141002,
"portfolioCode": "PF-4141001-1",
"portfolioName": "Majors and DOGE",
"modelVersion": 1,
"newerModelAvailable": false,
"stage": "ACTIVE",
"investedAmount": 1000,
"quoteAsset": "USDT",
"fundingAssets": ["USDT"],
"value": 1010.97,
"cashBalance": 1.12,
"subscribedAt": "2026-10-14T09:30:12",
"lastCycleAt": "2026-10-14T09:31:02",
"nextCycleAt": "2026-11-01T01:00:00",
"closedAt": null,
"holdings": [
{ "asset": "BTC", "type": "SPOT", "targetWeight": 50, "currentWeight": 49.6276, "quantity": 0.00444, "value": 501.72 },
{ "asset": "ETH", "type": "SPOT", "targetWeight": 30, "currentWeight": 30.0073, "quantity": 0.0731, "value": 303.365 },
{ "asset": "DOGE", "type": "SPOT", "targetWeight": 20, "currentWeight": 20.2543, "quantity": 803, "value": 204.765 }
],
"cycles": [
{
"cycleId": "SUBSCRIBE",
"status": "DONE",
"valueBefore": 1000,
"valueAfter": 999.75,
"startedAt": "2026-10-14T09:30:13",
"finishedAt": "2026-10-14T09:31:02",
"trades": [
{ "asset": "BTC", "type": "SPOT", "side": "BUY", "quantity": 0.00444, "avgPrice": 112400, "status": "FILLED" },
{ "asset": "ETH", "type": "SPOT", "side": "BUY", "quantity": 0.0731, "avgPrice": 4100, "status": "FILLED" },
{ "asset": "DOGE", "type": "SPOT", "side": "BUY", "quantity": 803, "avgPrice": 0.2489, "status": "FILLED" }
]
}
]
}
Managed Portfolio Fields
| Field | Type | Description |
|---|---|---|
| mandateCode | string | Identifier of the managed portfolio; use it on every per-portfolio endpoint |
| clientId | integer | Your account |
| accountClientId | integer | The managed portfolio's own sub-account, where its coins and cash are held |
| portfolioCode / portfolioName | string | The saved portfolio it follows, and that portfolio's name |
| modelVersion | integer | Version of the saved portfolio whose weights it rebalances to |
| newerModelAvailable | boolean | true when a later version of the portfolio has been saved; call Follow Model to move onto it |
| stage | string | SUBSCRIBING (the amount is being moved and the targets bought), ACTIVE (held and rebalanced monthly), STOPPING (a stop is being worked), STOPPED or FAILED |
| investedAmount | number | Amount subscribed, in quoteAsset |
| quoteAsset | string | USDT, the asset values and prices are in |
| fundingAssets | array | The assets the subscription was paid with |
| value | number | What the managed portfolio is worth now, holdings at current prices plus cashBalance, in quoteAsset; null when an asset has no price |
| cashBalance | number | USDT held in the managed portfolio and not invested |
| subscribedAt | string | When you subscribed (UTC) |
| lastCycleAt | string | When the last rebalance finished |
| nextCycleAt | string | When the next monthly rebalance runs, the 1st of the month at 01:00 UTC; null unless stage is ACTIVE |
| closedAt | string | When it stopped or failed |
| holdings | array | One entry per asset, below |
| cycles | array | One entry per rebalance, below |
Holding Fields
| Field | Type | Description |
|---|---|---|
| asset | string | Asset code |
| type | string | SPOT or YIELD |
| targetWeight | number | Weight the portfolio aims for, in percent (0–100) |
| currentWeight | number | Share of value the holding is now, in percent; the remainder is cashBalance |
| quantity | number | Amount held, in the asset; for a Yield holding, its principal in USDT |
| value | number | The holding at the current price, in quoteAsset |
Cycle Fields
| Field | Type | Description |
|---|---|---|
| cycleId | string | SUBSCRIBE for the first purchase, the month (e.g. 2026-11) for a monthly rebalance, CLOSE for the stop |
| status | string | RUNNING, RECOVERING (picked up again after an interruption), DONE, PARTIAL (finished with some trades not fully filled), ABANDONED (given up before it finished) or FAILED |
| valueBefore / valueAfter | number | Value of the managed portfolio before and after the rebalance, in quoteAsset |
| startedAt / finishedAt | string | When the rebalance started and finished (UTC) |
| trades | array | The trades it made, below |
Trade Fields
| Field | Type | Description |
|---|---|---|
| asset | string | Asset traded |
| type | string | SPOT or YIELD. USDC turned into USDT shows as a SELL of USDC with type SPOT |
| side | string | BUY or SELL |
| quantity | number | Quantity filled, or the quantity planned until it fills |
| avgPrice | number | Average fill price in quoteAsset |
| status | string | PLANNED, PLACED, FILLED, PARTIAL, FAILED or SKIPPED |
Stops managing the portfolio and brings what it holds back to your account. Send {"sellToCash": false}, or no body, to get the coins back as they are; send {"sellToCash": true} to have them sold to USDT first. stage goes to STOPPING, then STOPPED. A stop cannot be undone.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| sellToCash | boolean | Optional | true sells the holdings to USDT; false keeps them. Default false |
POST /hermes-ws-gateway/api/rest/portfolio/mandates/MP-4141001-1/stop HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
{
"sellToCash": true
}
{
"mandateCode": "MP-4141001-1",
"mandate": { "mandateCode": "MP-4141001-1", "stage": "STOPPING", "nextCycleAt": null, ... }
}
A managed portfolio already stopping or stopped answers 409 ALREADY_STOPPED; one that is in the middle of a change answers 409 BUSY, so try again in a moment; a code that is not yours answers 404 MANDATE_NOT_FOUND.
Moves a running managed portfolio onto the latest saved version of its portfolio. Saving a new version with PUT /portfolios/{portfolioId} does not change a managed portfolio on its own: newerModelAvailable turns true, and the managed portfolio keeps its modelVersion until you call this. Afterwards, modelVersion and the holdings' targetWeight show the new version, and the next rebalance trades to it. No body is needed.
POST /hermes-ws-gateway/api/rest/portfolio/mandates/MP-4141001-1/follow-model HTTP/1.1
X-API-Version: 1.0.0
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
{
"mandateCode": "MP-4141001-1",
"mandate": { "mandateCode": "MP-4141001-1", "modelVersion": 2, "newerModelAvailable": false, "stage": "ACTIVE", ... }
}
Only an ACTIVE managed portfolio can follow the latest version; any other answers 409 ALREADY_STOPPED. A managed portfolio already changing answers 409 BUSY, and one whose saved portfolio was retired answers 404 PORTFOLIO_NOT_FOUND.
Errors & Refusals
Subscribe, Stop and Follow Model answer a refusal with the HTTP status below and a body naming it; nothing is moved or traded. Repeat a request only after fixing what message says, except for BUSY and UNAVAILABLE, which you can simply retry.
{
"mandateCode": "MP-4141001-1",
"refusal": "ALREADY_STOPPED",
"message": "This portfolio is already stopped or stopping"
}
Refusal Codes
| refusal | HTTP | Meaning |
|---|---|---|
| INVALID_REQUEST | 400 | A field is missing or wrong: no portfolioCode, a missing or malformed clientRequestId, funding assets other than USDT and USDC, no amount above zero, USDT and USDC amounts that do not add up to amount, or an amount from an asset not in fundingAssets |
| NOT_PERMITTED | 403 | Your account may not subscribe a managed portfolio; message says why |
| PORTFOLIO_NOT_FOUND | 404 | portfolioCode is not one of your saved portfolios, or was retired |
| MANDATE_NOT_FOUND | 404 | No managed portfolio of yours has that mandateCode |
| UNAVAILABLE | 503 | Your account could not be checked just now; try again |
| PRODUCT_DISABLED | 409 | Managed portfolios are not open to new subscriptions right now |
| ALREADY_MANAGED | 409 | That saved portfolio already has a managed portfolio running |
| NOT_TRADABLE | 409 | An asset of the portfolio cannot be traded, its Yield is not offered, or USDC cannot be converted to USDT right now; message names it |
| BELOW_MINIMUM | 409 | The amount is too small for every asset to be bought, or the USDC part is below the smallest USDC conversion; message states the minimum |
| ABOVE_MAXIMUM | 409 | The amount is more than the portfolio's Yield constituents can take; message states the most |
| INSUFFICIENT_FUNDS | 409 | Your free USDT or USDC does not cover the amount |
| ALREADY_STOPPED | 409 | The managed portfolio is already stopping or stopped, or is not running and so cannot follow the latest version |
| REQUEST_ID_REUSED | 409 | That clientRequestId was already used for a different subscription; send a new one |
| BUSY | 409 | The managed portfolio is in the middle of a change; try again in a moment |
Other Errors
Any other error on these endpoints answers with its HTTP status and a body of code (the status) and message (the reason), except a 404 for a portfolio or managed portfolio that is not yours, which has no body. A builder request that breaks a rule answers 400; a saved portfolio changed since the version you amend answers 409. 502, with or without a body, means the service is unavailable: try again in a moment.
{
"code": "400",
"message": "BTC at 60% is over the 50% max weight"
}