How it Works
Wallchain Process Diagram
  1. 1.
    A user picks a pair to swap. DEX creates a transaction to perform the swap.
  2. 2.
    Before sending a transaction to a wallet (e.g. Metamask) for confirmation, it's being sent to Wallchain Service API at https://matic.wallchain.xyz/upgrade_txn/?key=<KEY>.
  3. 3.
    Wallchain Transaction Upgrade Service simulates various backrunning strategies. The outcome is twofold, either profitable upgrade is possible or the transaction is not profitable. If the profitable strategy has been found, an upgraded Transaction is sent in response to the API request. Otherwise, the request transaction is sent back as a response.
  4. 4.
    If no profitable strategy has been found the rest of the flow is left intact. The transaction is sent to the DEX router, and from the user’s perspective everything looks exactly the same as it was before with the regular flow. Most of the users will experience this flow and will feel no difference.
  5. 5.
    If the transaction has been upgraded, it's being sent to Wallchain Router Proxy instead of DEX router, which in turn calls DEX router and executes the backrunning afterwards.
  6. 6.
    Wallchain Router Proxy combines swap and profit capturing in a single transaction.This proxy router performs a swap through a regular DEX router. The same way as it is usually done.
  7. 7.
    Finally, the Router Proxy calls Wallchain Master. It captures the profit and shares it between DEX owners and the user.
Copy link