Intrachain Swap
Sequence diagram and description of the intrachain swap. (Swaps within a chain)
Last updated
Sequence diagram and description of the intrachain swap. (Swaps within a chain)
Last updated
This sequence diagram illustrates the process of an intrachain swap:
The User initiates the swap through the Frontend.
The Frontend constructs the swap transaction based on the user's input. Any swap protocol available on the chain and supported by the Frontend can be utilized.
The Frontend requests the User to sign the transaction.
The User signs the transaction and broadcasts the signed transaction to the blockchain.
The Executor contract participates in the transaction execution.
The Executor validates the transaction.
If the transaction is valid:
a. The Executor sends a request to the Swap Protocol (thirdparty) to execute the swap.
b. The Swap Protocol executes the swap.
c. The Swap Protocol returns the swap result to the Executor.
e. The Executor transfers fees to the system wallet.
f. The Executor returns the transaction result to the Frontend.
If the transaction is invalid the Executor returns an error to the Frontend.
The Frontend displays the swap result or the error to the User.