Skip to content
Docs
Actions
Requesting for Quote

Requesting for Quote

aori_requestQuote

Supposing that a current swap pair or market doesn't have limit orders within it, a potential taker should not be forced to make a limit order as this requires complete price awareness from them to choose a price that won't be arbitraged against.

This method allows a potential taker to ping their intent to sell inputAmount of token inputToken for outputToken on chain with a chain id of chainId.

This will be visible to clients subscribed to the Subscriptions stream for which they can then start placing limit orders ready for the taker to take.

ParametersTypeRequiredDescription
inputTokenstringYesWallet address of the user to authenticate.
inputAmountstringYesStringified integer representing amount of input token.
outputTokenstringYesAddress of Output Token e.g 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 for Uniswap
chainIdnumberYesInteger representing chain id that input token exists on e.g 1 for Ethereum Mainnet
 {
   "id": <unique_request_id>,
   "jsonrpc": "2.0",
   "method": "aori_requestQuote",
   "params": [{
       "inputToken": <string>,
       "outputToken": <string>,
       "inputAmount": <number>,
       "chainId": <number>,
       "apiKey": "..."
     }
   }]
 }

Response

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

Related Subscription Events

{
  "id": null,
  "result": {
    "type": "QuoteRequested",
    "data": {
        "inputToken": <string>,
        "outputToken": <string>,
        "inputAmount": <number>,
        "chainId": <number>
    }
  }
}

aori_quote

Similar to aori_requestQuote, this method can be used to request a quote from solvers and market makers. This additionally will also fetch the top orders from the orderbook related to this request after some delay.

ParametersTypeRequiredDescription
inputTokenstringYesWallet address of the user to authenticate.
inputAmountstringYesA signature of the user's address by the user's address. A simple implementation of this using ethers-js can be found below.
outputTokenstringYesA signature of the user's address by the user's address. A simple implementation of this using ethers-js can be found below.
chainIdnumberYesA signature of the user's address by the user's address. A simple implementation of this using ethers-js can be found below.
delaynumberNoA delay in milliseconds to fetch the quote. Default is 3000 (milliseconds).
apiKeystringYesAPI key (see Authentication)
 {
   "id": <unique_request_id>,
   "jsonrpc": "2.0",
   "method": "aori_quote",
   "params": [{
       "inputToken": <string>,
       "outputToken": <string>,
       "inputAmount": <number>,
       "chainId": <number>,
       "apiKey": "..."
     }
   }]
 }

Response

{
  "id": <unique_request_id>,
  "result": {
    "orders": [
      {
        // Order details
      },
      // ... more orders
    ]
  }
}

Related Subscription Events

{
  "id": null,
  "result": {
    "type": "QuoteRequested",
    "data": {
        "inputToken": <string>,
        "outputToken": <string>,
        "inputAmount": <number>,
        "chainId": <number>
    }
  }
}