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.
Parameters | Type | Required | Description |
---|---|---|---|
inputToken | string | Yes | Address of Input Token e.g 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 for Uniswap |
outputToken | string | Yes | Address of Output Token e.g 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 for Uniswap |
inputAmount | string | Yes | Stringified integer representing amount of input token. |
chainId | number | Yes | Integer representing chain id that input token exists on e.g 1 for Ethereum Mainnet |
apiKey | string | Yes | API key (see Authentication) |
https://taker.aori.io
or https://dev.taker.aori.io
. See cURL
example below. {
"id": <request_id>,
"jsonrpc": "2.0",
"method": "aori_requestQuote",
"params": [{
"inputToken": <string>,
"outputToken": <string>,
"inputAmount": <number>,
"chainId": <number>,
"apiKey": "..."
}
}]
}
Response
{
"id": <request_id>,
"result": "Ok"
}
Related Streaming Events
{
"id": null,
"result": {
"type": "QuoteRequested",
"data": {
"inputToken": <string>,
"outputToken": <string>,
"inputAmount": <number>,
"chainId": <number>
}
}
}
aori_requestSwap
At times, market makers would like more confidence that the market taker has sufficient liquidity to execute a swap. 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, but under a different event SwapRequested
.
Parameters | Type | Required | Description |
---|---|---|---|
order | Limit Order | Yes | Limit order to make. See Limit Order format |
signature | string | Yes | A signature by the user of the limit order. |
apiKey | string | Yes | API key (see Authentication) |
https://taker.aori.io
or https://dev.taker.aori.io
. See cURL
example below. {
"id": <request_id>,
"jsonrpc": "2.0",
"method": "aori_requestSwap",
"params": [{
"order": <order>,
"signature": <signature>,
"apiKey": "..."
}]
}
Response
{
"id": <request_id>,
"result": "Ok"
}
Related Streaming Events
{
"id": null,
"result": {
"type": "SwapRequested",
"data": <order> // See Limit Order object
}
}