AI & agents

create_swap for an agent with its own wallet: the payment instruction, field by field

Contents
  1. Who this is for
  2. The inputs
  3. What comes back
  4. The payment instruction, field by field
  5. Three worked instructions
  6. Before sending: what the agent checks
  7. Following the swap
  8. When a swap cannot be completed
  9. FAQ

Most swaps on sablebolt.io are made by a person: the form, two addresses, a deposit from the person's own wallet. This post is about the other case, a program that holds the keys of the wallet the deposit comes from and needs the facts a wallet needs, in the units a wallet uses. For it there is one tool, create_swap on the MCP endpoint (POST /v1/swaps in the REST API), and it answers with a payment instruction. Here it is field by field, with three worked examples, the checks before broadcasting and how to follow the swap. The overview is how Sablebolt talks to machines; connecting a client is the connection guide; the reference page is /developers.

Who this is for

An agent with its own wallet: software that controls a private key and will pay the deposit itself. One example is an agent paying a payment link from a treasury wallet it holds.

Everyone else uses the page: an assistant prepares the route, the amount and the address checks, then hands over with get_swap_page_link, and the person creates the swap in the form and sends from their own wallet. The tool's description says it: "Use it only when you control the wallet at fromAddress and will send the deposit yourself; for a person use get_swap_page_link." The tool is marked not read-only and not idempotent; calling it twice creates two swaps.

The inputs

FieldRequiredWhat it is
fromyesthe slug of the asset you send, e.g. usdt-trc20; the slug names the network
toyesthe slug of the asset to receive, e.g. btc
amountyesthe amount of from you will send, a decimal string within get_limits
fromAddressyesthe address the deposit will come from, on the from network: a wallet you control
toAddressyesthe receiving address on the to network
extraIdonly where to has onethe receiving side's memo or tag: XRP uses a Destination Tag, USDT on TON a Payment ID
fromExtraIdonly where from has onethe sending side's extra id, if your wallet attaches one

Why the sender address is required: it is the one address the service knows on the sending side. A fixed-rate swap also takes refundAddress. Missing or wrong for the asset, the answer is a tool error with the code invalid_sender_address (a 400 over REST).

What comes back

The swap: id, depositAddress, depositExtraId, payoutAddress, amountFrom, expectedTo (the estimate before the payout network fee), networkFee, receiveAmount (expectedTo − networkFee), createdAt, statusUrl and payment; REST answers 201 with the same object under data. The rate floats: the final amount is set when the deposit confirms. payment exists while the swap waits for its deposit (stage 1) and is null afterwards.

The payment instruction, field by field

