Taker APIs

KyberSwap Limit Order Taker APIs

Download OpenAPI specification:

Taker APIs

Get orders for taker

get

This API is used by partners / takers to get orders to fill. This API returns a limited number of orders, sorted by rate desc. Note: rate = ((making_amount - filled_making_amount) * (1 - maker_token_fee_percent) * maker_asset_price_usd - gas_usd) / ((taking_amount - filled_taking_amount) * taker_asset_price_usd)

Query parameters
chainIdstringRequired
makerAssetstringRequired
takerAssetstringRequired
ratenumber · floatOptional

Used to filter orders, only orders having rate greater than or equal are returned

gasUSDnumberOptional

Gas in USD used to calculate rate of orders. If gasUSD is equal to 0 or null, server will calculate gasUSD by itself.

makerAssetPriceUSDnumberOptional

Maker asset's price in USD used to calculate rate of orders. If makerAssetPriceUSD is equal to 0 or null, server will calculate makerAssetPriceUSD by itself.

takerAssetPriceUSDnumberOptional

Taker asset's price in USD used to calculate rate of orders. If takerAssetPriceUSD is equal to 0 or null, server will calculate takerAssetPriceUSD by itself.

Responses
200
OK
application/json
get
GET /read-partner/api/v1/orders HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "orders": [
        {
          "id": 0,
          "chainId": "string",
          "salt": "string",
          "signature": "string",
          "makerAsset": "string",
          "takerAsset": "string",
          "maker": "string",
          "receiver": "string",
          "allowedSenders": "string",
          "makingAmount": "string",
          "takingAmount": "string",
          "filledMakingAmount": "string",
          "filledTakingAmount": "string",
          "feeRecipient": "string",
          "makerTokenFeePercent": "string",
          "makerAssetData": "string",
          "takerAssetData": "string",
          "getMakerAmount": "string",
          "getTakerAmount": "string",
          "predicate": "string",
          "permit": "string",
          "interaction": "string",
          "expiredAt": 0
        }
      ]
    }
  }
}

Generate encoded data for fillOrderTo() method

post

Generate encoded data for fillOrderTo() method

Body
orderIdintegerRequired
takingAmountstringRequired

Format: uint256

thresholdAmountstringRequired

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

targetstringRequired

The wallet address who will be received maker asset

Responses
200
OK
application/json
post
POST /read-partner/api/v1/encode/fill-order-to HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "orderId": 1,
  "takingAmount": "100000000000000000",
  "thresholdAmount": "0",
  "target": "0x123456"
}
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "encodedData": "string"
    }
  }
}

Generate encoded data for fillBatchOrdersTo() method

post
Body
orderIdsinteger[]Required
takingAmountstringRequired

Format: uint256

thresholdAmountstringRequired

Format: uint256

targetstringRequired
Responses
200
OK
application/json
post
POST /read-partner/api/v1/encode/fill-batch-orders-to HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "orderIds": [
    1,
    2,
    3
  ],
  "takingAmount": "1000000000000000000",
  "thresholdAmount": "0",
  "target": "0x123456"
}
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "encodedData": "string"
    }
  }
}

Get current supported pairs of a specific chain

get
Query parameters
chainIdstringRequired
Responses
200
OK
application/json
get
GET /read-partner/api/v1/orders/pairs HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "pairs": [
        {
          "makerAsset": "string",
          "takerAsset": "string"
        }
      ]
    }
  }
}

Last updated

Was this helpful?

#477: Elastic fee tier and token launches

Change request updated