Maker APIs

KyberSwap Limit Order Maker APIs

Download OpenAPI specification:

Maker APIs

Create New Order

post

API to create new order for partners/makers

Body
chainIdstringRequired

Support only EVM compatible blockchains.

makerAssetstringRequired

The address of the token you want to sell.

takerAssetstringRequired

The address of the token you want to buy

makerstringRequired

The address of the maker, and signer, of this order.

receiverstringOptional

Address which will receive takerAsset from taker. Default: equal to maker

allowedSendersstring[]Optional

Allowed addresses to call LimitOrder() function. These addresses is the same as taker

makingAmountstringRequired

The amount of makerToken being sold by the maker. Format: uint256

takingAmountstringRequired

The amount of takerToken being sold by the taker Format: uint256

feeRecipientstringOptional

Recipient of maker token or taker token fees (if non-zero)

makerTokenFeePercentstringOptional

Amount of makerToken paid by the taker to the feeRecipient. For example, 20% = 0.2 -> makerTokenFeePercent = 0.2 * 10000 = 2000 Format: uint32

expiredAtintegerRequired

Timestamp in seconds

saltstringRequired

The salt of order - returned from Get signing order message API

signaturestringRequired

Signed by maker

Responses
200
OK
application/json
post
POST /write/api/v1/orders HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 519

{
  "chainId": "5",
  "makerAsset": "0x1a30c9ed6436e03d506227a362b2cbf59a303967",
  "takerAsset": "0x4f6519025e6de0edb6e4901827c1956ce18c39d3",
  "maker": "0xef09879057a9ad798438f3ba561bcdd293d72fc7",
  "receiver": "",
  "allowedSenders": [],
  "makingAmount": "3000000000000000000",
  "takingAmount": "6000000000000000000",
  "feeRecipient": "",
  "takerTokenFeeAmount": "",
  "expiredAt": 1672200257,
  "salt": "123456",
  "signature": "d8ebe9440b60ca3414053d4f46e7f13cb9b0326395387bf86ed027b5adec883f6f63b52e31e1137ddfd211e4689932b37e4b2273066539a91cf43b064fc74df31c"
}
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "id": 1
    }
  }
}

Get current active making amount

get

Get total making amount of a maker which is able to be sold to takers

Query parameters
chainIdstringRequired

Support only EVM compatible blockchains.

makerAssetstringRequired

The address of the token you want to sell

makerstringRequired

The address of the maker, and signer, of this order.

Responses
200
OK
application/json
get
GET /read-ks/api/v1/orders/active-making-amount HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "activeMakingAmount": "1000000000000000000"
    }
  }
}

Get list of order for makers

get
Query parameters
chainIdstringRequired

Support only EVM compatible blockchains.

makerstringRequired

The address of the maker, and signer of orders

statusstring · enumRequired

The status of the order

Possible values:
querystringOptional

Token symbol or token address. Search prefix for symbol, search exact for address

pageinteger · min: 1Optional

Number of pages to return. Minimum and default is set at 1

Default: 1
pageSizeinteger · min: 1 · max: 50Optional

Number of results to display per page. Minimum is 1 and maximum is 50. Default is 10.

Default: 10
Responses
200
OK
application/json
get
GET /read-ks/api/v1/orders HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "orders": [
        {
          "id": 0,
          "chainId": "string",
          "nonce": 0,
          "makerAsset": "string",
          "takerAsset": "string",
          "makerAssetSymbol": "string",
          "takerAssetSymbol": "string",
          "makerAssetDecimals": 0,
          "takerAssetDeicmals": 0,
          "makerAssetLogoURL": "string",
          "takerAssetLogoURL": "string",
          "makingAmount": "string",
          "takingAmount": "string",
          "filledMakingAmount": "string",
          "filledTakingAmount": "string",
          "status": "string",
          "createdAt": 0,
          "expiredAt": 0,
          "transactions": [
            {
              "id": 0,
              "txHash": "string",
              "txTime": 0,
              "makingAmount": "string",
              "takingAmount": "string"
            }
          ]
        }
      ],
      "pagination": {
        "totalItems": 1
      }
    }
  }
}

Get signing order message

post

Get signing message to sign to create order. The response of this API will be used when signing order with Sign Typed Data v4 before Creating New Order API

Body
chainIdstringRequired
makerAssetstringRequired
takerAssetstringRequired
makerstringRequired
receiverstringOptional

Defines who will be received token when the order is filled Default: equal to maker

allowedSendersstring[] · max: 1Optional

Defines who will be able to fill the order

makingAmountstringRequired
takingAmountstringRequired
feeRecipientstringOptional
makerTokenFeePercentstringOptional

