Skip to main content

Swaps at a glance

  • V2 (recommended): Simplified swapQuote → swapPSBT → swapSubmit flow with automatic marketplace selection and cleaner parameters. Supports multiple PSBTs per swap and protocols like runes and alkanes.
  • V1 (legacy): Granular rune trading with manual order handling (fetchQuote → getPSBT → confirmPSBT) and optional RBF protection. Kept for backwards compatibility.
  • Packages: Use the standalone @satsterminal-sdk/swaps or the suite satsterminal-sdk (exports the same SatsTerminal client).

Install

Choose your flow

Protocols and tokens

  • protocol: runes for rune trading, alkanes for alkanes tokens, more coming.
  • fromToken/toToken: clear directionality (e.g., BTC → USDC or DOG•GO•TO•THE•MOON → BTC).
  • Marketplaces are selected automatically for V2; pass marketplace when creating PSBTs or submitting.

Quick V2 shape

What changed from V1

  • Direction is expressed via fromToken/toToken instead of sell.
  • Multiple PSBTs per swap (array) vs single PSBT.
  • Automatic order management; you only sign and submit.
  • Consistent response shapes and marketplace metrics.
See the detailed API and examples:
  • API reference: swaps/api
  • Quickstart: swaps/quickstart
  • Examples: swaps/examples