Quote a swap
curl --request POST \
--url https://api.launch.o1.exchange/v1/swaps/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"wallet": "<string>",
"token_address": "<string>",
"amount_in_raw": "<string>",
"slippage_bps": 2499,
"referrer": "<string>",
"comment": "<string>"
}
'import requests
url = "https://api.launch.o1.exchange/v1/swaps/quote"
payload = {
"wallet": "<string>",
"token_address": "<string>",
"amount_in_raw": "<string>",
"slippage_bps": 2499,
"referrer": "<string>",
"comment": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet: '<string>',
token_address: '<string>',
amount_in_raw: '<string>',
slippage_bps: 2499,
referrer: '<string>',
comment: '<string>'
})
};
fetch('https://api.launch.o1.exchange/v1/swaps/quote', 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.launch.o1.exchange/v1/swaps/quote",
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([
'wallet' => '<string>',
'token_address' => '<string>',
'amount_in_raw' => '<string>',
'slippage_bps' => 2499,
'referrer' => '<string>',
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.launch.o1.exchange/v1/swaps/quote"
payload := strings.NewReader("{\n \"wallet\": \"<string>\",\n \"token_address\": \"<string>\",\n \"amount_in_raw\": \"<string>\",\n \"slippage_bps\": 2499,\n \"referrer\": \"<string>\",\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.launch.o1.exchange/v1/swaps/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"wallet\": \"<string>\",\n \"token_address\": \"<string>\",\n \"amount_in_raw\": \"<string>\",\n \"slippage_bps\": 2499,\n \"referrer\": \"<string>\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launch.o1.exchange/v1/swaps/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet\": \"<string>\",\n \"token_address\": \"<string>\",\n \"amount_in_raw\": \"<string>\",\n \"slippage_bps\": 2499,\n \"referrer\": \"<string>\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"quote_id": "<string>",
"prepared_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"observed_block": "<string>",
"input_currency": "<string>",
"output_currency": "<string>",
"amount_in_raw": "<string>",
"expected_out_raw": "<string>",
"minimum_out_raw": "<string>",
"quote_gas": "<string>",
"review": {
"token_address": "<string>",
"input_currency": "<string>",
"output_currency": "<string>",
"amount_in_raw": "<string>",
"expected_out_raw": "<string>",
"minimum_out_raw": "<string>",
"slippage_bps": 2499,
"referrer": "<string>",
"comment": "<string>"
},
"issues": [
{
"code": "<string>",
"detail": "<string>",
"asset": "<string>",
"spender": "<string>",
"actual_raw": "<string>",
"required_raw": "<string>",
"remediation_step_id": "<string>"
}
],
"steps": [
{
"id": "<string>",
"kind": "<string>",
"label": "<string>",
"depends_on": [
"<string>"
],
"transaction": {
"from": "<string>",
"to": "<string>",
"data": "<string>",
"value": "<string>"
},
"simulation": {
"block_number": "<string>"
}
}
]
},
"meta": {
"request_id": "<string>",
"generated_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
]
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}Swaps
Quote a swap
Get a live exact-input launch-pool quote and any ERC-20 approval or Permit2 signature requirements.
POST
/
swaps
/
quote
Quote a swap
curl --request POST \
--url https://api.launch.o1.exchange/v1/swaps/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"wallet": "<string>",
"token_address": "<string>",
"amount_in_raw": "<string>",
"slippage_bps": 2499,
"referrer": "<string>",
"comment": "<string>"
}
'import requests
url = "https://api.launch.o1.exchange/v1/swaps/quote"
payload = {
"wallet": "<string>",
"token_address": "<string>",
"amount_in_raw": "<string>",
"slippage_bps": 2499,
"referrer": "<string>",
"comment": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet: '<string>',
token_address: '<string>',
amount_in_raw: '<string>',
slippage_bps: 2499,
referrer: '<string>',
comment: '<string>'
})
};
fetch('https://api.launch.o1.exchange/v1/swaps/quote', 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.launch.o1.exchange/v1/swaps/quote",
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([
'wallet' => '<string>',
'token_address' => '<string>',
'amount_in_raw' => '<string>',
'slippage_bps' => 2499,
'referrer' => '<string>',
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.launch.o1.exchange/v1/swaps/quote"
payload := strings.NewReader("{\n \"wallet\": \"<string>\",\n \"token_address\": \"<string>\",\n \"amount_in_raw\": \"<string>\",\n \"slippage_bps\": 2499,\n \"referrer\": \"<string>\",\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.launch.o1.exchange/v1/swaps/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"wallet\": \"<string>\",\n \"token_address\": \"<string>\",\n \"amount_in_raw\": \"<string>\",\n \"slippage_bps\": 2499,\n \"referrer\": \"<string>\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launch.o1.exchange/v1/swaps/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet\": \"<string>\",\n \"token_address\": \"<string>\",\n \"amount_in_raw\": \"<string>\",\n \"slippage_bps\": 2499,\n \"referrer\": \"<string>\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"quote_id": "<string>",
"prepared_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"observed_block": "<string>",
"input_currency": "<string>",
"output_currency": "<string>",
"amount_in_raw": "<string>",
"expected_out_raw": "<string>",
"minimum_out_raw": "<string>",
"quote_gas": "<string>",
"review": {
"token_address": "<string>",
"input_currency": "<string>",
"output_currency": "<string>",
"amount_in_raw": "<string>",
"expected_out_raw": "<string>",
"minimum_out_raw": "<string>",
"slippage_bps": 2499,
"referrer": "<string>",
"comment": "<string>"
},
"issues": [
{
"code": "<string>",
"detail": "<string>",
"asset": "<string>",
"spender": "<string>",
"actual_raw": "<string>",
"required_raw": "<string>",
"remediation_step_id": "<string>"
}
],
"steps": [
{
"id": "<string>",
"kind": "<string>",
"label": "<string>",
"depends_on": [
"<string>"
],
"transaction": {
"from": "<string>",
"to": "<string>",
"data": "<string>",
"value": "<string>"
},
"simulation": {
"block_number": "<string>"
}
}
]
},
"meta": {
"request_id": "<string>",
"generated_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
]
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"instance": "<string>"
}Authorizations
Production API key beginning with o1_launch_.
Body
application/json
Available options:
8453, 4663 Example:
8453
Pattern:
^0x[0-9a-fA-F]{40}$Example:
"0x1111111111111111111111111111111111111111"
Pattern:
^0x[0-9a-fA-F]{40}$Example:
"0x1111111111111111111111111111111111111111"
Available options:
buy, sell Exact input amount in base units, from 1 through uint128 max.
Pattern:
^(0|[1-9][0-9]*)$Example:
"1000000000000000000"
Required range:
0 <= x <= 4999Pattern:
^0x[0-9a-fA-F]{40}$Example:
"0x1111111111111111111111111111111111111111"
Optional hook comment limited to 32 UTF-8 bytes.
Maximum string length:
32⌘I
