Skip to main content
Version: testnet (v0.73)

Estimate position

Estimate the margin that would be required for maintaining the specified position. Margin estimates are scaled to asset decimal places. If the optional collateral available argument is supplied, the response also contains the estimate of the liquidation price. Liquidation price estimates are scaled to asset decimal places by default, unless an argument to scale to market decimal places is specified in the request.

Query Parameters
    marketId string required

    Market ID to estimate position for.

    openVolume int64 required

    Open volume. This field is a signed integer scaled to the market's position decimal places. A negative number denotes a short position.

    collateralAvailable string

    Collateral available for the position. If provided then response will contain the liquidation price estimate. Collateral available needs to be provided scaled to asset decimal places. Liquidation price returned is scaled to asset decimal places by default.

    scaleLiquidationPriceToMarketDecimals boolean

    Whether the liquidation price estimates should be scaled to market decimal places or by asset decimal places. If not set, asset decimal places are used.

Responses

A successful response.


Schema
    liquidation object

    Liquidation price range estimate for the specified position. Only populated if available collateral was specified in the request.

    bestCase object

    Liquidation price estimate assuming no slippage.

    includingBuyOrders string

    Liquidation price assuming buy orders start getting filled.

    includingSellOrders string

    Liquidation price assuming sell orders start getting filled.

    openVolumeOnly string

    Liquidation price for current open volume ignoring any active orders.

    worstCase object

    Liquidation price estimate assuming slippage cap is applied.

    includingBuyOrders string

    Liquidation price assuming buy orders start getting filled.

    includingSellOrders string

    Liquidation price assuming sell orders start getting filled.

    openVolumeOnly string

    Liquidation price for current open volume ignoring any active orders.

    margin object

    Margin level range estimate for the specified position.

    bestCase object

    Margin level estimate assuming no slippage.

    asset string

    Asset ID for which the margin levels apply.

    collateralReleaseLevel string

    Collateral release level value. This field is an unsigned integer scaled to the asset's decimal places.

    initialMargin string

    Initial margin value. This field is an unsigned integer scaled to the asset's decimal places.

    maintenanceMargin string

    Maintenance margin value. This field is an unsigned integer scaled to the asset's decimal places.

    marketId string

    Market ID for which the margin levels apply.

    partyId string

    Party ID for whom the margin levels apply.

    searchLevel string

    Margin search level value. This field is an unsigned integer scaled to the asset's decimal places.

    timestamp int64

    Timestamp in Unix nanoseconds for when the ledger entry was created.

    worstCase object

    Margin level estimate assuming slippage cap is applied.

    asset string

    Asset ID for which the margin levels apply.

    collateralReleaseLevel string

    Collateral release level value. This field is an unsigned integer scaled to the asset's decimal places.

    initialMargin string

    Initial margin value. This field is an unsigned integer scaled to the asset's decimal places.

    maintenanceMargin string

    Maintenance margin value. This field is an unsigned integer scaled to the asset's decimal places.

    marketId string

    Market ID for which the margin levels apply.

    partyId string

    Party ID for whom the margin levels apply.

    searchLevel string

    Margin search level value. This field is an unsigned integer scaled to the asset's decimal places.

    timestamp int64

    Timestamp in Unix nanoseconds for when the ledger entry was created.

Loading...