create_order
Place a trading order on Typus Perp with specified tokens, size, trigger price, and collateral. Supports long/short positions, stop orders, and reduce-only.
Instructions
Create a trading order on Typus Perp. Requires PRIVATE_KEY in .env. Size and collateral amounts are raw integers — use get_markets to find size_decimal for the trading token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | Position size as a raw integer (base token units × 10^size_decimal). Use get_markets to find size_decimal for the token. | |
| dryRun | No | If true, simulate the transaction without submitting. | |
| isLong | Yes | true = Long position, false = Short position | |
| reduceOnly | No | true = this order can only reduce an existing position size. false = can open or increase a position. | |
| isStopOrder | No | true = stop order (attached to an existing position). false = regular open/limit order. | |
| tradingToken | Yes | The base token to trade. Supported values: SUI, WBTC, wETH, wSOL, wAPT, DEEP, WAL, DOGE, HYPE, XRP, JPY, XAU, XAG, USOIL, QQQX, SPYX, TYPUS | |
| triggerPrice | Yes | Order trigger price in USD as a raw integer (price × 10^8). e.g. $65,000 = '6500000000000'. | |
| collateralToken | Yes | The token used as collateral. Supported values: USDC, SUI | |
| collateralAmount | Yes | Collateral amount as a raw integer (token units × 10^decimals). USDC has 6 decimals (10 USDC = '10000000'), SUI has 9 decimals (5 SUI = '5000000000'). | |
| linkedPositionId | No | The position ID to attach this order to. Required when isStopOrder is true. Use get_positions to find position IDs. |