Build a vault withdrawal transaction (exact USDC out)
curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw \
--header 'Content-Type: application/json' \
--data '
{
"caller": "<string>",
"amountUsdc": "<string>",
"receiver": "<string>",
"owner": "<string>"
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw"
payload = {
"caller": "<string>",
"amountUsdc": "<string>",
"receiver": "<string>",
"owner": "<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>',
receiver: '<string>',
owner: '<string>'
})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw', 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/lp/withdraw",
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>',
'receiver' => '<string>',
'owner' => '<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/lp/withdraw"
payload := strings.NewReader("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\",\n \"receiver\": \"<string>\",\n \"owner\": \"<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/lp/withdraw")
.header("Content-Type", "application/json")
.body("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\",\n \"receiver\": \"<string>\",\n \"owner\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw")
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 \"receiver\": \"<string>\",\n \"owner\": \"<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": {
"amountUsdc": "<string>",
"receiver": "0x0000000000000000000000000000000000000000",
"owner": "0x0000000000000000000000000000000000000000"
}
}
}{
"ok": false,
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"details": "<unknown>"
}
}LP
Build a vault withdrawal transaction (exact USDC out)
Returns an unsigned transaction that withdraws an exact USDC amount from the vault by burning the corresponding avUSDC shares. Withdrawals are immediate but revert if they would push vault utilization above the protocol threshold — check limits via GET /v2/lp/state.
POST
/
v2
/
lp
/
withdraw
Build a vault withdrawal transaction (exact USDC out)
curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw \
--header 'Content-Type: application/json' \
--data '
{
"caller": "<string>",
"amountUsdc": "<string>",
"receiver": "<string>",
"owner": "<string>"
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw"
payload = {
"caller": "<string>",
"amountUsdc": "<string>",
"receiver": "<string>",
"owner": "<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>',
receiver: '<string>',
owner: '<string>'
})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw', 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/lp/withdraw",
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>',
'receiver' => '<string>',
'owner' => '<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/lp/withdraw"
payload := strings.NewReader("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\",\n \"receiver\": \"<string>\",\n \"owner\": \"<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/lp/withdraw")
.header("Content-Type", "application/json")
.body("{\n \"caller\": \"<string>\",\n \"amountUsdc\": \"<string>\",\n \"receiver\": \"<string>\",\n \"owner\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/lp/withdraw")
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 \"receiver\": \"<string>\",\n \"owner\": \"<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": {
"amountUsdc": "<string>",
"receiver": "0x0000000000000000000000000000000000000000",
"owner": "0x0000000000000000000000000000000000000000"
}
}
}{
"ok": false,
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"details": "<unknown>"
}
}Body
application/json
The account sending this transaction (must sign it).
Exact USDC to withdraw.
Recipient of the resulting shares/assets; defaults to the caller.
Owner of the shares being spent; defaults to the caller (requires share approval if different).
Response
Success envelope: ok is true and data carries the payload documented below.
⌘I