Build a transaction that adds USDC to the protocol buffer
curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer \
--header 'Content-Type: application/json' \
--data '
{
"caller": "<string>",
"amountUsdc": "<string>"
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer"
payload = {
"caller": "<string>",
"amountUsdc": "<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({caller: '<string>', amountUsdc: '<string>'})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer', 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/misc/add-to-buffer",
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([
'caller' => '<string>',
'amountUsdc' => '<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://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer"
payload := strings.NewReader("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<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://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer")
.header("Content-Type", "application/json")
.body("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer")
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 \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"to": "0x0000000000000000000000000000000000000000",
"from": "0x0000000000000000000000000000000000000000",
"data": "<string>",
"value": "0x0",
"chainId": 123,
"description": "<string>",
"meta": {}
}
}{
"ok": false,
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"details": "<unknown>"
}
}Misc
Build a transaction that adds USDC to the protocol buffer
Permissionless donation of USDC into the VaultManager buffer (used to smooth trader PnL payouts). Requires USDC approval to the VaultManager. This is not an LP deposit — it earns nothing.
POST
/
v2
/
misc
/
add-to-buffer
Build a transaction that adds USDC to the protocol buffer
curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer \
--header 'Content-Type: application/json' \
--data '
{
"caller": "<string>",
"amountUsdc": "<string>"
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer"
payload = {
"caller": "<string>",
"amountUsdc": "<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({caller: '<string>', amountUsdc: '<string>'})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer', 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/misc/add-to-buffer",
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([
'caller' => '<string>',
'amountUsdc' => '<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://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer"
payload := strings.NewReader("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<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://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer")
.header("Content-Type", "application/json")
.body("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/misc/add-to-buffer")
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 \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"to": "0x0000000000000000000000000000000000000000",
"from": "0x0000000000000000000000000000000000000000",
"data": "<string>",
"value": "0x0",
"chainId": 123,
"description": "<string>",
"meta": {}
}
}{
"ok": false,
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"details": "<unknown>"
}
}Body
application/json
Response
Success envelope: ok is true and data carries the payload documented below.
⌘I