Create a Swap Quote
curl --request POST \
--url https://api.uatu.dev/quotes \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"chain": "<string>",
"chainId": 123,
"recipientAddress": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>"
}
'import requests
url = "https://api.uatu.dev/quotes"
payload = {
"amount": "<string>",
"chain": "<string>",
"chainId": 123,
"recipientAddress": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
chain: '<string>',
chainId: 123,
recipientAddress: '<string>',
tokenIn: '<string>',
tokenOut: '<string>'
})
};
fetch('https://api.uatu.dev/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uatu.dev/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '<string>',
'chain' => '<string>',
'chainId' => 123,
'recipientAddress' => '<string>',
'tokenIn' => '<string>',
'tokenOut' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uatu.dev/quotes"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"chain\": \"<string>\",\n \"chainId\": 123,\n \"recipientAddress\": \"<string>\",\n \"tokenIn\": \"<string>\",\n \"tokenOut\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uatu.dev/quotes")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"chain\": \"<string>\",\n \"chainId\": 123,\n \"recipientAddress\": \"<string>\",\n \"tokenIn\": \"<string>\",\n \"tokenOut\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uatu.dev/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"chain\": \"<string>\",\n \"chainId\": 123,\n \"recipientAddress\": \"<string>\",\n \"tokenIn\": \"<string>\",\n \"tokenOut\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"code": 123,
"data": {
"amountIn": "<string>",
"amountInFloat": "<string>",
"amountOut": "<string>",
"amountOutFloat": "<string>",
"createdAt": "<string>",
"deadline": 123,
"destinationChain": "<string>",
"destinationChainId": 123,
"explorerUrl": "<string>",
"hash": "<string>",
"originChain": "<string>",
"originChainId": 123,
"pairAddress": "<string>",
"quoteId": "<string>",
"recipientAddress": "<string>",
"route": {
"dex": "<string>",
"fees": "<string>",
"logo": "<string>",
"name": "<string>"
},
"steps": [
{
"amount": "<string>",
"chainId": 123,
"data": "<string>",
"from": "<string>",
"message": "<string>",
"spender": "<string>",
"to": "<string>",
"value": "<string>"
}
],
"tokenIn": {
"address": "<string>",
"blockchainId": 123,
"decimals": 123,
"logo": "<string>",
"name": "<string>",
"slug": "<string>",
"symbol": "<string>"
},
"tokenOut": {
"address": "<string>",
"blockchainId": 123,
"decimals": 123,
"logo": "<string>",
"name": "<string>",
"slug": "<string>",
"symbol": "<string>"
},
"updatedAt": "<string>",
"walletAddress": "<string>"
}
}{
"message": "<string>",
"code": 123,
"data": "<unknown>"
}{
"message": "<string>",
"code": 123,
"data": "<unknown>"
}quotes
Create a Swap Quote
Resolves the pools for a token pair on the given chain, prices the swap against each DEX’s on-chain contracts concurrently, and returns the best output together with the encoded Permit2 approval and swap calldata needed to execute it. Quotes carry a 1-minute deadline and are persisted with a pending status.
POST
/
quotes
Create a Swap Quote
curl --request POST \
--url https://api.uatu.dev/quotes \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"chain": "<string>",
"chainId": 123,
"recipientAddress": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>"
}
'import requests
url = "https://api.uatu.dev/quotes"
payload = {
"amount": "<string>",
"chain": "<string>",
"chainId": 123,
"recipientAddress": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
chain: '<string>',
chainId: 123,
recipientAddress: '<string>',
tokenIn: '<string>',
tokenOut: '<string>'
})
};
fetch('https://api.uatu.dev/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uatu.dev/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '<string>',
'chain' => '<string>',
'chainId' => 123,
'recipientAddress' => '<string>',
'tokenIn' => '<string>',
'tokenOut' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uatu.dev/quotes"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"chain\": \"<string>\",\n \"chainId\": 123,\n \"recipientAddress\": \"<string>\",\n \"tokenIn\": \"<string>\",\n \"tokenOut\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uatu.dev/quotes")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"chain\": \"<string>\",\n \"chainId\": 123,\n \"recipientAddress\": \"<string>\",\n \"tokenIn\": \"<string>\",\n \"tokenOut\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uatu.dev/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"chain\": \"<string>\",\n \"chainId\": 123,\n \"recipientAddress\": \"<string>\",\n \"tokenIn\": \"<string>\",\n \"tokenOut\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"code": 123,
"data": {
"amountIn": "<string>",
"amountInFloat": "<string>",
"amountOut": "<string>",
"amountOutFloat": "<string>",
"createdAt": "<string>",
"deadline": 123,
"destinationChain": "<string>",
"destinationChainId": 123,
"explorerUrl": "<string>",
"hash": "<string>",
"originChain": "<string>",
"originChainId": 123,
"pairAddress": "<string>",
"quoteId": "<string>",
"recipientAddress": "<string>",
"route": {
"dex": "<string>",
"fees": "<string>",
"logo": "<string>",
"name": "<string>"
},
"steps": [
{
"amount": "<string>",
"chainId": 123,
"data": "<string>",
"from": "<string>",
"message": "<string>",
"spender": "<string>",
"to": "<string>",
"value": "<string>"
}
],
"tokenIn": {
"address": "<string>",
"blockchainId": 123,
"decimals": 123,
"logo": "<string>",
"name": "<string>",
"slug": "<string>",
"symbol": "<string>"
},
"tokenOut": {
"address": "<string>",
"blockchainId": 123,
"decimals": 123,
"logo": "<string>",
"name": "<string>",
"slug": "<string>",
"symbol": "<string>"
},
"updatedAt": "<string>",
"walletAddress": "<string>"
}
}{
"message": "<string>",
"code": 123,
"data": "<unknown>"
}{
"message": "<string>",
"code": 123,
"data": "<unknown>"
}⌘I