paraswap-dex-lib
paraswap-dex-lib copied to clipboard
feat: WAMPL - Wrapped AMPL dex
I noticed this recent transaction on paraswap where a user tried to swap from AMPL to WAMPL (Wrapped AMPL) and the transaction hopped through a bunch of pools to get there. I believe the cheaper swap in this case would be through directly interacting with the wrapper.
https://etherscan.io/tx/0x3334db7d3b410cfb8296352121b38679267221bd14aec47c4fe2508204c700e3
Wrapped AMPL is a non-rebasing floating price version of AMPL. Functionally, It's a lot like WETH. I wonder if we could define a 'dex' for WAMPL similar to the one you already have for WETH (similar to the implementation I have in this PR).
We are looking to accomplish two things here:
- Ability for users to directly wrap and unwrap AMPL though para-swap
- Treat WAMPL liquidity as AMPL liquidity. UniV3 and Balancer V2 don't support tokens with changing balances. In our case we're thinking LPs can provide liquidity using the wrapped version (eg WAMPL - USDC) and aggregators can wrap/unwrap on the fly if traders want to trade AMPL. eg) User wants to buy AMPL with ETH. Paraswap swaps user's ETH for WAMPL (on the univ3 pool) and then un-wraps WAMPL to give user AMPL.
Would be great if you can add this. Willing to help in anyway I can ..
If you're interested further I think we generalize this framework to all wrapped tokens (wstETH, wstOHM etc).