Liquidation
Encode ContractPrice
Name | Rule |
---|---|
pariId | 1 byte |
marketPrice | 15 bytes, encode in big endian, then pass to the |
Encode OrderPriceInfo
Name | Rule |
---|---|
tokenId | 2 byte, change to |
marketPrice | 15 bytes, encode in big endian, then pass to the |
Encode Liquidation
Name | Rule |
---|---|
type | 1 byte, |
accountId | 4 bytes |
subAccountId | 1 byte |
accountIdNonce | 4 bytes |
oraclePrices | 31 bytes |
liquidationAccountId | 4 bytes |
fee | 2 bytes, refer to |
feeToken | 2 bytes |
49 bytes in total, where the oraclePrices
encode process is as blew:
Encode the
oraclePrices
into a bytes list in order;Pass the bytes list to the SDK
rescue_hash
function then get the 31 bytes result.
Example
Last updated