How a swap works
USDT always lands in your internal USDT wallet. There are two ways to pay for a BTC → USDT swap:paymentCurrency controls what amount means. If paymentCurrency is USDTCENT, amount is in USDT cents (1000 = 10 USDT).
BTC → USDT
USDT is credited to your internal wallet. Autopayout to an external address is not supported.amount is in USDT cents because paymentCurrency is USDTCENT.
Pay a Lightning invoice
OmitsourceWallet. The response includes a Lightning invoice. Pay that invoice within 60 seconds. Mavapay credits your internal USDT wallet when the payment is received.
Do not call the accept endpoint for this path. Paying the invoice completes the swap.
Debit your BTC wallet
PasssourceWallet: "BTC". The response invoice is an internal reference (MAVAPAY_INTERNAL:...). Do not pay it. Accept the quote to debit your BTC wallet.
USDT → BTC
Debits your USDT wallet and credits your internal BTC wallet.onchainAddress and memo are internal placeholders (MAVAPAY_INTERNAL). Do not send funds to them. Accept the quote to complete the swap.
Accept the swap
Use this only when the quote includessourceWallet. If you requested a Lightning invoice (no sourceWallet), pay invoice instead.
Call Accept Quote with the quote id and the wallet to debit. This must match sourceWallet on the quote.
BTC → USDT — debit BTC:
totalAmountInSourceCurrency (includes fees). If the quote has expired, create a new one.
After a BTC → USDT swap
USDT lands in your internal wallet. To send it on-chain:- Confirm the USDT balance with Get wallets (
currency=USDT) - Withdraw to an external address
Related
USDT wallet
Deposit and withdraw USDT
Buy USDT with NGN
Buy USDT using Naira
Accept quote
Debit a wallet and complete a quote
Prefunded payouts
Pay fiat payouts from your USDT wallet
