Method Name
private/liquidate
private/liquidateLiquidates 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_transferstringrequired Amount of cash to transfer to a newly created subaccount for bidding. Must be non-negative. |
| last_seen_trade_idintegerrequired Last seen trade ID for account being liquidated. Not checked if set to 0. |
| liquidated_subaccount_idintegerrequired Subaccount ID of the account to be liquidated. |
| nonceintegerrequired Unique nonce defined as (UTC_timestamp in ms)(random_number_up_to_6_digits) (e.g. 1695836058725001, where 001 is the random number) |
| percent_bidstringrequired Percent of the liquidated position to bid for. Will bid for the maximum possible percent of the position if set to 1 |
| price_limitstringrequired Maximum amount of cash to be paid from bidder to liquidated account (supports negative amounts for insolvent auctions). Not checked if set to 0. |
| signaturestringrequired Ethereum signature of the order |
| signature_expiry_secintegerrequired 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. |
| signerstringrequired Owner wallet address or registered session key that signed order |
| subaccount_idintegerrequired Subaccount ID owned by wallet, that will be doing the bidding. |
Response
| idstring or integerrequired |
| resultobjectrequired |
| result.estimated_bid_pricestringrequired Estimated bid price for this liquidation |
| result.estimated_discount_pnlstringrequired Estimated profit (increase in the subaccount mark value) if the liquidation is successful. |
| result.estimated_percent_bidstringrequired Estimated percent of account the bid will aquire |
| result.transaction_idstringrequired 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}