Ever want to jump from Curve pool to Curve pool? By integrating Synthetix’s zero-slippage synth conversions, you can now perform fully on-chain cross asset swaps for just a .38% fee and minimal slippage.
How does it work? Let’s dig through the source code to reveal the secrets behind this magic trick. Imagine you want to convert a wrapped BTC to a dollar coin. The journey requires four steps, being converted to sBTC, then sUSD, and finally sUSD.
A few things to note in this chain. Synthetix has a mandatory waiting period of about six minutes to prevent against sudden price fluctuations. When the sBTC is converted to sUSD in this example, it is locked up for a short waiting period before it can be converted into the final output. This means it is impossible to perform the exchange atomically, and you have to wait a few blocks.
Another interesting note is that the conversion between Synthetix assets actually creates a new non-fungible ERC721 token:
Once you’ve minted this non-fungible token and the waiting period has expired, you can convert it to your final preferred coin as soon as you like. Since you are the custodian of this new NFT asset, you can also wait and perform the final conversion at a later time, or even trade it for multiple different assets until the balance expires.
Some useful functions exist to interact with this new contract. The handy
get_swap_from_synth_amount functions allow for quick estimation of conversions directly to synth assets, and the
get_estimated_swap_amount can estimate exchange rates directly between two assets (ignoring the fluctuation during the lockout period).
Due to the multiple on-chain events that take place during these conversions, gas prices are significant. The Curve team estimates it would cost around $80 at 50 gwei, so these transactions are recommended only for larger transactions.
Curve users were astounded and heavily bullish on the development.
Andre Cronje @AndreCronjeTechhttps://t.co/fuinOjpXL3
Curve Finance @CurveFinanceCross-asset swaps via @synthetix_io are live! https://t.co/LHBRt2zLSO
Synthetix tokens are commonly among the top ten assets by volume on Curve Market Cap, which could continue if cross-asset conversions continue to pick up steam.
For more info, check our live market data at https://curvemarketcap.com/ or our subscribe to our daily newsletter at https://curve.substack.com/. Nothing in our newsletter can be construed as financial advice.