order on a perpetual trades from the trading balance, bridging the USDT0 it needs from the wallet first when the balance is short; an order on spot swaps between USDT0 and the asset in the wallet. A close closes the whole position in one market; when the account is then flat, a withdraw trade sends the trading balance back to the wallet. A deposit or withdraw moves money between the wallet and the trading balance. Perpetuals trade on Hyperliquid.
Use the Trades API to list the markets you can trade, place orders, close positions and move funds, and follow each trade until it finishes. Trades run in the background; an order that bridged money in and does not fill sends that money back to the wallet, and funds_location says where the money is.
The trading API, including include_trading on accounts and users, is in beta. It can change without a new API version date.
Endpoints
Markets
List Markets returns every market you can trade on Whop.- Spot: listed by symbol:
BTC,SOLandXAUT(gold). - Perpetuals: such as
BTC, and stock and commodity perpetuals from Hyperliquid’sxyzexchange, such asxyz:TSLA. Send theidasmarketwhen you create a trade.
id together with instrument_type to tell them apart. Results are sorted by id, then instrument_type.
This endpoint is public: no API key is needed, and each IP address can make up to 60 requests a minute.
A perpetual order’s size can have at most size_decimals decimals, and its leverage can be at most max_leverage, which is null for a spot market.
Attributes
The account that owns the trading wallet, prefixed
biz_. null when a user
owns it.The USDT0 that a deposit, a spot buy, or a perpetual order short of trading
balance, sends from the wallet, or the USDC that a withdraw sends back, in
native units, as a decimal string. A withdraw of
all shows what it sent once
it finishes. null otherwise.The average fill price of the order, in USD, as a decimal string. For spot,
the price the swap was quoted at.
null when it is not known.The caller’s own ID for the trade, unique for the account.
null when none
was sent.When the trade ended as completed or failed, as an ISO 8601 timestamp.
null
before that.ID Whop sends to the exchange with this trade’s order, so the exchange’s order
updates can be matched to the trade. On Hyperliquid, the order’s
cloid
reported in orderUpdates, a 0x-prefixed 32-character hex string. Not the
caller’s client_order_id. null for a deposit or withdraw.Why the trade failed, or
null.Available options: market_unavailable, leverage_too_high, amount_too_small, isolated_position_open, trading_paused, funding_failed, margin_unavailable, builder_fee_unapproved, leverage_rejected, leverage_unconfirmed, order_rejected, close_rejected, return_failed, withdraw_failedThe size the order filled, in units of the market, as a decimal string. For a
spot buy, the amount the swap was quoted to deliver.
null until it fills.Where the money is when the trade did not complete as asked:
wallet, trading_account, or unknown while a person checks it. null otherwise.Available options: wallet, trading_account, unknownperpetual or spot for an order, perpetual for a close. null for a deposit or withdraw.Available options: perpetual, spotThe cross leverage set before an opening perpetual order.
null for a spot
order, close, deposit, withdraw or reduce-only order.The market, for example
BTC for a perpetual or XAUT for spot. null for a
deposit or withdraw.market, limit, take_profit or stop_loss for an order. null otherwise.Available options: market, limit, take_profit, stop_lossFor a take-profit or stop-loss sent with an order, that order’s trade,
prefixed
tint_. null otherwise.The limit price of the order in USD. A market order’s price is the mid price moved by
slippage_bps; a take-profit or stop-loss’s is the worst price its market order may fill at once triggered. null for other types.Properties
Properties
The amount in major units, as an exact decimal string. For example,
"10.00"
is ten dollars. It is a string so that no float rounds it in transit.How many decimal places the amount carries. This is the precision the charge
itself runs at.
The order size in units of the market, as a decimal string.
null for other
types.pending until the trade starts. processing while it runs, also while an order that did not fill sends the money it bridged in back to the wallet. completed when it did what was asked. failed when it did not; funds_location says where the money is. in_review when the outcome is unknown and a person checks it.Available options: pending, processing, in_review, completed, failedpartial_fill when the order filled only part of its size. null otherwise.Available options: partial_fillWhat a live trade is doing now:
depositing while the wallet’s USDT0 is being sent to the bridge, landing once sent and until it reaches the trading balance, placing while the order or close is with the venue, withdrawing while USDC heads back to the wallet, returning while money an unfilled order bridged in goes back. A spot order is quoting while the swap is priced, swapping while it runs onchain, and crediting until the new balance shows in the wallet. null once the trade is no longer pending or processing.Available options: depositing, landing, placing, withdrawing, returning, quoting, swapping, creditingThe price in USD at which a take-profit or stop-loss sends its market order.
null for other orders and types.Properties
Properties
The amount in major units, as an exact decimal string. For example,
"10.00"
is ten dollars. It is a string so that no float rounds it in transit.How many decimal places the amount carries. This is the precision the charge
itself runs at.
order places one order: a perpetual order trades from the trading balance, a spot order swaps between USDT0 and the asset in the wallet. deposit bridges USDT0 from the wallet to the trading balance. withdraw sends USDC from the trading balance back to the wallet. close closes the whole position in one market with a market reduce-only order; when the account is then flat, a withdraw trade sends the trading balance back to the wallet.Available options: close, order, deposit, withdrawTrade