Amount of makerToken paid by the taker to the feeRecipient. For example, 20% = 0.2 -> makerTokenFeePercent = 0.2 * 10000 = 2000 Format: uint32

expiredAtintegerRequired

Timestamp in seconds

Responses
200
OK
application/json
post
POST /write/api/v1/orders/sign-message HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 227

{
  "chainId": "text",
  "makerAsset": "text",
  "takerAsset": "text",
  "maker": "text",
  "receiver": "text",
  "allowedSenders": [
    "text"
  ],
  "makingAmount": "text",
  "takingAmount": "text",
  "feeRecipient": "text",
  "makerTokenFeePercent": "text",
  "expiredAt": 1
}
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "types": {
        "EIP712Domain": [
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "version",
            "type": "string"
          },
          {
            "name": "chainId",
            "type": "uint256"
          },
          {
            "name": "verifyingContract",
            "type": "address"
          }
        ],
        "Order": [
          {
            "name": "salt",
            "type": "uint256"
          },
          {
            "name": "makerAsset",
            "type": "address"
          },
          {
            "name": "takerAsset",
            "type": "address"
          },
          {
            "name": "maker",
            "type": "address"
          },
          {
            "name": "receiver",
            "type": "address"
          },
          {
            "name": "allowedSender",
            "type": "address"
          },
          {
            "name": "makingAmount",
            "type": "uint256"
          },
          {
            "name": "takingAmount",
            "type": "uint256"
          },
          {
            "name": "feeRecipient",
            "type": "address"
          },
          {
            "name": "makerTokenFeePercent",
            "type": "uint32"
          },
          {
            "name": "makerAssetData",
            "type": "bytes"
          },
          {
            "name": "takerAssetData",
            "type": "bytes"
          },
          {
            "name": "getMakerAmount",
            "type": "bytes"
          },
          {
            "name": "getTakerAmount",
            "type": "bytes"
          },
          {
            "name": "predicate",
            "type": "bytes"
          },
          {
            "name": "permit",
            "type": "bytes"
          },
          {
            "name": "interaction",
            "type": "bytes"
          }
        ]
      },
      "domain": {
        "name": "Kyber Limit Order Protocol",
        "version": "2",
        "chainId": "5",
        "verifyingContract": "0x973B1847407C579a58E610e5f12003996C5a4f16"
      },
      "primaryType": "Order",
      "message": {
        "salt": "40222148808882531",
        "makerAsset": "0x4f6519025e6de0edb6e4901827c1956ce18c39d3",
        "takerAsset": "0x1a30c9ed6436e03d506227a362b2cbf59a303967",
        "maker": "0xef09879057a9ad798438f3ba561bcdd293d72fc7",
        "receiver": "0xef09879057a9ad798438f3ba561bcdd293d72fc7",
        "allowedSender": "0x0000000000000000000000000000000000000000",
        "makingAmount": "500000000000000000000",
        "takingAmount": "300000000000000000000",
        "feeRecipient": "0x0000000000000000000000000000000000000000",
        "makerTokenFeePercent": "0",
        "makerAssetData": "",
        "takerAssetData": "",
        "getMakerAmount": "f4a215c300000000000000000000000000000000000000000000001b1ae4d6e2ef50000000000000000000000000000000000000000000000000001043561a8829300000",
        "getTakerAmount": "296637bf00000000000000000000000000000000000000000000001b1ae4d6e2ef50000000000000000000000000000000000000000000000000001043561a8829300000",
        "predicate": "961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002892e28b58ab329741f27fd1ea56dca0192a38840000000000000000000000002892e28b58ab329741f27fd1ea56dca0192a38840000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e3000000000000000000000000ef09879057a9ad798438f3ba561bcdd293d72fc7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000636c96e900000000000000000000000000000000000000000000000000000000",
        "permit": "",
        "interaction": ""
      }
    }
  }
}

Generate encoded data for increaseNonce() method

post

increaseNonce() method can be used to cancel all your orders

Responses
200
OK
application/json
post
POST /write/api/v1/encode/increase-nonce HTTP/1.1
Host: limit-order.kyberswap.com
Accept: */*
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "encodedData": "string"
    }
  }
}

Generate encoded data for cancelBatchOrders() method

post
Body
orderIdsinteger[]Required
Responses
200
OK
application/json
post
POST /write/api/v1/encode/cancel-batch-orders HTTP/1.1
Host: limit-order.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 28

{
  "value": {
    "orderIds": [
      1,
      2
    ]
  }
}
{
  "value": {
    "code": 0,
    "message": "Successfully",
    "data": {
      "encodedData": "string"
    }
  }
}

Last updated

Was this helpful?

#477: Elastic fee tier and token launches

Change request updated