Gateway USDC to Bitcoin Round Trip
Operator runbook for one tiny mainnet USDC to Bitcoin sale through BOB Gateway, from route discovery to the recorded receipt.
This runbook is for the operator who proves the USDC offramp on mainnet once, with the smallest amount the Gateway accepts. It spends real USDC. Nothing here is automated; run each step yourself through the same client and MCP flow any agent uses, and fill the placeholders as you go. Use the same steps for USDT by swapping the token.
Before You Begin
- Full account access and a funded execution wallet. Check the balance with
get_portfolio; it must hold the minimum amount below plus Ethereum gas. - A Bitcoin address you control, used as the destination.
- A client that can build the Gateway v4 create-order request and broadcast an Ethereum transaction. Pakt never builds, repairs or submits it.
- A Pakt approved before USDC support fails closed with
policy_program_upgrade_required; step 3 approves a fresh one.
Record Sheet
Keep these filled in; they are the evidence for the run.
| Item | Value |
|---|---|
| Gateway minimum amount (USDC) | <MIN_USDC> |
| Amount sold (USDC base units) | <AMOUNT> |
| Bitcoin destination | <BTC_ADDRESS> |
| Pakt root | <PAKT_ROOT> |
| Approval transaction hash | <APPROVE_TX_HASH> |
| Gateway order id | <GATEWAY_ORDER_ID> |
| Order transaction hash | <ORDER_TX_HASH> |
| Pakt receipt id | <RECEIPT_ID> |
| Bitcoin payout txid | <BTC_TXID> |
Steps
- Discover routes. Call
list_gateway_routes. Confirm the Ethereum USDC to Bitcoin route is listed and copy its asset entries for the draft. Read a Gateway v4 get-quote for the same route and note the minimum amount; use that amount, not more, as<MIN_USDC>. - Draft. Call
draft_paktwith a Gateway Pakt that lists a Bitcoin entry and an Ethereum USDC entry (copied from step 1), the Bitcoin destination<BTC_ADDRESS>, and a trade-size cap just above the amount. Read back the rules; the draft's root is<PAKT_ROOT>. - Activate. Call
prepare_pakt_activationfor<PAKT_ROOT>, then approve it in the dashboard with the bound Pakt signer. If an older Gateway Pakt is active, turn it off first and wait for the replacement delay. - Approve the token. Build the ERC-20 approval for the USDC amount to the
pinned Gateway spender, call
propose_executionwith the approval, broadcast the signed result, and wait for finality. Record<APPROVE_TX_HASH>. - Create the order. Ask Gateway v4 for the order (
<AMOUNT>USDC, destination<BTC_ADDRESS>) and record<GATEWAY_ORDER_ID>. Do not add affiliate fees; Pakt refuses them. - Propose. Call
propose_executionwith exactly that order transaction and<PAKT_ROOT>. A refusal is final: stop and record the reason code. - Broadcast. Submit the signed transaction with your Ethereum client.
Record
<ORDER_TX_HASH>. - Register. Register
<ORDER_TX_HASH>with Gateway for<GATEWAY_ORDER_ID>so the solver picks it up. - Record completion. Call
record_execution_completionwith the transaction result; note<RECEIPT_ID>. Verify the receipt as in Verify Receipts. - Confirm payout. Wait for Gateway to settle, then record
<BTC_TXID>and check the destination received at least the order's Bitcoin minimum.
If Something Fails
- Proposal refused: keep the refusal, change nothing on-chain, and fix the draft or request. Do not route around Pakt.
- Order not picked up after registration: the Gateway order id and transaction hash are enough for the Gateway team to look it up.
- A stuck order refunds to the owner in the order token after the Gateway refund delay. A USDC order refunds as USDT, because the swap leg runs first.