FieldTypeWhat it holds
asset, ticker, namestringthe asset to send: usdt-trc20, USDT, Tether
networkstring or nullthe token's network label, e.g. "TRON (TRC-20)"; null for a chain's own coin
chainstringthe chain code: bitcoin, tron, ethereum, binance_smart_chain, solana, ton, monero
chainIdinteger or nullthe EVM chain id; null off the EVM chains
tokenContractstring or nullthe token contract or mint as listed by the liquidity provider; null for a chain's own coin or when not listed
decimalsinteger or nullthe decimals as listed; null when not listed (a chain's own EVM coin falls back to 18), or when the listing disagrees with the protocol constant
addressstringthe one-time deposit address
extraId, extraIdNamestring or nullthe memo the deposit must carry, and its name on that chain
amountdecimal stringthe exact amount to send
amountBaseUnitsstring or nullthe same amount in base units (satoshi, wei, sun), rounded up at the last unit; null when the decimals are unknown
uri, uriStandardstring or nulla wallet URI where a public standard exists, and the standard's name
notestringthe one rule, in words

Base units and the round-up rule. amountBaseUnits is amount shifted by decimals: 0.0125 BTC with 8 decimals is 1250000 satoshi. When amount has more decimal places than the asset, the integer is rounded up at the last unit, never down: 12.3456789 USDT with 6 decimals becomes 12345679, not 12345678, so the deposit is never short.

chainId. The EVM chains are told apart by their chain id.

chainIdChain
1Ethereum
56BNB Smart Chain
137Polygon
8453Base
42161Arbitrum
10Optimism
43114Avalanche C-Chain
999HyperEVM

The wallet URI. Where a public standard exists the instruction carries a link; where none exists, uri is null and the agent builds the transaction from the fields.

StandardApplies toShape
BIP-21BTC, LTC, DOGEbitcoin:<address>?amount=<decimal> (litecoin:, dogecoin:)
Monero URIXMRmonero:<address>?tx_amount=<decimal>
ERC-681, native valueETH, BNB, POL and the other EVM coinsethereum:<address>@<chainId>?value=<base units>
ERC-681, token transferERC-20, BEP-20 and other EVM tokensethereum:<contract>@<chainId>/transfer?address=<deposit address>&uint256=<base units>
Solana PaySOL and SPL tokenssolana:<address>?amount=<decimal>, plus &spl-token=<mint> for a token
TON transferGRAMton://transfer/<address>?amount=<base units>&text=<memo>
noneTRON, XRP, Zcash and othersbuild from address, extraId and amount

Three worked instructions

The deposit addresses are shortened, since each is generated for one swap; the two contracts are Tether's, checked against Tether's list of supported protocols on 5 October 2026 (USDT page). Minimums were read with get_limits on 3 November 2026 at 13:29 UTC.

A Bitcoin deposit: 0.0125 BTC for BTC → USDT TRC-20

The route is BTC → USDT TRC-20; its minimum was 0.00038784 BTC.

FieldValue
asset, ticker, namebtc, BTC, Bitcoin
network, chain, chainIdnull, bitcoin, null
tokenContract, decimalsnull, 8
addressbc1q… (one-time, shortened here)
extraId, extraIdNamenull, null
amount0.0125
amountBaseUnits1250000
uri, uriStandardbitcoin:bc1q…?amount=0.0125, BIP-21
noteSend exactly 0.0125 BTC on Bitcoin in one transaction from the sending address you gave. The swap starts after 2 confirmations. Anything else sent to this address is not credited automatically.

A USDT deposit on TRON: 250 USDT for USDT TRC-20 → BTC

The route is USDT TRC-20 → BTC; its minimum was 30.04259 USDT. TRON has no URI standard, so the agent builds the TRC-20 transfer itself.

FieldValue
asset, ticker, nameusdt-trc20, USDT, Tether
network, chain, chainIdTRON (TRC-20), tron, null
tokenContractTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t, as listed
decimals6
addressT… (34 characters, one-time)
extraId, extraIdNamenull, null
amount250
amountBaseUnits250000000
uri, uriStandardnull, null
noteSend exactly 250 USDT on TRON in one transaction from the sending address you gave. The swap starts after 1 confirmation. Anything else sent to this address is not credited automatically.

The TRC-20 transfer costs energy or TRX from the sending wallet (TRON energy and bandwidth).

An ERC-20 deposit: 250 USDT on Ethereum for USDT ERC-20 → BTC

The route is USDT ERC-20 → BTC; its minimum was 30.042667 USDT.

FieldValue
asset, ticker, nameusdt-erc20, USDT, Tether
network, chain, chainIdEthereum (ERC-20), ethereum, 1
tokenContract0xdAC17F958D2ee523a2206206994597C13D831ec7, as listed
decimals6
address0x… (42 characters, one-time)
extraId, extraIdNamenull, null
amount250
amountBaseUnits250000000
uri, uriStandardethereum:0xdAC17F958D2ee523a2206206994597C13D831ec7@1/transfer?address=0x…&uint256=250000000, ERC-681
noteSend exactly 250 USDT on Ethereum in one transaction from the sending address you gave. The swap starts after 15 confirmations. Anything else sent to this address is not credited automatically.

The URI's target is the contract, not the deposit address: call transfer on this contract, on chain 1, with this recipient and this integer. The same deposit on BNB Smart Chain would carry chainId 56 and the Binance-Peg contract, which has 18 decimals rather than 6.

Before sending: what the agent checks

  1. The chain. chain and chainId equal the network your wallet will broadcast on. A 0x deposit address with chainId 56 is paid on BNB Smart Chain; paying it on Ethereum is the mistake Sent USDT to the wrong network is about.
  2. The contract. tokenContract equals the issuer's published contract: Tether's list for USDT on TRON, Ethereum and TON, BscScan for the Binance-Peg token on BNB Smart Chain, Circle's list for USDC. If it differs, do not send.
  3. The decimals, cross-checked. Compute the base units yourself from amount and the issuer's decimals and compare with amountBaseUnits. If decimals is null, so are amountBaseUnits and uri: the listing stated no precision, or one that disagrees with the protocol constant, and the instruction carries nothing rather than a wrong number; use the issuer's figure.
  4. The memo. If extraId is not null, the transaction carries it; on TON the URI puts it in text=.
  5. The amount, once. Exactly amount, in one transaction, with the network fee paid on top from the fee coin (TRX or energy, ETH, BNB, GRAM), never out of the amount. Two half payments are "anything else" in the note's words.
  6. The sender. Broadcast from fromAddress, and keep id and statusUrl: they are the only handle on the swap.

Following the swap

get_swap_status (or GET /v1/swaps/{id}) answers with status and stage:

StageStatusWhat has happened
1waitingnothing seen yet; payment is still present
2confirmingtxIn is set; the network's confirmations are being counted
3exchangingthe deposit is confirmed; the rate is set
4sendingtxOut is set
5finishedamountTo is the actual payout
last reachedfailed, refunded, expired, hold, unknownnot progress; the stage stays where it was

Polling is one way; the other is a signed notification, REST only, since the MCP server has no tool for it. POST /v1/swaps/{id}/notify with { "url": "https://agent.example.com/hooks/sablebolt", "secret": "<16 to 128 printable characters>" } answers 202 with a one-time token; from then on every change of status or stage is a POST to that URL:

PartValue
Header X-Sablebolt-Eventswap.status
Header X-Sablebolt-TimestampUnix seconds of this attempt
Header X-Sablebolt-Signaturesha256= and the hex HMAC-SHA256, keyed with your secret, of the timestamp, a dot and the exact body bytes
Bodyid, status, stage, amountTo, txIn, txOut, updatedAt
Example body, from openapi.json{"id":"a1b2c3d4e5f60718","status":"sending","stage":4,"amountTo":"0.00891","txIn":"7c1e…","txOut":"0x3f…","updatedAt":"2026-11-01T12:34:56.000Z"}
Verifyingrecompute over the raw bytes before parsing, compare in constant time, reject a timestamp more than 300 seconds off
Answeringany 2xx within 5 seconds; a 5xx, 429 or 408, a timeout or a connection error is retried after 1, 2 and 4 seconds; any other answer counts as one failed attempt without a retry
Endingthe final status (its event is still sent), 48 hours, 10 failed attempts in a row, a DELETE with Authorization: Bearer <token>, or a restart

The service polls each subscribed swap once a minute, so two changes within one minute arrive as one event; deduplicate on status and stage. Subscriptions live in memory only.

When a swap cannot be completed

The FAQ answer on every pair page applies to a swap created by an agent as well:

What if the swap cannot be completed? Write to support with the swap ID from the status page. The deposit is returned to the address you sent from, less the network fee, after support confirms the address. With Fixed rate on, the form shows a refund address, prefilled with the address you send from, and the deposit returns there.

The support page is /support.

FAQ

Can a person use create_swap through an assistant?

The tool is for the wallet that pays. A person's swap is created on the page from get_swap_page_link, with both addresses on screen, and the deposit goes from the person's own wallet; an assistant calling create_swap for a person would have to hold that person's keys.

Is the rate locked when create_swap answers?

No: the rate is set when the deposit confirms; Floating rate shows what can move in between.

What if decimals and amountBaseUnits are null?

Compute the integer from amount and the issuer's documented decimals, check it twice, and send exactly amount.

How many swaps can an agent create?

10 per minute per IP address, counted across create_swap and POST /v1/swaps together; the budget is deliberately small.

Is there a test mode?

GET /v1/health reports mode, "mock" or "live"; on 3 November 2026 it reported live. There is no separate sandbox; start with a small amount above the minimum.

Sources

  1. BIP 21: Bitcoin URI Scheme · read 2026-11-09
  2. ERC-681: URL Format for Transaction Requests · read 2026-11-09
  3. Monero: URI scheme (docs/URI_SCHEME.md) · read 2026-11-09
  4. TON documentation: Deep links (ton://transfer) · read 2026-11-09
  5. Tether: Supported Protocols and Integration Guidelines · read 2026-10-05
  6. Circle: USDC contract addresses · read 2026-11-09