How Swaps Work

When I want to swap a token from one form to another, I initiate a swap request and send my token into a smart contract with the intention of what the result should be. With the funds now securely locked in that smart contract, another participant in the Mynth network is able to facilitate the actual swap based on my request. They will fulfill that request and send the token I am requesting to the destination I intended. Once the swap is completed, from my perspective as a user, my intention has been realized. I have sent my token into the smart contract and received the desired token in a different destination network.

On the other side, the facilitator who executed the swap would now want to extract the funds from the smart contract. To accomplish this, they will rely on Mynth’s Lizard network. A Lizard acts as a fact verifier that monitors external events, validates them, and submits proofs on-chain. An external event refers to anything that occurs in the real world, and in this case, it will be an event indicating that a transfer has been completed or an intention has been fulfilled. The Lizard will verify that the seller on the other end did, in fact, send the token from their wallet to the user’s intended destination. It will then submit this proof on-chain, allowing the smart contract to be unlocked so that the seller can extract the funds. The swap cycle is now completed.