- Merchant settlement: accept BTC and deliver USDC to a Base or Solana treasury address.
- Wallet sell flow: users sell BTC and receive USDC on their preferred chain.
- Exact-out payments: deliver a precise USDC amount for invoices (Bitcoin L1 only).
Supported Routes
BTC (spark) -> USDC (base|solana)BTC (bitcoin|lightning) -> USDC (base|solana)BTC (bitcoin|lightning) -> USDB (spark)USDB (spark) -> USDC (base|solana)
BTC (bitcoin) -> USDC (base|solana)
appFees or affiliateId) is supported only when:
amountMode = exact_in- source or destination chain is
baseorsolana
destinationChain = base|solana) and are not used on BTC -> USDB (spark) routes.
Flow
- Create a quote:
POST /v1/orchestration/quote. - Initiate the source deposit to
depositAddress. - Submit the deposit transaction identifier:
POST /v1/orchestration/submit. - Track status via webhooks or
GET /v1/orchestration/status?id=.... - If status becomes
awaiting_approval, resolve withreprice/approve,reprice/reject, orreprice/refund.
Example: BTC (Spark) to USDC (Base)
Example: BTC (Bitcoin L1) to USDC (Exact In)
A Bitcoin L1 quote returns a BitcoindepositAddress. After you broadcast the transaction, submit the txid and the output index (vout) that paid the deposit address.
Quote request:
Example: BTC (Bitcoin L1) to USDC (Exact Out Payment Intent)
Use exact-out when the destination must receive a precise USDC amount. Quote request:targetAmountOut: requested destination amountrequiredAmountIn: minimum BTC input requiredmaxAcceptedAmountIn: highest BTC input auto-acceptedinputBufferBps: currently2whenslippageBps=0, else0
- Send
requiredAmountInfor the cleanest path. - Keep actual input at or below
maxAcceptedAmountIn. - If actual input is outside bounds, or target output cannot be met at current market conditions, the order moves to
awaiting_approval.
POST /v1/orchestration/reprice/approvePOST /v1/orchestration/reprice/rejectPOST /v1/orchestration/reprice/refund
reprice/refund moves the order to refunding, then terminal refunded after the refund is broadcast and recorded.
Example: BTC (Spark) to USDC (Solana) with Affiliate Fees
Example: BTC (Spark) to USDC (Solana) with Affiliate Registry
feeAmount: platform fee amounttotalFeeAmount: platform + app feesappFeeAmount: sum of all app fee amountsappFees: per-recipient fee breakdown in destination-chain smallest units (USDC)
- Affiliate fees are paid on the Base/Solana USDC destination payout side.
- App fee transfers and recipient payout transfers are recorded separately in
feePayouts.entries. feePayouts.entries[*].affiliateIdis present when the quote usedaffiliateId.- Multi-leg Bitcoin flows can include
full,instant, andholdbackpayout legs. - No affiliate fee is deducted from BTC or Spark balances.
- Status and webhooks include
feePlanandfeePayoutsas payout legs are recorded.
ZeroConf Behavior (Bitcoin L1)
WhenzeroconfEnabled is true and the deployment is configured for ZeroConf, exact-in quotes can be accepted before confirmations.
If ZeroConf cannot be used, or if you set zeroconfEnabled to false, the engine waits for 3 confirmations before proceeding.
For some deposits, ZeroConf may process an instant leg and hold back the remainder until confirmations. The same order id continues and the holdback leg is delivered after confirmations.
If the holdback remainder is below minimum swap size (dust), it is not swapped.
Exact-out (amountMode=exact_out) on Bitcoin L1 uses confirmation-based processing and does not use ZeroConf.
Example: BTC (Lightning) to USDC
A Lightning quote returns a BOLT11 invoice indepositAddress and a lightningReceiveRequestId. Pay the invoice, then submit the receive request id.
Quote response fields to pay:
depositAddress: BOLT11 invoiceamountIn: sats to paylightningReceiveRequestId: identifier used bysubmit