For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Taker API

Taker

Taker endpoints cover the full fill flow: query open orders sorted by best rate, obtain the required Operator co-signature, encode the fill calldata, and execute on-chain.

For a step-by-step guide, see Fill a Limit Order.

For taker protocol fees and the rate calculation formula, see Fee Structure.


Get Open Orders

GET /read-partner/api/v1/orders

Returns open orders for a token pair sorted by best effective rate (descending). The rate accounts for partial fills and protocol fees — see Fee Structure.

Get Orders By Token Pair

get

Returns active (open and partially_filled) orders for the queried token pair, sorted by rate (makingAmount / takingAmount) in descending order, i.e. best rate for the Taker first.

A bounded number of best-rate orders is read, and then filtered:

  • Orders whose Maker is blacklisted are removed.

  • Private orders (non-zero allowedSenders) are removed, unless includePrivateOrder or includeAllowedSenders is set.

  • Orders whose Maker balance or allowance cannot cover the remaining amount are removed, unless includeInsufficientBalance=true.

Balance allocation. availableMakingAmount is allocated greedily per Maker in rate order. A Maker's balance and allowance are consumed by that Maker's better-rate orders first, so the amounts across a Maker's orders in one response never exceed the Maker's last known balance and allowance.

Hex fields. signature, getMakerAmount, getTakerAmount, predicate, interaction, orderHash and similar hex fields are returned without a 0x prefix; an empty value means empty bytes.

Query parameters
chainIdstringRequired

The chainId of the network to query.

makerAssetstringRequired

The token address of the asset which the Taker expects in return.

takerAssetstringRequired

The token address of the asset which the Taker is exchanging.

contractAddressstringOptional

Optional. Only return orders created on this limit order contract.

includeInsufficientBalancebooleanOptional

When true, orders whose Maker balance or allowance cannot fully cover the remaining amount are included, with availableMakingAmount reduced to what is actually fillable.

Default: false
includePrivateOrderbooleanOptional

When true, private orders (orders restricted to specific allowedSenders) are included.

Default: false
includeAllowedSendersstringOptional

Comma-separated list of lowercase addresses. When set, the response contains public orders plus private orders whose allowedSenders include one of these addresses (includePrivateOrder is then ignored).

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

get/read-partner/api/v1/orders
GET /read-partner/api/v1/orders?chainId=text&makerAsset=text&takerAsset=text HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "code": 0,
  "message": "Succeeded",
  "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,
        "orderHash": "57e2bec735db51269aff31b60f4a02f8bd2ef2e554c1433bbd0aea914c378f3a",
        "clientId": "my-dapp",
        "isTakerAssetFee": false,
        "makerAssetDecimals": 6,
        "takerAssetDecimals": 18,
        "availableMakingAmount": "7000",
        "makerBalanceAllowance": "7000"
      }
    ]
  }
}

Get Operator Signature

GET /read-partner/api/v1/orders/operator-signature

Returns the KyberSwap Operator co-signature for one or more orders. This signature is required as part of the fill calldata and is short-lived — fetch it immediately before building the fill transaction.

Request Operator Signature For Maker Orders

get

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.

Lifetime. Operator signatures are short-lived (minutes). Always rely on the returned operatorSignatureExpiredAt and do not hard-code a lifetime. A signature is re-issued unchanged while enough validity remains, so repeated calls within that window return the same signature. Fill before operatorSignatureExpiredAt; a transaction mined after it reverts on-chain.

Only active orders are signed. Order IDs that do not exist or are no longer active are silently omitted from the response; there is no 404. Request only what you are about to fill: polling this endpoint for large ID sets is discouraged.

Query parameters
chainIdstringRequired

The chainId on which the order is being filled. Only supports EVM chains.

orderIdsinteger[] · min: 1 · max: 100Required

The IDs of the orders to be filled, sent as repeated query keys (e.g. orderIds=22452&orderIds=22453), between 1 and 100 unique IDs. A comma-separated single value is rejected (400/4003).

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

get/read-partner/api/v1/orders/operator-signature
GET /read-partner/api/v1/orders/operator-signature?chainId=text&orderIds=1 HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "code": 0,
  "message": "Succeeded",
  "data": {
    "orders": [
      {
        "id": 22452,
        "chainId": "137",
        "operatorSignature": "10cde325b99d3616c4d1e0557b8d45c86137e854af12515b4167a72a817c101d64c75a365dbeef6b50f2a6694f0692fe85abfa827af278ac00f56ba942b91b0f1b",
        "operatorSignatureExpiredAt": 1697708112
      }
    ]
  }
}

Encode Fill Order

POST /read-ks/api/v1/encode/fill-order-to

Returns encoded calldata to fill a single order on-chain. The encoded data is sent as data in the transaction to the Limit Order contract.

Field
Description

orderId

The order to fill

takingAmount

Amount of takerAsset to provide (can be partial)

thresholdAmount

