API Reference

Liquidate

Method Name

private/liquidate

Liquidates a given subaccount using funds from another subaccount. This endpoint has a few limitations:
1. If succesful, the RPC will freeze the caller's subaccount until the bid is settled or is reverted on chain.
2. The caller's subaccount must not have any open orders.
3. The caller's subaccount must have enough withdrawable cash to cover the bid and the buffer margin requirements.
Required minimum session key permission level is admin

Parameters

cash_transfer string required
Amount of cash to transfer to a newly created subaccount for bidding. Must be non-negative.
last_seen_trade_id integer required
Last seen trade ID for account being liquidated. Not checked if set to 0.
liquidated_subaccount_id integer required
Subaccount ID of the account to be liquidated.
nonce integer required
Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)
percent_bid string required
Percent of the liquidated position to bid for. Will bid for the maximum possible percent of the position if set to 1
price_limit string required
Maximum amount of cash to be paid from bidder to liquidated account (supports negative amounts for insolvent auctions). Not checked if set to 0.
signature string required
Ethereum signature of the order
signature_expiry_sec integer required
Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now.
signer string required
Owner wallet address or registered session key that signed order
subaccount_id integer required
Subaccount ID owned by wallet, that will be doing the bidding.

Response

id string or integer required
result object required
result.estimated_bid_price string required
Estimated bid price for this liquidation
result.estimated_discount_pnl string required
Estimated profit (increase in the subaccount mark value) if the liquidation is successful.
result.estimated_percent_bid string required
Estimated percent of account the bid will aquire
result.transaction_id string required
The transaction id of the related settlement transaction

Example

{request_example_shell}
{request_example_javascript}
{request_example_python}

The above command returns JSON structured like this:

{response_example_json}