Show more above Trading with the API
Source: https://docs.myfundedperpetuals.com/trading-with-api
Place and manage every order type available in the trading terminal.
The REST API uses the same order books, trading rules, fees, margin checks, and
paper execution engine as the trading terminal. Every create request requires
an Idempotency-Key header. Standard orders and position closes may also carry
a caller-assigned client_order_id for durable reconciliation.
Exposure caps
API orders share the same per-user market exposure allowance as orders placed
in the terminal. Your own accounts of the same product and size share one cap
− for each market; other users have separate allowances. Long and short notional
+ for each market; other users have separate allowances. Elite accounts are the
+ exception: each Elite account has its own cap for each market, counting only
+ that account's position. Long and short notional
add together. An opening fill that would exceed the cap is rejected with
exposure_cap, without resizing. Reductions and closes remain allowed, and
Show more below freed capacity becomes available at the next refresh, approximately 10 seconds
later. See Asset Exposure Limits.
Standard and advanced orders
Send orders to POST /v1/orders. If type is omitted, the request is treated
as a market order for compatibility with existing clients.
type Required price fields Important options market expected_price slippage_tolerance_bps, attached TP/SL limit limit_price attached TP/SL, IOC, FOK, or GTD time in force chase chase_offset optional chase_cap_price stop_market trigger_price optional reduce-only protection
Show more above of pending and resting orders. This view is safer for reconciliation than
searching recent history.
At an hourly swap boundary, ready charges are applied before order settlement
and its balance and margin checks, without waiting for the scheduled hourly
processing window. Incomplete charge data can keep the order pending while it
is recovered. This also applies to reduce-only closes: closing after a boundary
does not remove the charge for exposure held at that boundary. See
Commissions and Fees.
For an enabled copy group, copied market orders stay pending until the lead
market order fills. If the lead rejects or expires without filling, its pending
market copies are canceled without opening follower positions or charging
trading fees. Resting limit and trigger copies, including attached TP/SL,
− execute independently on each account. See
+ execute independently on each account. Copies open on the same venue as the
+ lead order, including an alternate venue you chose for the market, and a
+ trading halt blocks new follower exposure even while a copy is in flight. A
+ copy uses the leverage you send, lowered to the follower's own maximum for
+ that market when needed, and keeps the margin mode of any position the
+ follower already holds in that market. See
Copy Trading.
Use GET /v1/orders?client_order_id=... to resolve your caller-assigned order
Show more below identity when the placement response or server id is unavailable. This lookup
survives API key rotation and returns the normal order-page shape with zero or
one result.
If the server cannot prove the snapshot is complete inside the active-order
bound, it returns 503 with Retry-After instead of returning truncated data.
- PATCH /v1/orders/{order_id} changes price and optionally size.
- PUT /v1/orders/{order_id}/attached-exits sets or removes TP/SL attached to
a resting limit entry. Send null to remove a leg.
- DELETE /v1/orders/{order_id} cancels a working order or queues cancellation
when execution already owns the row.
Show more above fill and trading rules.
GET /v1/scaled-orders/{id} returns every rung's price, size, child order ID,
and placement rejection when applicable. DELETE fences unplaced rungs and
cancels every working child.
Reconcile fills and closed positions
GET /v1/fills?account_id=... returns filled orders in settlement order with
fees, realized P\&L, notional, liquidity role, and partial-fill lineage. Use
GET /v1/positions?account_id=...&status=closed for cursor-paginated closed
position records.
Treat all cursors as opaque. Order and strategy state can continue changing
after a response, so reconcile by resource ID until it reaches a terminal
status.
+ Track evaluation progress
+ GET /v1/accounts/{account_id} returns a risk snapshot with equity, loss-limit room,
+ and the profit still needed to pass. An evaluation passes when equity,
+ including unrealized P\&L, reaches the profit target, so track
+ risk.remaining_profit_equity. When it reaches zero, the evaluation passes and
+ open positions are closed. risk.remaining_profit counts realized profit only
+ and can stay above zero while open profit already covers the target. Both are
+ null when the account has no profit target, and remaining_profit_equity is
+ also null when marks are incomplete.
Copy groups and scheduled execution
Before submitting a lead order through the API, ensure the credential covers
Show more below the lead and every follower. The same boundary applies to modifications,
cancellations, and protective exits. A scope failure rejects the complete
native order operation, preserving the copy group's behavior rather than
silently dropping a follower. See Authentication.
Accepted TWAP/VWAP and scaled orders retain the environment and account scope
that authorized them. Revoking the key blocks new requests but does not revoke
that accepted schedule. Each later slice or rung checks the current copy group
against its retained scope. If the group now includes an inaccessible account,
TWAP/VWAP stops with completion_reason: "api_account_scope_changed"; scaled
orders reject the remaining unplaced rungs with that reject_reason. Previously
Show more above parent_order_id.
A canceled order carries cancel_reason:
cancel_reason Meaning user You canceled it, including a cancel requested while it was executing. oco Its paired TP or SL filled and retired the remaining size. reduce_only The position it protected closed, reversed, or became too small for it. replaced A new attached TP or SL took over the size it covered. liquidation A liquidation closed the position it protected. expired Its GTD time passed while it was executing. account_closed The account passed, failed, or closed.
trading_restricted A trading restriction on your profile canceled opening orders. venue_policy The market stopped accepting new positions on this venue.
− cancel_reason Meaning copy A copy-trading lead order changed or ended, or the copy stopped applying.
+ cancel_reason Meaning copy A copy-trading lead order changed or ended, the copy stopped applying, or the account started following a lead.
Treat unknown values as a generic cancellation: new reasons may be added.
Orders canceled before this field existed omit it. A closed position carries
close_reason: user, take_profit, stop_loss, liquidation, reversal,
or system.
+ A copied follower order that was still executing when its group stopped
+ because the lead account passed, failed, or closed is rejected with
+ reject_reason copy_lead_stopped; the follower's positions are then closed
+ by the copy-trading stop.
Every fill also records position_side_after (long, short, or flat) and
position_size_after, the account's position in that market immediately
Show more after the fill. Fills from before these fields existed omit them.
GET /v1/twap-orders?account_id=... continues to return active TWAP and VWAP
parents. To discover terminal parents without retaining their IDs, request
status=completed or status=canceled. History is ordered by creation time,
newest first, within the selected status, and accepts limit (1 to 100,
default 50) and cursor. Follow next_cursor while has_more is true, keeping
account_id and status unchanged. Query both terminal statuses for a complete
history. The strategy field distinguishes TWAP from VWAP; completion_reason
explains why a completed schedule stopped. Pagination is not accepted for the
active listing.
Live market data
Use market data streaming for live prices, books, trades,
− and candles. It is public and uses a dedicated WebSocket endpoint. Continue
− using REST for account balances, positions, order state, and fills; private
− account streaming is not available.
+ and candles. It is public and uses a dedicated WebSocket endpoint. For order,
+ fill, position, and balance changes on your own accounts, use
+ account streaming, an authenticated WebSocket that pushes
+ each change as it happens. REST remains available for snapshots and lookups.