What is a Swap?

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

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.

Last updated