Burn LP

Burns specified amount of LP tokens.

Rate limits

  • 60 burns/min or 10 burns every 10 seconds per wallet. (weight = 10)

See more details in API Rate limits.

Request

Connect

WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]

Message

{
  "burn_lp": {
    "tx": {
      "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000",
      "productId": 1,
      "amount": "10001000000000000000000"
      "nonce": "1"
    },
    "signature": "0x"
  }
}

Request Parameters

Signing

See more details and examples in our signing page.

The solidity typed data struct that needs to be signed is:

struct BurnLp {
    bytes32 sender;
    uint32 productId;
    uint128 amount;
    uint64 nonce;
}

sender: a bytes32 sent as a hex string; includes the address and the subaccount identifier.

productId: a uint32 that specifies the product youโ€™d like to burn LPs for; can be either a spot or a perp product.

amount: combined amount of base + quote to burn, sent as a string. This must be positive and must be specified with 18 decimals.

nonce: the tx_nonce. This is an incrementing nonce, can be obtained using the Nonces query.

Note: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: nonce should be an uint64 for Signing but should be sent as a string in the final payload.

Response

{
  "status": "success",

}

Success

{
  "status": "success",
  "signature": {signature},
  "request_type": "execute_burn_lp"
}

Failure

{
  "status": "failure",
  "signature": {signature},
  "error": "{error_msg}",
  "error_code": {error_code},
  "request_type": "execute_burn_lp"
}

Last updated