Minimum makingAmount to receive — reverts if not met (slippage guard)

target

Address to receive the makerAsset

operatorSignature

From GET /read-partner/api/v1/orders/operator-signature

Generate Encoded Data To Fill Order

post

Request for the encoded fill order data from KyberSwap. This data can then be executed on-chain from the Taker's wallet, sent to the order's contractAddress.

The calldata embeds the order's current operator-signature expiry as stored by KyberSwap. Use a signature from /read-partner/api/v1/orders/operator-signature that has not expired, otherwise the transaction reverts.

Also served as /read-partner/api/v1/encode/fill-order-to.

Body
orderIdintegerRequired

The ID of the order to be filled.

takingAmountstringRequired

The amount of takerAsset in wei. String representation of uint256 value.

thresholdAmountstringRequired

If thresholdAmount != 0, the order will be filled if and only if (actualTakingAmount / actualMakingAmount) <= (thresholdAmount / requestedMakingAmount).

targetstringRequired

The Taker wallet address which will receive the makerAsset.

operatorSignaturestringRequired

The Operator signature obtained from /read-partner/api/v1/orders/operator-signature (with or without 0x prefix). Required for orders on contracts with supportDoubleSignature: true; missing it returns 400/4000 (operatorSignature).

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post/read-ks/api/v1/encode/fill-order-to
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"
}
{
  "code": 0,
  "message": "Succeeded",
  "data": {
    "encodedData": "0xd2f1d95600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000006530fdc60000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000aef7e6a8082647289728e7d3ca198b9a0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000001c954e8fe737f99f68fa1ccda3e51ebdb291948c0000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000324f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044f4a215c3000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044296637bf000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e4961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e30000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b000000000000000000000000000000000000000000000000000000006531054900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000417d01d984f71c81e9413a9b8ffababca76101c36259a84416cf579ce1d00d36b161a5fc1fa3e8366021ae470cac537133f7e8b9c6f06a2cd2d6a0b81534501ead1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418e7a0176b55cb6af042c837114ab98cba45a083a8a0facece2096ff200c060ed4d162fffa88047eb1f040f1fe0eddb27be712d38021795e3b6b5681c27914cd81c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  }
}

Encode Fill Batch Orders

POST /read-ks/api/v1/encode/fill-batch-orders-to

Returns encoded calldata to fill multiple orders in a single on-chain transaction. The orderIds array and operatorSignatures array must be in the same order.

Generate Encoded Data To Fill Batch Order

post

Request for the encoded fill batch order data from KyberSwap. This data can then be executed on-chain from the Taker's wallet, sent to the orders' contractAddress.

All orders must be active, on the same chain and contract, have the same makerAsset and takerAsset, and charge the fee on the same side (isTakerAssetFee).

Also served as /read-partner/api/v1/encode/fill-batch-orders-to.

Body
orderIdsinteger[] · min: 1Required

The order IDs to be filled in the batch order. Must be unique.

takingAmountstringRequired

The amount of takerAsset in wei. String representation of uint256 value.

thresholdAmountstringRequired

If thresholdAmount != 0, the order will be filled if and only if (actualTakingAmount / actualMakingAmount) <= (thresholdAmount / requestedMakingAmount).

targetstringRequired

The Taker wallet address which will receive the makerAsset.

operatorSignaturesstring[]Required

The Operator signatures obtained from /read-partner/api/v1/orders/operator-signature, in the same order as orderIds (with or without 0x prefix). For double-signature contracts it must have exactly as many entries as orderIds (otherwise 400/4002) and none may be empty (otherwise 400/4000).

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post/read-ks/api/v1/encode/fill-batch-orders-to
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: 287

{
  "orderIds": [
    22452
  ],
  "takingAmount": "10000000000000000",
  "thresholdAmount": "0",
  "target": "0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7",
  "operatorSignatures": [
    "23eaa3c40c5f5440a099adcd010505a5e7a6445c52be45481f19bf53fa8721d03a6bcb7ca7242941662c3083bc3a2bea55f5259f72f471cff3b48033ecb747fd1b"
  ]
}
{
  "code": 0,
  "message": "Succeeded",
  "data": {
    "encodedData": "0x6fbd13d0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007e00000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000004ab283f00b764bfb9f4d237bd2d9fe670000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000001c954e8fe737f99f68fa1ccda3e51ebdb291948c0000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a70000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000324f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044f4a215c3000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044296637bf000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e4961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e30000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000653105410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041ce462832d07c5490f5aca639027dd7f95c682ce5e6ce6a8093f4374f3824acba1107271a51a61fc3fc395b72c61ea22df29dee27f9534342df6e9f44ffcd7d351c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004123eaa3c40c5f5440a099adcd010505a5e7a6445c52be45481f19bf53fa8721d03a6bcb7ca7242941662c3083bc3a2bea55f5259f72f471cff3b48033ecb747fd1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000006530ffd1"
  }
}

Last updated

Was this helpful?