Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Atomic Swap

A non-custodial escrow service for secure peer-to-peer token-to-token exchanges between two parties, enabling atomic settlement once the required tokens are paid by the second party.

Use Cases

Atomic Swap can be used for:

  • Direct Token Exchange — exchanging one stablecoin or token for another without using a conventional exchange.
  • Business Settlements — exchanging supported assets as part of a commercial payment or settlement.
  • Peer-to-Peer Exchanges — arranging a direct asset exchange between parties without requiring either party to establish a trading relationship beforehand.

Step-by-Step Tutorial

Prerequisites

Before you begin, ensure you have:

  • A non-custodial wallet installed (e.g., MetaMask, Trust Wallet).
  • Network tokens available in your wallet to pay for gas fees.
  • The payment token you intend to deposit must be approved for use with the escrow contract.

A. Approving Tokens for AtomicSwap

Before making a deposit, you must grant the escrow smart contract permission to handle your chosen token.

  1. Navigate to the AtomicSwap in the Organize section in application.
  2. Tap Approve Token.
  3. Confirm the transaction in your wallet.
  4. Wait for the approval transaction to be confirmed on the network.

Once approved, you are ready to make a deposit.

B. Creating an AtomicSwap Deposit

  1. Tap AtomicSwap proceed to the deposit creation screen.
  2. Enter the deposit details:
    • Sender DID: The wallet address of the seller or payee.
    • Sending Amount: The number of tokens to lock.
    • Receiving Amount: The number of tokens to swap with locked asset.
    • Expiration Date: The deadline after which the deposit can not be swap anymore but can be rolled back by the sender.
  3. Select the correct Network for the transaction.
  4. Tap Deposit and confirm the transaction in your wallet.
  5. After the transaction is successful, the new escrow record will appear in your History.
  6. Copy the DID from the transaction details and share it with the other party so they can track the escrow.

Benefits

  • Direct token-to-token exchange
  • Non-custodial settlement
  • On-chain and verifiable transaction flow
  • No intermediary or order-book infrastructure
  • Supports exchanges between supported assets on the same network
  • 0% exchange fee

Considerations

Atomic Swap requires both sides to provide the assets specified in the swap. It is intended for direct exchanges rather than continuous trading, price discovery, or liquidity provision. Exchange availability therefore depends on another party fulfilling the requested terms.

Fee

Exchange Fee: 0%

Service Fee: A flat fee is charged in the network's native token.

Network transaction fees may still apply when interacting with the underlying blockchain.

Swap Lifecycle

Created → Funded → Fulfilled → Exchanged

A swap begins when the offered asset and requested exchange terms are established. Once the required assets are provided, the swap is fulfilled and the assets are exchanged according to its terms. Where applicable, an uncompleted swap may reach its defined expiry or termination state.