Skip to content

HyperSwap

The HyperSwapSDK manages HyperSwap — a public good enabling direct multi-party swaps with unlimited assets and zero fees, using merkle trees to eliminate on-chain storage costs.

Traditional atomic swaps require on-chain state for each offer. HyperSwap eliminates this by using merkle trees:

  1. Create offers — A maker creates multiple swap offers (e.g., “I’ll trade 100 AKTA for 50 USDC”)
  2. Build merkle tree — All offers are hashed into a merkle tree
  3. Store root — Only the merkle root is stored on-chain
  4. Accept with proof — A taker accepts an offer by providing the merkle proof

This allows a single user to create thousands of swap offers with minimal on-chain storage.

Swaps execute atomically — either both sides of the trade complete, or neither does. There’s no counterparty risk.

import { HyperSwapSDK } from '@akta/sdk/hyper-swap'
const hyperSwap = new HyperSwapSDK({ algorand })
  • Zero fees — A public good with no protocol fees
  • Unlimited assets — Trade any ASA for any other ASA or ALGO, with no limit on the number of assets per swap
  • Merkle tree storage — Thousands of offers from a single on-chain root
  • Atomic execution — Zero counterparty risk
  • Cancel support — Makers can cancel their offers

HyperSwap operations through a wallet use the HyperSwapPlugin. See Wallet Plugins.