SafeSwap
Open SafeSwap
  • 👋Introduction to SafeSwap
  • Learn
    • 🤔How SafeSwap Works
    • 🪙SHA Token
    • ⛽Fee Structure
    • 💰Fee Distribution
    • 👑SafeNodes
    • 📚Glossary
  • User Guides
    • 🔄Swap Tokens
    • 📊Token Dashboard
  • Technical
    • ⚛️Cross-Chain Atomic Swaps
    • 🔐HTLC
    • 🛡️Security Measures
    • ⛓️Supported Blockchains
    • 👝Supported Wallets
    • 🕵️Audits
  • Builders
    • 🌍Hello World!
    • 🏗️Cross-Chain Use Cases
    • 🖥️Token Listing
    • 👨‍💻Whitelabel Integration
    • 📖API Integration Guide
      • Prerequisites
      • What is a Swap?
      • Perform a Swap
        • Initiate a Swap
        • Send Fees
        • Create the Swap in API
        • Wait/Poll for the Swap
        • Complete the Swap
        • Cancel/Refund
      • Smart Contract Details
      • Our Swap Addresses
      • API Details
  • About
    • Safe Haven
    • SafeTech
    • Support
Powered by GitBook
On this page
  1. Builders
  2. API Integration Guide

What is a Swap?

PreviousPrerequisitesNextPerform a Swap

Last updated 1 year ago

SafeSwap uses the "atomic swap" technique to guarantee that a swap occurs in a trustless manner. The idea is explained fully .

Steps in a Swap

  1. Initiate a Swap: User sends funds to the swap contract with a hashed preimage in the ecosystem where they currently hold their assets.

  2. Send Fees: Pay the required fees on the original chain and the destination chain. These fees cover our portion of the smart contract interactions.

  3. Creating the Swap in our API: Send an API request to our server to let us know about the smart contract interaction and the details of the swap that the user is trying to do. This includes information about what chain the swap should be sent to, the token, and more.

  4. Wait for us to set up the Swap: Poll our API occasionally (usually takes about 30 seconds) to find the status of the swap on the target chain.

  5. Complete the Swap on target chain: User claims new funds on the destination chain using their preimage. Then our system claims the original funds on the original chain and the swap is complete.

📖
here