Skip to main content
Rach swaps your customers’ stablecoins two ways: Either way, Rach pays the gas and the customer needs no native token.

Same-chain swaps

The output lands in the same customer’s address on the same chain. The result arrives as swap.settled or swap.failed (Webhooks), or poll GET /v1/swaps/{id}.

Cross-chain swaps

1. Quote (optional, reserves nothing)

POST /v1/swaps/cross-chain/quote with your API key:
  • amount is what goes into the swap. Rach’s flat fee for the origin chain comes on top, as for a payout.
  • expected_out is the likely output. min_out is the least the customer will receive: if the swap cannot deliver at least that much, it is refunded instead.
  • The output goes to the customer’s own address on to_chain unless you pass to_address (any valid address on that chain).
  • slippage_bps is optional: default 100 (1%), maximum 500.

2. Swap (signed)

Send the same body to POST /v1/swaps/cross-chain, signed with your payout key and carrying an Idempotency-Key. Add a reference if you want one echoed back.
What happens next:
  1. Rach requests a quote from NEAR Intents. The refund address is always the customer’s own address on the origin chain. Rach checks NEAR’s signature and that every term matches what you asked for.
  2. Rach sends amount from the customer’s address to the quote’s deposit_address, exactly like a payout (status: DEPOSITING).
  3. NEAR Intents swaps and delivers to recipient (PROCESSING), then the swap ends:
Poll with GET /v1/swaps/cross-chain/{id}, or list with GET /v1/swaps/cross-chain (?customer_ref=, limit, offset).
Credit from deposits, not from swap events. When the output (to_customer: true) or a refund lands in a customer’s own address, it also arrives as a normal transfer.received. That deposit is your signal to credit. Swap events tell you what happened to the swap; crediting from both would credit twice. A typical ledger debits total_debited in the origin token when you request the swap, credits from transfer.received, and releases the debit on cross_chain_swap.failed with deposited: false.

Limits

  • Minimum: NEAR Intents currently requires about $100 per swap. Below that, the quote is refused with 422 and the provider’s reason.
  • Only the canonical USDT and USDC contracts on each chain are swapped (for example, native USDC on Polygon, not bridged USDC.e). Base has no canonical USDT, and TRON has no USDC.
  • A deposit that reaches NEAR Intents after quote_deadline is refunded to the customer.

Sandbox

Test-mode keys get a real dry quote from NEAR Intents, with placeholder addresses, in the live response shape and status: "SANDBOX_SIMULATED". Nothing is reserved or moved.