Swaps / Routes
Sell BTC
Sell BTC for a coin on an EVM chain. The solver locks the payout in the settler before the user sends any BTC. The user pays one Bitcoin output, and a proof releases the payout to them.
The EVM wallet that receives the payout signs one message. This needs no sign-in. fromAddress is any Bitcoin address of the payer. The samples use the setup from Get a quote.
curl -s -G "$BASE/quote" -H "x-maxy-key: $MAXY_API_KEY" -d from=BTC --data-urlencode "to=USDC on base" -d amount=0.0005 \ -d fromAddress="$MY_BTC_ADDRESS" -d toAddress="$WALLET" > quote.json INTENT_SIG=$(cast wallet sign --private-key "$TEST_WALLET_KEY" --data "$(jq -c '.steps[] | select(.id == "intent") | .typedData' quote.json)") curl -s -X POST "$BASE/orders" -H "x-maxy-key: $MAXY_API_KEY" -H "content-type: application/json" \ -d "$(jq -c --arg sig "$INTENT_SIG" '{order: .order, signatures: {intent: $sig}}' quote.json)" > placed.json DEPOSIT="$BASE$(jq -r '.next.path | ltrimstr("/")' placed.json)" # the path starts with /, as BASE ends until curl -s "$DEPOSIT" | jq -e .ready > /dev/null; do sleep 3; done curl -s "$DEPOSIT" | jq '{address, sats, bitcoinUri, expiresAt}'
Poll until ready is true, then show the address. bitcoinUri is the QR code. In the sandbox the address is a testnet one: pay nothing, and the order walks by itself.
Pay once, exactly, on time. One output of exactly sats to address. Live orders allow 19 Bitcoin blocks, about 3 hours. Speeding up a stuck payment is fine if it keeps the amount and address; never lower or split it.
Each order is at least about $10, up to your key's cap, with three open sell orders per wallet: more answers rate_limited until they are paid or expire. insufficient_liquidity means the solver cannot pay this size now. deposit_address_unverified means the payout is not escrowed for the user: do not pay, and start again.
A wrong or late payment: Failed sells.