curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/relay \
--header 'Content-Type: application/json' \
--data '
{
"rawTransaction": "<string>",
"skipSimulation": false
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/relay"
payload = {
"rawTransaction": "<string>",
"skipSimulation": False
}
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({rawTransaction: '<string>', skipSimulation: false})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/relay', 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://tx-builder-testnet.avantisfi.com/v2/relay",
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([
'rawTransaction' => '<string>',
'skipSimulation' => false
]),
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://tx-builder-testnet.avantisfi.com/v2/relay"
payload := strings.NewReader("{\n \"rawTransaction\": \"<string>\",\n \"skipSimulation\": false\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://tx-builder-testnet.avantisfi.com/v2/relay")
.header("Content-Type", "application/json")
.body("{\n \"rawTransaction\": \"<string>\",\n \"skipSimulation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/relay")
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 \"rawTransaction\": \"<string>\",\n \"skipSimulation\": false\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"hash": "<string>",
"to": "0x0000000000000000000000000000000000000000",
"chainId": 123,
"simulated": true,
"status": "submitted",
"from": "0x0000000000000000000000000000000000000000",
"target": "<string>"
}
}{
"ok": false,
"error": {
"message": "<string>",
"details": "<unknown>"
}
}Broadcast a signed transaction through Avantis-operated RPCs
Submits an already-signed transaction without the caller needing their own RPC endpoint. Pipeline: parse → chainId check → contract whitelist (USDC is restricted to approve() of protocol spenders) → eth_call simulation with revert reasons decoded against the protocol error catalog → broadcast with RPC failover. Poll GET /v2/relay/ for confirmation. Note: a confirmed transaction is not yet a filled trade — market orders are fulfilled by the Avantis operator in a follow-up transaction.
curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/relay \
--header 'Content-Type: application/json' \
--data '
{
"rawTransaction": "<string>",
"skipSimulation": false
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/relay"
payload = {
"rawTransaction": "<string>",
"skipSimulation": False
}
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({rawTransaction: '<string>', skipSimulation: false})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/relay', 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://tx-builder-testnet.avantisfi.com/v2/relay",
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([
'rawTransaction' => '<string>',
'skipSimulation' => false
]),
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://tx-builder-testnet.avantisfi.com/v2/relay"
payload := strings.NewReader("{\n \"rawTransaction\": \"<string>\",\n \"skipSimulation\": false\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://tx-builder-testnet.avantisfi.com/v2/relay")
.header("Content-Type", "application/json")
.body("{\n \"rawTransaction\": \"<string>\",\n \"skipSimulation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/relay")
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 \"rawTransaction\": \"<string>\",\n \"skipSimulation\": false\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"hash": "<string>",
"to": "0x0000000000000000000000000000000000000000",
"chainId": 123,
"simulated": true,
"status": "submitted",
"from": "0x0000000000000000000000000000000000000000",
"target": "<string>"
}
}{
"ok": false,
"error": {
"message": "<string>",
"details": "<unknown>"
}
}Body
The signed, serialized transaction (0x hex) to broadcast. Must target a whitelisted Avantis contract on this chain.
^0x[0-9a-fA-F]+$Skip the eth_call preflight simulation (e.g. for time-sensitive submissions). Reverting transactions will then fail on-chain instead of being rejected here.
Response
Success envelope: ok is true and data carries the payload documented below.