OrderMatching

Order encode

Name
Rule

type

1 byte with value 0xff

accountId

4 bytes

subAccountId

1 byte

slotId

2 bytes

nonce

4 bytes

baseTokenId

2 bytes

quoteTokenId

2 bytes

price

15 bytes

isSell

1 byte

feeRates

2 bytes

hasSubsidy

1 byte

amount

5 bytes, refer to the amount pack method in BigUint pack algorithm

39 bytes in total.

OrderMatching encode

Name
Rule

type

1 byte with the value 0x08

accountId

4 bytes

subAccountId

1 byte

orderBytesHash

32 bytes, refer to Rust SDK rescue_hash_orders

feeToken

2 bytes

fee

2 bytes, refer to the fee pack method in BigUint pack algorithm

expectBaseAmount

16 bytes

expectQuoteAmount

16 bytes

74 bytes in total.

Example

Last updated

Was this helpful?