Maker API

Maker API endpoints for creating, querying, and cancelling limit orders.

Maker

Maker endpoints handle the full lifecycle of a limit order from the Maker's perspective: creating orders gaslessly, querying their status, and cancelling them either gaslessly or on-chain.

For step-by-step integration guides, see:


Get Unsigned Create Order Message

POST /write/api/v1/orders/sign-message

Returns an unsigned EIP-712 typed data object that the Maker must sign before submitting an order. The domain, types, and message fields are passed directly to signTypedData.

Get Unsigned Create Order Message

post

Get EIP712 create order message to be signed. The response of this API will need to be signed with Sign Typed Data v4 before submitting create order request to KyberSwap via /write/api/v1/orders.

Body
chainIdstringRequired

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

makerAssetstringRequired

The token address of the asset which the Maker is selling.

takerAssetstringRequired

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

makerstringRequired

The address of the Maker.

receiverstringOptional

Defines who will receive the takerAsset when the order is filled. Default: maker.

allowedSendersstring[] · max: 1Optional

Defines the addresses who are allowed to fill the order.

makingAmountstringRequired

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

takingAmountstringRequired

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

expiredAtintegerRequired

The unix timestamp upon which the order will automatically lapse (i.e. expire).

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post
/write/api/v1/orders/sign-message

Create Order

POST /write/api/v1/orders

Submits a signed limit order to the KyberSwap orderbook. The request body is the unsigned order body extended with salt (from the sign-message response) and signature (from the Maker's wallet).

Create New Order

post

API for Makers to create new orders by sending in order params which includes the signed EIP712 message returned in /write/api/v1/orders/sign-message.

Body
chainIdstringRequired

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

makerAssetstringRequired

The token address of the asset which the Maker is selling.

takerAssetstringRequired

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

makerstringRequired

The address of the Maker.

receiverstringOptional

Defines who will receive the takerAsset when the order is filled. Default: maker.

allowedSendersstring[]Optional

Defines the addresses who are allowed to fill the order.

makingAmountstringRequired

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

takingAmountstringRequired

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

expiredAtintegerRequired

The unix timestamp upon which the order will automatically lapse (i.e. expire).

saltstringRequired

The randomized data fed as an additional input to the hashing function. Returned in /write/api/v1/orders/sign-message.

signaturestringRequired

The signed(signDataTyped) EIP712 creation order returned in /write/api/v1/orders/sign-message.

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post
/write/api/v1/orders

Get Maker Orders

GET /read-ks/api/v1/orders

Returns all orders for a Maker address, filterable by status (active, open, cancelled, filled, expired).

Get List Of Orders By Maker

get

Get all orders created by a Maker address filtered by the order status.

Query parameters
chainIdstringRequired

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

makerstringRequired

The address of the Maker.

statusstring · enumRequired

The status of the order to filter for:

  • active: Order is active (both open and has been partially filled).
  • open: Order is open and has yet to be filled.
  • partially_filled: Order has been partially filled.
  • closed: Order has been closed and can no longer be filled.
  • filled: Order has been filled with no remaining assets to be filled.
  • cancelled: Order was cancelled by the Maker and can no longer be filled.
  • expired: Order can no longer be filled as the expiry set by the Maker is in the past.
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
codeintegerRequired

The response code.

messagestringRequired

Server response message.

get
/read-ks/api/v1/orders

Get Active Making Amount

GET /read-ks/api/v1/orders/active-making-amount

Returns the total makingAmount currently committed across all open orders for a Maker and token. Use this before creating a new order to determine the total allowance required.

Get Maker Active Making Amount

get

Get the Maker's total making amount for a specified token.

Query parameters
chainIdstringRequired

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

makerAssetstringRequired

The token address of the asset which the Maker is selling.

makerstringRequired

The address of the Maker.

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

get
/read-ks/api/v1/orders/active-making-amount

Get Unsigned Cancel Message

POST /write/api/v1/orders/cancel-sign

Returns an unsigned EIP-712 cancel message for one or more orderIds. Sign the returned message and pass it to POST /write/api/v1/orders/cancel.

Get Unsigned Cancel Order(s) Message

post

Get EIP712 cancel order message to be signed (i.e. 'Gasless Cancel'). The response of this API will need to be signed with Sign Typed Data v4 before submitting create order request to KyberSwap via /write/api/v1/orders/cancel.

Body
chainIdstringRequired

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

makerstringRequired

The address of the Maker that created the order.

orderIdsinteger[]Required

The order IDs to be cancelled gaslessly.

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post
/write/api/v1/orders/cancel-sign

Gasless Cancel Order

POST /write/api/v1/orders/cancel

Submits a signed gasless cancel request. The KyberSwap Operator will stop co-signing the specified orders. If the Operator recently signed an order, cancellation may take up to 5 minutes.

Requires the Origin header to be set.

Submit Gasless Cancel Order(s)

post

API for Makers to gaslessly cancel orders by sending in order params which includes the signed EIP712 message returned in /write/api/v1/orders/cancel-sign.

Header parameters
OriginstringRequired

Required to include 'https://kyberswap.com' to authenticate the POST call.

Body
chainIdstringRequired

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

makerstringRequired

The address of the Maker that created the order.

orderIdsinteger[]Required

The order IDs to be cancelled gaslessly.

signaturestringRequired

The signed(signDataTyped) EIP712 cancellation order returned in /write/api/v1/orders/cancel-sign.

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post
/write/api/v1/orders/cancel

Encode Hard Cancel

POST /read-ks/api/v1/encode/cancel-batch-orders

Returns encoded calldata to cancel one or more specific orders on-chain. Multiple orderIds can be batched into a single transaction. The caller pays gas but the cancellation is immediate.

Generate Encoded Data For Batch Cancellation

post

Request for the cancellation encoded data from KyberSwap. This data can then be executed on-chain from the signer's wallet.

Body
orderIdsinteger[]Required

The order IDs to be cancelled on-chain.

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post
/read-ks/api/v1/encode/cancel-batch-orders

Encode Increase Nonce

POST /read-ks/api/v1/encode/increase-nonce

Returns encoded calldata to increment the Maker's nonce in the Limit Order contract, which immediately invalidates all open orders. Use when you want to cancel everything at once.

Generate Encoded Data For Cancel All

post

Request for the cancel all encoded data from KyberSwap. By increasing the LO contract nonce tied to the Maker, the LO contract is able to nullify all existing orders. This data can then be executed on-chain from the Maker's wallet.

Responses
200

OK

application/json
codeintegerRequired

The response code.

messagestringRequired

Server response message.

post
/read-ks/api/v1/encode/increase-nonce

Last updated

Was this helpful?