Taker APIs
KyberSwap Limit Order Taker APIs
Download OpenAPI specification:
Taker APIs
Latest
Latest
Developer Guide
Please refer to Fill Limit Order for the relevant sequence diagram as well as a TypeScript example.
Query Order(s)
Returns orders for the queried token pair sorted by best rates in descending order.
The chainId of the network to query.
The token address of the asset which the Taker expects in return.
The token address of the asset which the Taker is exchanging.
OK
Bad Request
- Missing required fields
Internal Server Error
- Error when get price from Price Service
GET /read-partner/api/v1/orders HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
"value": {
"code": 0,
"message": "Successfully",
"data": {
"orders": [
{
"id": "22444,",
"chainId": "137",
"signature": "27c31b3a272e79db13b5e75fddff71b070346cf3a3e5d619ceb766fed82d80e32f3e565c1b741f4a2d0cc44132b18551322f2657a274a2782022bdac7fecd2d21b",
"salt": "23992172604416598893041149026939778295",
"makerAsset": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"takerAsset": "0x1c954e8fe737f99f68fa1ccda3e51ebdb291948c",
"maker": "0x2bfc3a4ef52fe6cd2c5236da08005c59eafb43a7",
"contractAddress": "0xcab2fa2eeab7065b45cbcf6e3936dde2506b4f6c",
"receiver": "0x2bfc3a4ef52fe6cd2c5236da08005c59eafb43a7",
"allowedSenders": "0x2bfc3a4ef52fe6cd2c5236da08005c59eafb43a7",
"makingAmount": "10000",
"takingAmount": "20000000000000000",
"filledMakingAmount": "0",
"filledTakingAmount": "0",
"feeConfig": "73529011378642731556159749336395186902652258478889",
"feeRecipient": "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29",
"makerTokenFeePercent": "5",
"makerAssetData": "",
"takerAssetData": "",
"getMakerAmount": "f4a215c3000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000",
"getTakerAmount": "296637bf000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000",
"predicate": "961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e30000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b000000000000000000000000000000000000000000000000000000006530d1dd00000000000000000000000000000000000000000000000000000000",
"permit": "",
"interaction": "",
"expiredAt": 1697698269,
"availableMakingAmount": "7000",
"makerBalanceAllowance": "7000"
}
]
}
}
}
Get Operator Signature
Takers will need to request for KyberSwap Operator signature for target Maker orders which they are planning to fill. The returned operator signature will be required when encoding the Taker fill order for both /read-ks/api/v1/encode/fill-batch-orders-to
and /read-ks/api/v1/encode/fill-order-to
.
The chainId on which the order is being filled. Only supports EVM chains.
The order IDs to be cancelled gaslessly.
OK
Bad Request
- Missing required fields
- Orders don't have the same maker or chainId
Not Found
- Not found order
Conflict
- Duplicate orderId in request
Internal Server Error
GET /read-partner/api/v1/orders/operator-signature HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
"value": {
"code": 0,
"message": "Successfully",
"data": {
"id": 22452,
"chainId": "137",
"operatorSignature": "10cde325b99d3616c4d1e0557b8d45c86137e854af12515b4167a72a817c101d64c75a365dbeef6b50f2a6694f0692fe85abfa827af278ac00f56ba942b91b0f1b",
"operatorSignatureExpiredAt": 1697708112
}
}
}
Fill Order(s)
Request for the encoded fill order data from KyberSwap. This data can then be executed on-chain from the signer's wallet.
The ID of the order to be filled.
The amount of takerAsset
in wei. String representation of uint256 value.
If thresholdAmount != 0, the order will be filled if and only if (actualTakingAmount / actualMakingAmount) <= (thresholdAmount / requestedMakingAmount).
The Taker wallet address which will receive the makerAsset
.
The Operator signature obtained from /read-partner/api/v1/orders/operator-signature
. The order must be signed by the operator before it can be filled.
OK
Bad Request
- Missing required fields
- orderId is invalid format
- takingAmount, thresholdAmount is not uint256
- target is not ETH address
Not Found
- Not found orderId
Internal Server Error
POST /read-ks/api/v1/encode/fill-order-to HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 281
{
"orderId": 22456,
"takingAmount": "10000000000000000",
"thresholdAmount": "0",
"target": "0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7",
"operatorSignature": "8e7a0176b55cb6af042c837114ab98cba45a083a8a0facece2096ff200c060ed4d162fffa88047eb1f040f1fe0eddb27be712d38021795e3b6b5681c27914cd81c"
}
{
"value": {
"code": 0,
"message": "Succeeded",
"data": {
"encodedData": "0xd2f1d95600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000006530fdc60000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000aef7e6a8082647289728e7d3ca198b9a0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000001c954e8fe737f99f68fa1ccda3e51ebdb291948c0000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000324f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044f4a215c3000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044296637bf000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e4961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e30000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b000000000000000000000000000000000000000000000000000000006531054900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000417d01d984f71c81e9413a9b8ffababca76101c36259a84416cf579ce1d00d36b161a5fc1fa3e8366021ae470cac537133f7e8b9c6f06a2cd2d6a0b81534501ead1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418e7a0176b55cb6af042c837114ab98cba45a083a8a0facece2096ff200c060ed4d162fffa88047eb1f040f1fe0eddb27be712d38021795e3b6b5681c27914cd81c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
}
}
Request for the encoded fill batch order data from KyberSwap. This data can then be executed on-chain from the signer's wallet.
The order IDs to be filled in the batch order.
The amount of takerAsset
in wei. String representation of uint256 value.
If thresholdAmount != 0, the order will be filled if and only if (actualTakingAmount / actualMakingAmount) <= (thresholdAmount / requestedMakingAmount).
The Taker wallet address which will receive the makerAsset
.
The Operator signature obtained from /read-partner/api/v1/orders/operator-signature
. The order must be signed by the operator before it can be filled. Operator signature order must match orderIds
.
OK
Bad Request
- Missing required fields
- takingAmount, thresholdAmount is not uint256
- target is not ETH address
Not Found
- Not found order
Conflict
- Duplicate order ids in request
Internal Server Error
POST /read-ks/api/v1/encode/fill-batch-orders-to HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 297
{
"value": {
"orderIds": [
22452
],
"takingAmount": "10000000000000000",
"thresholdAmount": "0",
"target": "0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7",
"operatorSignatures": [
"23eaa3c40c5f5440a099adcd010505a5e7a6445c52be45481f19bf53fa8721d03a6bcb7ca7242941662c3083bc3a2bea55f5259f72f471cff3b48033ecb747fd1b"
]
}
}
{
"code": 0,
"message": "Succeeded",
"data": {
"encodedData": "0x6fbd13d0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007e00000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000004ab283f00b764bfb9f4d237bd2d9fe670000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000001c954e8fe737f99f68fa1ccda3e51ebdb291948c0000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000324f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044f4a215c3000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044296637bf000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e4961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e30000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000653105410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041ce462832d07c5490f5aca639027dd7f95c682ce5e6ce6a8093f4374f3824acba1107271a51a61fc3fc395b72c61ea22df29dee27f9534342df6e9f44ffcd7d351c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004123eaa3c40c5f5440a099adcd010505a5e7a6445c52be45481f19bf53fa8721d03a6bcb7ca7242941662c3083bc3a2bea55f5259f72f471cff3b48033ecb747fd1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000006530ffd1"
}
}
Last updated
Was this helpful?