Place a Limit Order
Sign and submit a gasless limit order as a Maker using the KyberSwap Limit Order API.
Place a Limit Order
Flow
POST /sign-message → sign EIP-712 → check allowance → POST /ordersStep 1 — Get the Unsigned EIP-712 Message
const requestBody = {
chainId: "137", // Polygon
makerAsset: "0x2791bca1...", // USDC
takerAsset: "0x1C954E8f...", // KNC
maker: signerAddress,
allowedSenders: [signerAddress], // optional: restrict who can fill
makingAmount: "10000", // 0.01 USDC (6 decimals)
takingAmount: "20000000000000000", // 0.02 KNC (18 decimals)
expiredAt: Math.floor(Date.now() / 1000) + 3600 // expires in 1 hour
};
const { data } = await axios.post(
"https://limit-order.kyberswap.com/write/api/v1/orders/sign-message",
requestBody
);
// data contains: domain, types, message (unsigned EIP-712)Step 2 — Check and Set Allowance
Step 3 — Sign the EIP-712 Message
Step 4 — Submit the Order
Related
Last updated
Was this helpful?