Skip to content
Docs
Actions
Making Orders

Making Orders

aori_makeOrder

This method allows users to create and place an order on the orderbook. Once an order is made, it's broadcasted to orderbook subscribers.

ParametersTypeRequiredDescription
apiKeystringYesAPI key
order.offererstringYesAddress of the authorized maker making this limit order.
order.inputTokenstringYesAddress of Input Token e.g 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 for Uniswap
order.inputAmountstringYesStringified integer representing amount of input token.
order.inputChainIdnumberYesInteger representing chain id that input token exists on e.g 1 for Ethereum Mainnet
order.inputZonestringYesAn address representing the version of Aori you are using. You can use the current version by setting this to 0xcd2a3d9f938e13cd947Ec05AbC7FE734Df8DD826.
order.outputTokenstringYesAddress of Output Token e.g 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 for Uniswap
order.outputAmountstringYesStringified integer representing amount of output token.
order.outputChainIdnumberYesInteger representing chain id that output token exists on e.g 1 for Ethereum Mainnet
order.outputZonestringYesAn address representing the version of Aori you are using. You can use the current version by setting this to 0xcd2a3d9f938e13cd947Ec05AbC7FE734Df8DD826.
order.startTimestringYesStringified integer representing the Unix (seconds) timestamp of a limit order's start time.
order.endTimestringYesStringified integer representing the Unix (seconds) timestamp of a limit order's end time.
order.saltstringYesA random stringified integer for randomness.
order.counternumberYesA specific counter representing the "cancel index". Generally, this should be set to 0.
order.toWithdrawbooleanYesA boolean representing if the user wants to withdraw their tokens or keep them in the on-chain contract for gas efficiency.
signaturestringYesA signature by the user of the order.
isPublicbooleanNoA boolean representing if the order is public
{
  "id": <unique_request_id>,
  "jsonrpc": "2.0",
  "method": "aori_makeOrder",
  "params": [{
    "order": {
      // Order details
        "offerer": "0x...",
        "inputToken": "0x...",
        "inputAmount": "10000...",
        "inputChainId": 1,
        "inputZone": "0x...",
        "outputToken": "0x...",
        "outputAmount": "10000...",
        "outputChainId": 1,
        "outputZone": "0x...",
        "startTime": "0",
        "endTime": "10000...",
        "salt": "12345678",
        "counter": 0,
        "toWithdraw": true,
    },
    "signature": <signed typed signature of order>,
    "isPublic": <true_or_false>,
    "apiKey": "<api_key_or_jwt>"
  }]
}

Response

{
  "id": <unique_request_id>,
  "result": "Ok"
}

Related Subscription Events

{
  "id": null,
  "result": {
    "type": "OrderCreated",
    "data": {
      "order": {
        "parameters": {
          // ...  
        },
        "signature": ""
      },
      "orderHash": <string>,
      "inputToken": <string>,
      "outputToken": <string>,
      "inputAmount": <integer>,
      "outputAmount": <integer>,
      "rate": <float>,
      "chainId": <integer>,
      "active": <boolean>,
      "createdAt": <integer>,
      "lastUpdatedAt": <integer>,
      "takenAt?": <integer>,
      "cancelledAt?": <integer>,
      "fulfilledAt?": <integer>,
      "isPublic": <boolean>
    }
  }
}

Notes:

  • The method checks if the provided chain ID is supported.
  • Once validated, the order is added to the database and broadcasted to orderbook subscribers.