# Kyberswap ( Limit Order Endpoints )

### Supported Chains

Available on **Ethereum, Binance, Polygon, Arbitrum, Avalanche, Optimism, Base, Fantom and Cronos**

### Available Endpoints:

*Click on the endpoint to jump to the section with full details*

* [<mark style="color:blue;">/getmakerorders</mark>](#getmakerorders) <mark style="color:blue;">`GET`</mark>- Returns all active limit orders posted by the maker.
* [<mark style="color:blue;">/getorders</mark> ](#getorders)<mark style="color:blue;">`GET`</mark> - Returns all active orders based on the maker and taker assets.
* [/<mark style="color:blue;">getactiveamount</mark>](#getactiveamount) <mark style="color:blue;">`GET`</mark> - Returns the maker's active amount for a particular maker asset.
* [<mark style="color:blue;">/createorder</mark>](#createorder) <mark style="color:green;">`POST`</mark> - Prepares an unsigned limit order message that will post a limit order once signed with the Expand SDK.
* [/<mark style="color:blue;">cancelorder</mark>](#cancelorder) <mark style="color:green;">`POST`</mark> - Prepares an unsigned message that will cancel a limit order once signed with the Expand SDK.&#x20;
* [<mark style="color:blue;">/publishorder</mark>](#publishorder) <mark style="color:green;">`POST`</mark> - Sends a request to create or cancel a limit order to Kyberswap.
* [<mark style="color:blue;">/fillorder</mark>](#fillorder) <mark style="color:green;">`POST`</mark> - Initiates a transaction to fill a particular limit order.

*Also see* [<mark style="color:blue;">Error Handling Details</mark>](#error-handling-details)

### DEX IDs

Below is a list DEX IDs related to Kyberswap (Limit Order). Please see the [<mark style="color:blue;">DEX ID page</mark>](broken://pages/8x8qwIu19Aq8uFsjOXvI) for a complete DEX ID list and more information.

| DEX Name  | Chain     | DEX ID |
| --------- | --------- | ------ |
| Kyberswap | Ethereum  | 2200   |
| Kyberswap | Binance   | 2201   |
| Kyberswap | Polygon   | 2202   |
| Kyberswap | Arbitrum  | 2203   |
| Kyberswap | Avalanche | 2204   |
| Kyberswap | Optimism  | 2205   |
| Kyberswap | Base      | 2206   |
| Kyberswap | Fantom    | 2207   |
| Kyberswap | Cronos    | 2208   |

## Endpoint Details

### /getmakerorders

This endpoint fetches all the active limit orders posted by the maker.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getmakerorders`

#### Query Parameters

| Name                                      | Type   | Description                                                                                                   |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL.                                                                                   |
| dexId<mark style="color:red;">\*</mark>   | String | Refer to the [<mark style="color:blue;">DEX ID</mark>](broken://pages/8x8qwIu19Aq8uFsjOXvI) page for details. |
| address<mark style="color:red;">\*</mark> | String | Public address of the user.                                                                                   |
| pageToken                                 | String | <p>The page number that the user wants to fetch.</p><p>By default, 1.</p>                                     |

{% tabs %}
{% tab title="Sample Request" %}

```
https://api.expand.network/dex/getmakerorders?dexId=2202&address=0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402&pageToken=1
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "totalPages": "1",
        "currentPage": "1",
        "orders": [
            {
                "id": "96091",
                "chainId": "137",
                "nonce": "0",
                "makerAsset": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
                "takerAsset": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
                "contractAddress": "0xcab2fa2eeab7065b45cbcf6e3936dde2506b4f6c",
                "orderHash": "e65bba101d10984825a1480f124cb1cdbed65ff86d8904f310b08fd3ddac0fcd",
                "makerAssetSymbol": "wMATIC",
                "takerAssetSymbol": "USDT",
                "makerAssetLogoURL": "https://assetlogo.expand.network/ethereum/wMATIC.png",
                "takerAssetLogoURL": "https://assetlogo.expand.network/ethereum/USDT.png",
                "makerAssetDecimals": "18",
                "takerAssetDecimals": "18",
                "makingAmount": "1000000000000000000",
                "takingAmount": "3510540868",
                "filledMakingAmount": "0",
                "filledTakingAmount": "0",
                "status": "open",
                "createdAt": "1721535038",
                "expiredAt": "4875135021",
                "operatorSignatureExpiredAt": "0",
                "transactions": [],
                "rate": "0.0002848564"
            },
            {
                "id": "95180",
                "chainId": "137",
                "nonce": "0",
                "makerAsset": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
                "takerAsset": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
                "contractAddress": "0xcab2fa2eeab7065b45cbcf6e3936dde2506b4f6c",
                "orderHash": "74bd0abac4ade77fef8da6534f31917125b72d39058084ed111c759556caac85",
                "makerAssetSymbol": "wMATIC",
                "takerAssetSymbol": "USDT",
                "makerAssetLogoURL": "https://assetlogo.expand.network/ethereum/wMATIC.png",
                "takerAssetLogoURL": "https://assetlogo.expand.network/ethereum/USDT.png",
                "makerAssetDecimals": "18",
                "takerAssetDecimals": "18",
                "makingAmount": "1000000000000000000",
                "takingAmount": "500000",
                "filledMakingAmount": "899654000000000000",
                "filledTakingAmount": "449827",
                "status": "partially_filled",
                "createdAt": "1721385861",
                "expiredAt": "1821077034",
                "operatorSignatureExpiredAt": "1721545571",
                "transactions": [
                    {
                        "id": 46644,
                        "txHash": "0x9f361fde8f151564a6c8cab5185a47437cba796bcb384a6c08e8f8e70e4670b0",
                        "txTime": 1721386500,
                        "makingAmount": "404488000000000000",
                        "takingAmount": "202244",
                        "makingAmountUSD": "0.2063639604153792",
                        "takingAmountUSD": "0.160126336739344"
                    },
                    {
                        "id": 46677,
                        "txHash": "0x0a4d37f725669f61180549b608af0867e971a34f7c035f5c7d3fa7991ecbdbef",
                        "txTime": 1721395816,
                        "makingAmount": "384054000000000000",
                        "takingAmount": "192027",
                        "makingAmountUSD": "0.1969303732671132",
                        "takingAmountUSD": "0.1527915727524475"
                    },
                    {
                        "id": 46767,
                        "txHash": "0x9cd999dbbe8b799ede0d32cf3ee34aa85944045a663696d0775d646374b0f2a8",
                        "txTime": 1721432384,
                        "makingAmount": "111112000000000000",
                        "takingAmount": "55556",
                        "makingAmountUSD": "0.05930734362162",
                        "takingAmountUSD": "0.0460451920888665"
                    }
                ],
                "rate": "2.0000000000"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getorders

This endpoint provides all active orders based on the maker and taker assets.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getorders`

#### Query Parameters

| Name                                         | Type   | Description                                                                                                 |
| -------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| rpc                                          | String | Remote procedural call URL.                                                                                 |
| dexId<mark style="color:red;">\*</mark>      | String | Refer to  [<mark style="color:blue;">DEX ID</mark>](broken://pages/8x8qwIu19Aq8uFsjOXvI)  page for details. |
| makerAsset<mark style="color:red;">\*</mark> | String | The token address of the asset which the Maker is selling.                                                  |
| takerAsset<mark style="color:red;">\*</mark> | String | The token address of the asset which the Maker expects in return.                                           |

{% tabs %}
{% tab title="Sample Request" %}

```
https://api.expand.network/dex/getorders?dexId=2202&makerAsset=0x2791bca1f2de4661ed88a30c99a7a9449aa84174&takerAsset=0xc2132d05d31c914a87c6611c10748aeb04b58e8f
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "totalPages": "1",
        "currentPage": "1",
        "orders": [
            {
                "id": "3822",
                "chainId": "137",
                "signature": "5282e03196e58d74c7e633f89a67a7f65d5ff781789ff576b9820253f7139efe3a66b1b8e818280af4b03859360941f2746b6beb2985b53ed609527bc6cee5501b",
                "salt": "70625134037672101032634555633607691523",
                "makerAsset": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
                "takerAsset": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
                "maker": "0x503d741356f80b919458f0599666c4f00120f6c1",
                "contractAddress": "0x227b0c196ea8db17a665ea6824d972a64202e936",
                "receiver": "0x503d741356f80b919458f0599666c4f00120f6c1",
                "allowedSenders": "0x0000000000000000000000000000000000000000",
                "makingAmount": "1000000",
                "takingAmount": "4900000000000",
                "filledMakingAmount": "0",
                "filledTakingAmount": "0",
                "feeConfig": "0",
                "feeRecipient": "0x0000000000000000000000000000000000000000",
                "makerTokenFeePercent": "0",
                "makerAssetData": "",
                "takerAssetData": "",
                "getMakerAmount": "f4a215c300000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000474dec26800",
                "getTakerAmount": "296637bf00000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000474dec26800",
                "predicate": "961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000227b0c196ea8db17a665ea6824d972a64202e936000000000000000000000000227b0c196ea8db17a665ea6824d972a64202e9360000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e3000000000000000000000000503d741356f80b919458f0599666c4f00120f6c1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b000000000000000000000000000000000000000000000000000000006a8024b400000000000000000000000000000000000000000000000000000000",
                "permit": "",
                "interaction": "",
                "expiredAt": "1786782900",
                "orderHash": "8312abeb662786741364702d5858da05394a7e441dab1bd753daf1a5369d1011",
                "availableMakingAmount": "1000000",
                "makerBalanceAllowance": "3309150",
                "rate": "0.0000002041"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getactiveamount

This endpoint retrieves the maker's active amount for a particular maker asset.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getactiveamount`

#### Query Parameters

| Name                                           | Type   | Description                                                                                                 |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| rpc                                            | String | Remote procedural call URL.                                                                                 |
| dexId<mark style="color:red;">\*</mark>        | String | Refer to  [<mark style="color:blue;">DEX ID</mark>](broken://pages/8x8qwIu19Aq8uFsjOXvI)  page for details. |
| address<mark style="color:red;">\*</mark>      | String | Public address of the user.                                                                                 |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of the token.                                                                                       |

{% tabs %}
{% tab title="Sample Request" %}

```
https://api.expand.network/dex/getactiveamount?dexId=2200&tokenAddress=0x853d955acef822db058eb8505911ed77f175b99e&address=0xB409cB0b5DB9f148d0bc491E140D9E0FDd789C11
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "address": "0xB409cB0b5DB9f148d0bc491E140D9E0FDd789C11",
        "tokenAddress": "0x853d955acef822db058eb8505911ed77f175b99e",
        "activeMakingAmount": "400000000000000"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /createorder

This endpoint returns a limit order unsigned message that needs to be signed with the expand SDK to post a limit order.

<mark style="color:blue;">`POST`</mark> `https://api.expand.network/dex/createorder`

#### Query Parameters

| Name                                         | Type   | Description                                                                                                 |
| -------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| rpc                                          | String | Remote procedural call URL.                                                                                 |
| dexId<mark style="color:red;">\*</mark>      | String | Refer to  [<mark style="color:blue;">DEX ID</mark>](broken://pages/8x8qwIu19Aq8uFsjOXvI)  page for details. |
| makerAsset<mark style="color:red;">\*</mark> | String | The token address of the asset which the Maker is selling.                                                  |
| takerAsset<mark style="color:red;">\*</mark> | String | The token address of the asset which the Maker expects in return.                                           |
| from<mark style="color:red;">\*</mark>       | String | Address of the sender of the token.                                                                         |
| to<mark style="color:red;">\*</mark>         | String | Address of the recipient of the token.                                                                      |
| amountIn<mark style="color:red;">\*</mark>   | String | Amount in of token.                                                                                         |
| amountOut<mark style="color:red;">\*</mark>  | String | Amount out of token.                                                                                        |
| deadline<mark style="color:red;">\*</mark>   | String | Deadline for the transaction to be executed (UNIX Timestamp).                                               |

{% tabs %}
{% tab title="Sample Request" %}

```
{
    "dexId": "2202",
    "makerAsset": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
    "takerAsset": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "amountIn": "1000000000000000000",
    "amountOut": "500000",
    "deadline": "1821077034"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "unsignedCreateOrder": {
            "types": {
                "DSOrder": [
                    {
                        "name": "orderHash",
                        "type": "bytes32"
                    },
                    {
                        "name": "opExpireTime",
                        "type": "uint32"
                    }
                ],
                "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": "feeConfig",
                        "type": "uint256"
                    },
                    {
                        "name": "makerAssetData",
                        "type": "bytes"
                    },
                    {
                        "name": "takerAssetData",
                        "type": "bytes"
                    },
                    {
                        "name": "getMakerAmount",
                        "type": "bytes"
                    },
                    {
                        "name": "getTakerAmount",
                        "type": "bytes"
                    },
                    {
                        "name": "predicate",
                        "type": "bytes"
                    },
                    {
                        "name": "interaction",
                        "type": "bytes"
                    }
                ]
            },
            "domain": {
                "chainId": "137",
                "name": "Kyber DSLO Protocol",
                "verifyingContract": "0xcab2FA2eeab7065B45CBcF6E3936dDE2506b4f6C",
                "version": "1"
            },
            "primaryType": "Order",
            "message": {
                "allowedSender": "0x0000000000000000000000000000000000000000",
                "feeConfig": "146604093245187877466343990972209337885448885627689",
                "getMakerAmount": "0xf4a215c30000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000007a120",
                "getTakerAmount": "0x296637bf0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000007a120",
                "interaction": "0x",
                "maker": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
                "makerAsset": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
                "makerAssetData": "0x",
                "makingAmount": "1000000000000000000",
                "predicate": "0x961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e3000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b000000000000000000000000000000000000000000000000000000006c8b6e2a00000000000000000000000000000000000000000000000000000000",
                "receiver": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
                "salt": "106607874126107032926667449974930188158",
                "takerAsset": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
                "takerAssetData": "0x",
                "takingAmount": "500000"
            }
        },
        "referenceId": "efbbc600a72441fd9390ffc15049a787"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /cancelorder

This endpoint returns an unsigned message for canceling a limit order, which needs to be signed with expand SDK.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/dex/cancelorder`

#### Request Body

| Name                                      | Type   | Description                                                                                                     |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL.                                                                                     |
| dexId<mark style="color:red;">\*</mark>   | String | Refer to the  [<mark style="color:blue;">DEX ID</mark>](broken://pages/8x8qwIu19Aq8uFsjOXvI)  page for details. |
| orderId<mark style="color:red;">\*</mark> | Array  | OrderId of the transaction                                                                                      |
| from<mark style="color:red;">\*</mark>    | String | Public address of the user.                                                                                     |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "dexId": "2202",
    "orderId": "95167",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "unsignedCancelOrder": {
            "types": {
                "CancelOrder": [
                    {
                        "name": "chainId",
                        "type": "string"
                    },
                    {
                        "name": "maker",
                        "type": "address"
                    },
                    {
                        "name": "orderIds",
                        "type": "uint64[]"
                    }
                ],
                "EIP712Domain": [
                    {
                        "name": "name",
                        "type": "string"
                    },
                    {
                        "name": "version",
                        "type": "string"
                    },
                    {
                        "name": "chainId",
                        "type": "uint256"
                    }
                ]
            },
            "domain": {
                "chainId": "137",
                "name": "Kyber Limit Order Protocol",
                "version": "1"
            },
            "primaryType": "CancelOrder",
            "message": {
                "chainId": "137",
                "maker": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
                "orderIds": [
                    95167
                ]
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /publishorder

This endpoint sends the request to create or cancel a limit order to Kyberswap.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/dex/publishorder`

#### Request Body For Create Order

<table><thead><tr><th width="235">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>dexId<mark style="color:red;">*</mark></td><td>String</td><td>Refer to the  <a href="/pages/8x8qwIu19Aq8uFsjOXvI"><mark style="color:blue;">DEX ID</mark></a>  page for details. </td></tr><tr><td>orderType</td><td>String</td><td>Type of the Order. <br>Either "create" or "cancel". By default, "create".</td></tr><tr><td>makerAsset<mark style="color:red;">*</mark></td><td>String</td><td>The token address of the asset which the Maker is selling.</td></tr><tr><td>takerAsset<mark style="color:red;">*</mark></td><td>String</td><td>The token address of the asset which the Maker expects in return.</td></tr><tr><td>from<mark style="color:red;">*</mark></td><td>String</td><td>Address of the sender of the token.</td></tr><tr><td>to<mark style="color:red;">*</mark></td><td>String</td><td>Address of the recipient of the token.</td></tr><tr><td>amountIn<mark style="color:red;">*</mark></td><td>String</td><td>Amount in of token.</td></tr><tr><td>amountOut<mark style="color:red;">*</mark></td><td>String</td><td>Amount out of token.</td></tr><tr><td>deadline<mark style="color:red;">*</mark></td><td>String</td><td>Deadline for the transaction to be executed (UNIX Timestamp).</td></tr><tr><td>signature<mark style="color:red;">*</mark></td><td>String</td><td>The signed(signDataTyped) EIP712 creation order.</td></tr><tr><td>salt<mark style="color:red;">*</mark></td><td>String</td><td>The randomized data fed as an additional input to the hashing function.</td></tr></tbody></table>

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "dexId": "2202",
    "makerAsset": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
    "takerAsset": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "amountIn": "200000",
    "amountOut": "100000",
    "deadline": "1821077034",
    "signature": "0x6afd61462c4188b277123d575c4c09c00cbdc654462d3c6937e7ff69d90391e573fe44a81f5fcc0184cc4f5afc54c9d60a46be11176688f034bba92e20597c311c",
    "salt": "140518201020656697335313758999689041588"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "orderId": "97837",
    "orderStatus": "Succeeded",
    "referenceId": "23479c6e906f49b8be4dccd062f69676"
  }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /fillorder

This endpoint initiates the transaction to fill the particular limit order.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/dex/fillorder`

#### Request Body

<table><thead><tr><th width="274">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>dexId<mark style="color:red;">*</mark></td><td>String</td><td>Refer to the  <a href="/pages/8x8qwIu19Aq8uFsjOXvI"><mark style="color:blue;">DEX ID</mark></a>  page for details. </td></tr><tr><td>orderId<mark style="color:red;">*</mark></td><td>Array</td><td>The ID of the order to be filled.</td></tr><tr><td>amountIn<mark style="color:red;">*</mark></td><td>Array</td><td>The amountin of takerAsset</td></tr><tr><td>from<mark style="color:red;">*</mark></td><td>String</td><td>The Taker wallet address which will receive the makerAsset.</td></tr><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr></tbody></table>

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "dexId": "2202",
    "orderId": "95180",
    "from": "0x42a0eef97019bf6f15796fc9a015f681c581f77a",
    "amountIn": "10000000000000000",
    "gasPriority": "low"
}
```

{% endtab %}

{% tab title="Sample Response" %}
With Slippage:

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "137",
        "from": "0x42a0eef97019bf6f15796fc9a015f681c581f77a",
        "to": "0xcab2FA2eeab7065B45CBcF6E3936dDE2506b4f6C",
        "value": "0",
        "data": "0xd2f1d95600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000669cdcb000000000000000000000000042a0eef97019bf6f15796fc9a015f681c581f77a000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000fbdccc06511746daa8d2280e6d33a21f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000644f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044f4a215c30000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044296637bf0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e4961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e3000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b000000000000000000000000000000000000000000000000000000006c8b6e2a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000419aa918d0001e995fc1b2f4302fcadd64b702ca9802962ac437298b4a6c159ea7260d809a76e5718bb4bc84bcf80baed6299bfada2e839a70c7d6ac18090af2ea1c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041d7c56c4419dc47b359f8a3e006c212ad313e2b4c5a902c24225743514f0e85f44a52beaca4c0329a78047c231cced261ab834efab6cb90b84244ef7105e0d0771c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "gasPrice": "30000000029",
        "referenceId": "8a095c21d72b411ba742ab546042f716"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### Error Handling Details

<table><thead><tr><th width="253">Error</th><th>Description</th></tr></thead><tbody><tr><td>400 (Bad Request)</td><td>Indicates the request is invalid or missing the required parameters. The msg field will contain details about the error.</td></tr><tr><td>401 (Unauthorised)</td><td>Indicates the request lacks valid authentication credentials (API key). Ensure that you provide a valid API key in the request headers.</td></tr><tr><td>404 (Not Found)</td><td>Indicates that the specified endpoint or resource does not exist.</td></tr><tr><td>500 (Server Error)</td><td>Indicates an internal server error.</td></tr></tbody></table>

[<mark style="color:blue;">back to top</mark>](#endpoints-available)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.expand.network/integrations/dex-and-dex-aggregators/kyberswap-aggregator/kyberswap-limit-order-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
