Preview portfolio details with simulated order
Retrieve a preview of portfolio details including the impact of a simulated order, showing how balances, positions, and margins would change.
Requires authentication.
In: header
In: header
Order type (LIMIT, MARKET, etc.). Specifies the execution behavior of the order.
"LIMIT""LIMIT" | "MARKET" | "STOP" | "TWAP"Side of the book to place order on. Either BUY or SELL. Determines if
the order is buying or selling the base asset.
"BUY""BUY" | "SELL"Product index to place order on (BTC-PERP=1, ETH-PERP=2, SOL-PERP=3). Identifies the trading pair/instrument.
int64Self-trade prevention flag. Either CANCEL_TAKER or CANCEL_MAKER.
Prevents the order from matching against own orders.
"CANCEL_TAKER""CANCEL_TAKER" | "CANCEL_MAKER" | "CANCEL_BOTH"Order price in quote currency (e.g., USDC). For limit orders, this is the maximum buy price or minimum sell price.
doubleOrder size in base currency (e.g., BTC). The quantity of the asset to buy or sell.
doubleTime in force policy (GTC, IOC, FOK, GTT). Specifies the execution behavior and lifetime of the order. Constraints by order type: LIMIT orders support all values; MARKET orders require FOK or IOC; STOP and TWAP orders require GTC, FOK, or IOC.
"GTC""GTC" | "IOC" | "FOK" | "GTT"Unique nonce value (typically Unix timestamp in nanoseconds). Must be within ±5 minutes of current time to prevent replay attacks.
uint64Post-only flag. If true, order will only execute as maker (adds liquidity). Order is rejected if it would take liquidity.
Cryptographic signature of the order payload. Used to authenticate and verify the order was signed by the sender.
Reduce-only flag. If true, order can only reduce existing position size, not increase it or open a new position.
Stop order type (STOP_LOSS, TAKE_PROFIT, etc.). Defines the trigger condition for conditional orders.
"STOP_NONE""STOP_NONE" | "STOP_LOSS" | "TAKE_PROFIT"Stop trigger price. The price level at which the stop order becomes active and enters the order book.
Client-provided order identifier. Must be unique among open orders. Supports alphanumeric characters and symbols (:, -, _). Case-insensitive. Optional.
Stop price reference. Either LAST_PRICE (last traded price) or MARK_PRICE (mark price). Determines which price feed triggers the stop order.
"NONE""NONE" | "LAST_PRICE" | "MARK_PRICE"Order expiration timestamp in nanoseconds. Mandatory when time_in_force is set to GTT (Good-Till-Time). Order is canceled if not filled by this time.
int64Scheduled execution timestamp in nanoseconds. Delays order processing until the specified time. Default 0 means immediate execution.
int64Synchronous processing flag. If true, the response is sent only after the matching engine fully processes the order (status: "open", "done", or "accepted"). If false, returns immediately with "pending" status. Note: HTTP 200 OK is returned even if the order is rejected; check the order status field for actual result.
Response Body
application/json
application/json
curl -X POST "https://api.dev.obsidian.exchange/portfolios/detail-preview" \ -H "Content-Type: application/json" \ -d '{}'{
"user_address": "string",
"summary": {
"collateral_mode": "USDC_COLLATERAL",
"collateral_margin_balance": "string",
"cross_margin_balance": "string",
"cross_margin_usage": "string",
"cross_account_leverage": "string",
"in_cross_liquidation": true,
"free_collateral": "string",
"total_account_value": "string",
"total_cross_notional": "string",
"unsettled_usdc": "string",
"realized_pnl": "string",
"total_cross_initial_margin": "string",
"total_cross_maintenance_margin": "string",
"collateral_assets": [
{
"asset": "string",
"address": "string",
"balance": "string",
"withdrawable_amount": "string",
"market_value_usd": "string",
"collateral_value_usd": "string",
"collateral_value_composition": "string"
}
],
"has_pending_withdrawal": true,
"total_unrealized_pnl": "string",
"total_collateral_value": "string",
"margin_health": "string",
"total_isolated_order_reserve": "string"
},
"positions": [
{
"product_index": 0,
"product_id": "string",
"net_size": "string",
"avg_entry_price": "string",
"quote_balance": "string",
"mark_price": "string",
"index_price": "string",
"margin_mode": "MARGIN_MODE_CROSS",
"leverage": "string",
"margin_balance": "string",
"initial_margin_requirement": "string",
"maintenance_margin_requirement": "string",
"liquidation_price": "string",
"unrealized_pnl": "string",
"unsettled_funding": "string",
"funding_index": "string",
"isolated_usdc_balance": "string",
"free_isolated_usdc_balance": "string",
"in_isolated_liquidation": true
}
],
"stats": {
"order_stats": {
"total_orders": "string",
"total_done_orders": "string",
"total_open_orders": "string",
"total_pending_orders": "string"
},
"products": [
{
"product_id": "string",
"order_stats": {
"total_orders": "string",
"total_done_orders": "string",
"total_open_orders": "string",
"total_pending_orders": "string"
}
}
],
"trading_stats": {
"total_trading_volume": "string"
},
"assets": [
{
"asset": "string",
"address": "string",
"total_deposit": "string",
"total_withdraw": "string"
}
]
},
"maker_fee": "string",
"taker_fee": "string",
"private_name": "string",
"is_market_maker": true,
"disable_post_order": true,
"disable_withdrawal": true
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}