Prepare a limit order
curl --request POST \
--url https://relay-production-f175.up.railway.app/v1/limit-orders/prepare \
--header 'Content-Type: application/json' \
--data '
{
"chainId": 123,
"sellToken": {},
"buyToken": {},
"sellAmount": "<string>",
"limitAmount": "<string>",
"taker": {},
"recipient": {},
"expiresInSeconds": 123
}
'import requests
url = "https://relay-production-f175.up.railway.app/v1/limit-orders/prepare"
payload = {
"chainId": 123,
"sellToken": {},
"buyToken": {},
"sellAmount": "<string>",
"limitAmount": "<string>",
"taker": {},
"recipient": {},
"expiresInSeconds": 123
}
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({
chainId: 123,
sellToken: {},
buyToken: {},
sellAmount: '<string>',
limitAmount: '<string>',
taker: {},
recipient: {},
expiresInSeconds: 123
})
};
fetch('https://relay-production-f175.up.railway.app/v1/limit-orders/prepare', 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://relay-production-f175.up.railway.app/v1/limit-orders/prepare",
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([
'chainId' => 123,
'sellToken' => [
],
'buyToken' => [
],
'sellAmount' => '<string>',
'limitAmount' => '<string>',
'taker' => [
],
'recipient' => [
],
'expiresInSeconds' => 123
]),
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://relay-production-f175.up.railway.app/v1/limit-orders/prepare"
payload := strings.NewReader("{\n \"chainId\": 123,\n \"sellToken\": {},\n \"buyToken\": {},\n \"sellAmount\": \"<string>\",\n \"limitAmount\": \"<string>\",\n \"taker\": {},\n \"recipient\": {},\n \"expiresInSeconds\": 123\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://relay-production-f175.up.railway.app/v1/limit-orders/prepare")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": 123,\n \"sellToken\": {},\n \"buyToken\": {},\n \"sellAmount\": \"<string>\",\n \"limitAmount\": \"<string>\",\n \"taker\": {},\n \"recipient\": {},\n \"expiresInSeconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://relay-production-f175.up.railway.app/v1/limit-orders/prepare")
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 \"chainId\": 123,\n \"sellToken\": {},\n \"buyToken\": {},\n \"sellAmount\": \"<string>\",\n \"limitAmount\": \"<string>\",\n \"taker\": {},\n \"recipient\": {},\n \"expiresInSeconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"chainId": 123,
"executor": {},
"permit2": {},
"draft": {
"minOut": "<string>",
"gasFeeToken": {},
"maxGasFee": "<string>",
"permitAmount": "<string>",
"nonce": "<string>",
"deadline": "<string>"
},
"typedData": {},
"fee": {},
"gasFeeNow": "<string>",
"expiresAt": "<string>"
}Limit orders
Prepare a limit order
Work out every term of a limit order from its price, and get the typed data to sign. Stores nothing.
POST
/
v1
/
limit-orders
/
prepare
Prepare a limit order
curl --request POST \
--url https://relay-production-f175.up.railway.app/v1/limit-orders/prepare \
--header 'Content-Type: application/json' \
--data '
{
"chainId": 123,
"sellToken": {},
"buyToken": {},
"sellAmount": "<string>",
"limitAmount": "<string>",
"taker": {},
"recipient": {},
"expiresInSeconds": 123
}
'import requests
url = "https://relay-production-f175.up.railway.app/v1/limit-orders/prepare"
payload = {
"chainId": 123,
"sellToken": {},
"buyToken": {},
"sellAmount": "<string>",
"limitAmount": "<string>",
"taker": {},
"recipient": {},
"expiresInSeconds": 123
}
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({
chainId: 123,
sellToken: {},
buyToken: {},
sellAmount: '<string>',
limitAmount: '<string>',
taker: {},
recipient: {},
expiresInSeconds: 123
})
};
fetch('https://relay-production-f175.up.railway.app/v1/limit-orders/prepare', 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://relay-production-f175.up.railway.app/v1/limit-orders/prepare",
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([
'chainId' => 123,
'sellToken' => [
],
'buyToken' => [
],
'sellAmount' => '<string>',
'limitAmount' => '<string>',
'taker' => [
],
'recipient' => [
],
'expiresInSeconds' => 123
]),
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://relay-production-f175.up.railway.app/v1/limit-orders/prepare"
payload := strings.NewReader("{\n \"chainId\": 123,\n \"sellToken\": {},\n \"buyToken\": {},\n \"sellAmount\": \"<string>\",\n \"limitAmount\": \"<string>\",\n \"taker\": {},\n \"recipient\": {},\n \"expiresInSeconds\": 123\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://relay-production-f175.up.railway.app/v1/limit-orders/prepare")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": 123,\n \"sellToken\": {},\n \"buyToken\": {},\n \"sellAmount\": \"<string>\",\n \"limitAmount\": \"<string>\",\n \"taker\": {},\n \"recipient\": {},\n \"expiresInSeconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://relay-production-f175.up.railway.app/v1/limit-orders/prepare")
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 \"chainId\": 123,\n \"sellToken\": {},\n \"buyToken\": {},\n \"sellAmount\": \"<string>\",\n \"limitAmount\": \"<string>\",\n \"taker\": {},\n \"recipient\": {},\n \"expiresInSeconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"chainId": 123,
"executor": {},
"permit2": {},
"draft": {
"minOut": "<string>",
"gasFeeToken": {},
"maxGasFee": "<string>",
"permitAmount": "<string>",
"nonce": "<string>",
"deadline": "<string>"
},
"typedData": {},
"fee": {},
"gasFeeNow": "<string>",
"expiresAt": "<string>"
}number
Defaults to the primary EVM chain. Solana chains answer
limit_orders_unsupported.address
required
address
required
string
required
Base units.
string
required
The whole sell amount at the taker’s price, in buy-token base units, before fees.
address
required
address
Defaults to
taker.number
required
300 to 2,592,000 (5 minutes to 30 days).
number
address
address
object
object
Permit2
PermitWitnessTransferFrom with a LimitAuth witness, for eth_signTypedData_v4.object
{ token, bps, atLimit }: the protocol fee at the limit price. token is null when the corridor’s fee is 0.string
Today’s gas fee, from which the cap was derived.
string
400 below_minimum (with minimum), bad_expiry, limit_below_fees; 429 too_many_open;
404 limit_orders_disabled.
