OrderMatching
Order Matching
Name | Type | Required | Description |
---|---|---|---|
type | String | yes | OrderMatching |
accountId | yes | Initiator's account id. Only specific accounts can initiate this type of transaction on Layer3 | |
subAccountId | yes | Initiator's subaccount id | |
taker | yes | taker order | |
maker | yes | maker order | |
feeToken | yes | Fee token, deducted from the initiator's subaccount | |
fee | BigUint | yes | Fee returned via the |
expectBaseAmount | BigUint | yes | The maximum amount of base token that the initiator expects to be traded in this order matching, which cannot exceed the maximum amount that the maker and taker can actually trade. The value does not need to be packable |
expectQuoteAmount | BigUint | yes | The maximum amount of quote token that the initiator expects to be traded in this order matching, which cannot exceed the maximum amount that the maker and taker can actually trade. The value does not need to be packable |
signature | yes | The pub key hash corresponding to the signature must be aligned with the initiator account |
<a id="order>where the type Order
is
Name | Type | Required | Description |
---|---|---|---|
accountId | yes | The Account id | |
subAccountId | yes | The sub-account id | |
slotId | yes | slot id | |
nonce | yes | slot nonce | |
baseTokenId | yes | the base token, for example `BTC` in BTC/USDT pair | |
quoteTokenId | yes | The quote token, for example `USDT` in BTC/USDT pair | |
amount | String | yes | The string format of BigUint, the amount request in this order |
price | String | yes | The string format of BigUint, the price request in this order |
isSell | u8 | yes | 1:seller, 0: buyer |
feeRates | [u8, u8] | yes | the fee of [maker, taker], 100 means 1.0%, the maximum 2.56% |
hasSubsidy | u8 | yes | 1: true, 0: false. If maker has subsidy, the submitter will give maker subsidy |
signature | yes | The ZkLink signature of this order |
For example:
Sign OrderMatching
For more detail please refer to Golang example in SDK
Last updated