Create Trade
Places an order, closes a perpetual position, or deposits to or withdraws from the trading balance, from the Whop-managed wallet of an account or user. Answers 201 with the trade in pending; it runs in the background, so read it with GET /trades/:id until its status is completed, failed or in_review. Trades run alongside each other, except a second order on one market at a different leverage, which answers 409. A retry with the same Idempotency-Key returns the same trade.
Yetkilendirmeler
An Account API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.
Başlıklar
A unique key that makes this request safe to retry. See Idempotent requests.
255"d9105228-4a08-46b1-8b91-42fed586d383"
Gövde
order places one order. A perpetual order trades from the trading balance, setting cross leverage first; when the balance is short, it bridges the USDT0 it needs from the wallet first. A spot order swaps between USDT0 and the asset in the wallet. deposit bridges amount USDT0 from the wallet to the trading balance. withdraw sends amount USDC (or all) from the trading balance back to the wallet. close closes the whole position in market with a market reduce-only order; when the account is then flat, a withdraw trade sends the trading balance back to the wallet.
close, order, deposit, withdraw "order"
market fills now within slippage_bps of the mid price, and anything unfilled is canceled; limit fills at price or better, and how long it stays on the book follows time_in_force. take_profit and stop_loss reduce the open perpetual position with a market order once the price crosses trigger_price; the trade stays processing until then. Required for an order.
market, limit, take_profit, stop_loss "market"
Only for an order. The size in units of the market, as a decimal string, with at most the market's size decimals. Send exactly one of size or notional; a spot sell takes size. A perpetual order must be worth at least 10 USD, unless reduce-only. A take_profit or stop_loss takes size or nothing for the whole position, and a set size must be worth at least 10 USD at trigger_price.
"0.001"
Only for a perpetual limit order. good_til_canceled rests on the book until it fills; add_liquidity_only is canceled instead of filling at once; immediate_or_cancel fills what it can now and cancels the rest. Defaults to good_til_canceled. The trade stays processing while the order rests.
add_liquidity_only, good_til_canceled, immediate_or_cancel "add_liquidity_only"
Required for a take_profit or stop_loss, and only for them. The USD price, as a decimal string Hyperliquid accepts without rounding, at which it sends a market order. Closing a long, a take-profit triggers above the current price and a stop-loss below; closing a short, the reverse. It is always reduce-only, needs an open position, and takes no price, notional, leverage, time_in_force or slippage_bps.
Yanıt
trade created
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.
"0x63cabad10f072c65ad84526e0c33081b"
Why the trade failed, or null.
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_failed, null "market_unavailable"
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.
pending, processing, in_review, completed, failed "pending"
What 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.
depositing, landing, placing, withdrawing, returning, quoting, swapping, crediting, null "placing"
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.
close, order, deposit, withdraw "order"

