WH Swap
Last updated
Last updated
WH Swap Bridge is a permissionless, open-source bridge built on Wormhole primitives and developed by the Mayan team to facilitate cross-chain, one-click token swaps.
The Token Bridge, a widely recognized component of the Wormhole ecosystem, facilitates cross-chain token transfers using a mint-and-burn mechanism. To expand its functionality, we leveraged Wormhole's generic message-passing capabilities to design a new bridge tailored for cross-chain swaps. This innovative structure embeds swap-specific information alongside a reference to the Token Bridge message. Upon relayers delivering these messages on Solana, drivers are equipped with all the data needed to seamlessly engage in the Mayan swap auction.
Post-auction, the winner becomes responsible for swapping the tokens in a flash swap transaction. In this atomic transaction, the winner receives the funds and must send the promised output amount within the same transaction.
After the successful execution of the swap, if the destination address is on Solana, the relayer simply transfers the output token to the user's wallet. Otherwise, the relayer uses a token bridge to send the tokens to the destination chain.
Here is an overview of what happens when a user executes a cross-chain transaction on Mayan:
The protocol fee of WH Swap method is set to 10 basis points.
Network | Wormhole Chain Id | Contract Address |
---|---|---|
Solana
FC4eXxkyrMPTjiYUpp4EAnkmwMbQyZ6NDCh1kfLn6vsf
Ethereum
0xBF5f3f65102aE745A48BD521d10BaB5BF02A9eF4
BSC
0xBF5f3f65102aE745A48BD521d10BaB5BF02A9eF4
Polygon
0xBF5f3f65102aE745A48BD521d10BaB5BF02A9eF4
Avalanche
0xBF5f3f65102aE745A48BD521d10BaB5BF02A9eF4
Arbitrum
0xBF5f3f65102aE745A48BD521d10BaB5BF02A9eF4
Optimism
0xBF5f3f65102aE745A48BD521d10BaB5BF02A9eF4
Base
0x11AA521C888d84f374B63823d9b873CAa3591f55