Overview
Rhinestone supports two types of swaps: injected and solver-based. Injected swaps let you tap into onchain liquidity using DEX aggregators like 1inch and 0x. It requires some additional setup, but provides great token coverage, deep liquidity, and best-in-class price execution. Solver-based swaps use relayer liquidity to make swaps. They are simpler to get started, but are limited in token support that is bound by relayer liquidity.Injected Swaps
We will use 1inch API to make a WETH -> cbBTC swap on Base chain using funds on Arbitrum. First, let’s initialize 1inch API client:Solver-based swaps
With Rhinestone, you can automatically swap your tokens when executing the transaction using relayer liquidity. Say, you only have USDC on Base but want to transact with ETH on Arbitrum. In that case, you only need to specify the required tokens on the target chain, and Omni Account will do the bridging and the swap in one go. To make your first cross-chain swap, make sure that:- The account is deployed on any chain.
- The account has at least one of the supported assets on the chain with the deployed account.
Make sure the token address in
calls
and tokenRequests
corresponds to the target chain.