Create Sweep Trade
curl --request POST \
--url https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"to_currency": "USDC",
"account_id": 42,
"account_reference": "<string>",
"dry_run": false,
"keep_amount_usd": 0,
"max_amount_usd": 10000,
"min_amount_usd": 1,
"reference": "<string>",
"settlement_account_id": 42,
"settlement_address": "<string>",
"to_chain_id": 8453
}
'import requests
url = "https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade"
payload = {
"to_currency": "USDC",
"account_id": 42,
"account_reference": "<string>",
"dry_run": False,
"keep_amount_usd": 0,
"max_amount_usd": 10000,
"min_amount_usd": 1,
"reference": "<string>",
"settlement_account_id": 42,
"settlement_address": "<string>",
"to_chain_id": 8453
}
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({
to_currency: 'USDC',
account_id: 42,
account_reference: '<string>',
dry_run: false,
keep_amount_usd: 0,
max_amount_usd: 10000,
min_amount_usd: 1,
reference: '<string>',
settlement_account_id: 42,
settlement_address: '<string>',
to_chain_id: 8453
})
};
fetch('https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade', 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://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade",
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([
'to_currency' => 'USDC',
'account_id' => 42,
'account_reference' => '<string>',
'dry_run' => false,
'keep_amount_usd' => 0,
'max_amount_usd' => 10000,
'min_amount_usd' => 1,
'reference' => '<string>',
'settlement_account_id' => 42,
'settlement_address' => '<string>',
'to_chain_id' => 8453
]),
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://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade"
payload := strings.NewReader("{\n \"to_currency\": \"USDC\",\n \"account_id\": 42,\n \"account_reference\": \"<string>\",\n \"dry_run\": false,\n \"keep_amount_usd\": 0,\n \"max_amount_usd\": 10000,\n \"min_amount_usd\": 1,\n \"reference\": \"<string>\",\n \"settlement_account_id\": 42,\n \"settlement_address\": \"<string>\",\n \"to_chain_id\": 8453\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://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"to_currency\": \"USDC\",\n \"account_id\": 42,\n \"account_reference\": \"<string>\",\n \"dry_run\": false,\n \"keep_amount_usd\": 0,\n \"max_amount_usd\": 10000,\n \"min_amount_usd\": 1,\n \"reference\": \"<string>\",\n \"settlement_account_id\": 42,\n \"settlement_address\": \"<string>\",\n \"to_chain_id\": 8453\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade")
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 \"to_currency\": \"USDC\",\n \"account_id\": 42,\n \"account_reference\": \"<string>\",\n \"dry_run\": false,\n \"keep_amount_usd\": 0,\n \"max_amount_usd\": 10000,\n \"min_amount_usd\": 1,\n \"reference\": \"<string>\",\n \"settlement_account_id\": 42,\n \"settlement_address\": \"<string>\",\n \"to_chain_id\": 8453\n}"
response = http.request(request)
puts response.read_body{
"data": {
"account_id": 123,
"created_at": "<string>",
"deposit_instruction": {},
"effective_rate": "<string>",
"fees": {},
"from_amount": "<string>",
"from_chain_id": 123,
"from_currency": "<string>",
"order_id": "<string>",
"quote_id": "<string>",
"reference": "<string>",
"settlement_instruction": {},
"to_amount": "<string>",
"to_chain_id": 123,
"to_currency": "<string>"
},
"error": true,
"message": "<string>"
}{
"error": {
"code": 400,
"errors": [
{
"domain": "orders",
"reason": "InsufficientQuantity"
}
],
"message": "Insufficient quantity"
}
}{
"error": {
"code": 400,
"errors": [
{
"domain": "orders",
"reason": "InsufficientQuantity"
}
],
"message": "Insufficient quantity"
}
}{
"error": {
"code": 400,
"errors": [
{
"domain": "orders",
"reason": "InsufficientQuantity"
}
],
"message": "Insufficient quantity"
}
}Orders
Create Sweep Trade
Consolidate eligible balances into a target currency via quote+accept (or dry-run)
POST
/
trade
/
sweeptrade
Create Sweep Trade
curl --request POST \
--url https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"to_currency": "USDC",
"account_id": 42,
"account_reference": "<string>",
"dry_run": false,
"keep_amount_usd": 0,
"max_amount_usd": 10000,
"min_amount_usd": 1,
"reference": "<string>",
"settlement_account_id": 42,
"settlement_address": "<string>",
"to_chain_id": 8453
}
'import requests
url = "https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade"
payload = {
"to_currency": "USDC",
"account_id": 42,
"account_reference": "<string>",
"dry_run": False,
"keep_amount_usd": 0,
"max_amount_usd": 10000,
"min_amount_usd": 1,
"reference": "<string>",
"settlement_account_id": 42,
"settlement_address": "<string>",
"to_chain_id": 8453
}
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({
to_currency: 'USDC',
account_id: 42,
account_reference: '<string>',
dry_run: false,
keep_amount_usd: 0,
max_amount_usd: 10000,
min_amount_usd: 1,
reference: '<string>',
settlement_account_id: 42,
settlement_address: '<string>',
to_chain_id: 8453
})
};
fetch('https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade', 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://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade",
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([
'to_currency' => 'USDC',
'account_id' => 42,
'account_reference' => '<string>',
'dry_run' => false,
'keep_amount_usd' => 0,
'max_amount_usd' => 10000,
'min_amount_usd' => 1,
'reference' => '<string>',
'settlement_account_id' => 42,
'settlement_address' => '<string>',
'to_chain_id' => 8453
]),
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://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade"
payload := strings.NewReader("{\n \"to_currency\": \"USDC\",\n \"account_id\": 42,\n \"account_reference\": \"<string>\",\n \"dry_run\": false,\n \"keep_amount_usd\": 0,\n \"max_amount_usd\": 10000,\n \"min_amount_usd\": 1,\n \"reference\": \"<string>\",\n \"settlement_account_id\": 42,\n \"settlement_address\": \"<string>\",\n \"to_chain_id\": 8453\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://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"to_currency\": \"USDC\",\n \"account_id\": 42,\n \"account_reference\": \"<string>\",\n \"dry_run\": false,\n \"keep_amount_usd\": 0,\n \"max_amount_usd\": 10000,\n \"min_amount_usd\": 1,\n \"reference\": \"<string>\",\n \"settlement_account_id\": 42,\n \"settlement_address\": \"<string>\",\n \"to_chain_id\": 8453\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mapi.zbx.boomfi.xyz/v1/trade/sweeptrade")
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 \"to_currency\": \"USDC\",\n \"account_id\": 42,\n \"account_reference\": \"<string>\",\n \"dry_run\": false,\n \"keep_amount_usd\": 0,\n \"max_amount_usd\": 10000,\n \"min_amount_usd\": 1,\n \"reference\": \"<string>\",\n \"settlement_account_id\": 42,\n \"settlement_address\": \"<string>\",\n \"to_chain_id\": 8453\n}"
response = http.request(request)
puts response.read_body{
"data": {
"account_id": 123,
"created_at": "<string>",
"deposit_instruction": {},
"effective_rate": "<string>",
"fees": {},
"from_amount": "<string>",
"from_chain_id": 123,
"from_currency": "<string>",
"order_id": "<string>",
"quote_id": "<string>",
"reference": "<string>",
"settlement_instruction": {},
"to_amount": "<string>",
"to_chain_id": 123,
"to_currency": "<string>"
},
"error": true,
"message": "<string>"
}{
"error": {
"code": 400,
"errors": [
{
"domain": "orders",
"reason": "InsufficientQuantity"
}
],
"message": "Insufficient quantity"
}
}{
"error": {
"code": 400,
"errors": [
{
"domain": "orders",
"reason": "InsufficientQuantity"
}
],
"message": "Insufficient quantity"
}
}{
"error": {
"code": 400,
"errors": [
{
"domain": "orders",
"reason": "InsufficientQuantity"
}
],
"message": "Insufficient quantity"
}
}Authorizations
Body
application/json
Sweep trade request
Destination currency symbol to consolidate into.
Example:
"USDC"
Settlement account ID override for balances to sweep.
Example:
42
Virtual account reference override (defaults to the org primary VA).
When true, return a quote estimate only and do not accept/execute.
Example:
false
Leave at least this USD notional unswept on source balances.
Example:
0
Cap total sweep size at this USD notional.
Example:
10000
Skip balances below this USD notionals.
Example:
1
Optional client reference stored on the order.
Settlement account ID. Mutually exclusive with settlement_address.
Example:
42
External settlement wallet address. Mutually exclusive with settlement_account_id.
Destination chain ID for the consolidated asset.
Example:
8453
⌘I