data class TradeInput(
val type: OrderType?,
val side: OrderSide?,
val marketId: String?,
val marginMode: MarginMode?,
val targetLeverage: Double?,
val size: TradeInputSize?,
val price: TradeInputPrice?,
val timeInForce: String?,
val goodTil: TradeInputGoodUntil?,
val execution: String?,
val reduceOnly: Boolean,
val postOnly: Boolean,
val fee: Double?,
val bracket: TradeInputBracket?,
val marketOrder: TradeInputMarketOrder?,
val options: TradeInputOptions?,
val summary: TradeInputSummary?
)
OrderType. See SubaccountOrder
BUY or SELL
Selected Market ID
CROSS or ISOLATED
Size information for the trade
Price information for the trade
Time in force
Execution option
Whether the trade has reduce-only selected
Post-only option
Calculated fee
Bracket orders
Market order structure calculated from orderbook
The list of input fields required, based on type
A summary of the order
data class TradeInputSize(
val size: Double?,
val usdcSize: Double?,
val leverage: Double?,
val percent: Double?,
val balancePercent: Double?,
val input: String?
)
Size of the trade in the token unit
Size of the trade in USDC
Leverage of the order
Percentage (of existing position) to use for the order. Only used for the close position input.
Percentage (of available balance / free collateral) to use for the order. Currently only on market orders.
Which one of the fields are entered by the user:
- TradeInput: size, usdcSize, leverage, percent, balancePercent
- ClosePositionInput: size, percent
data class TradeInputPrice(
val limitPrice: Double?,
val triggerPrice: Double?,
val trailingPercent: Double?
)
Entered limit price
Entered trigger price
Trailing percent for TrailingStop orders
data class TradeInputGoodUntil(
val duration: Double?,
val unit: String?
)
Number of (unit) for the duration
time unit
data class TradeInputBracket(
val stopLoss: TradeInputBracketSide?,
val takeProfit: TradeInputBracketSide?,
val goodTil: TradeInputGoodUntil?,
val execution: String?
)
Stoploss side of the bracket order
Take profit side of the bracket order
Good until settings for the bracket orders
Execution settings for the bracket orders
data class TradeInputMarketOrder(
val size: Double?,
val usdcSize: Double?,
val balancePercent: Double?,
val price: Double?,
val worstPrice: Double?,
val filled: Boolean,
val orderbook: Array?
)
size of the market order
USDC amount of the market order
Percentage (of available balance / free collateral) of the market order
Calculated price
Worst price of the market order, based on order book
Whether the market order can be filled with the current order book
The orderbook entries taken by the market order
data class TradeInputOptions(
val needsSize: Boolean,
val needsLeverage: Boolean,
val needsBalancePercent: Boolean,
val maxLeverage: Double?,
val needsLimitPrice: Boolean,
val needsTargetLeverage: Boolean,
val needsTriggerPrice: Boolean,
val needsTrailingPercent: Boolean,
val needsGoodUntil: Boolean,
val needsReduceOnly: Boolean,
val needsPostOnly: Boolean,
val needsBrackets: Boolean,
val typeOptions: Array,
val sideOptions: Array,
val timeInForceOptions: Array?,
val goodTilUnitOptions: Array?,
val executionOptions: Array?,
val marginModeOptions: Array?
)
UX should ask user for size
UX should ask user for leverage input
UX should ask user for balance percent input
Max leverage for the leverage slider
UX should ask user to adjust their target leverage when margin mode is ISOLATED
UX should ask user to enter trigger price
UX should ask user to enter limit price
UX should ask user to enter trailing percent
UX should ask user to enter GoodTil time
UX should have a check box for reduce-only
UX should have a check box for post-only
UX should allow user to enter bracket orders
Order types available for selection
Order side available for selection
TimeInForce options
Time units for goodTil
Execution options for selection
data class TradeInputSummary(
val price: Double?,
val size: Double?,
val usdcSize: Double?,
val slippage: Double?,
val fee: Double?,
val total: Double?,
val filled: Boolean
val positionMargin: Double?,
val positionLeverage: Double?,
)
Price of the trade
Size of the trade
USDC amount of the trade
Slippage of the trade
Fee
Total amount of the trade
Whether this trade can be filled
The margin value of the position
The leverage value of the position