swap-ui
swap-ui copied to clipboard
[WIP] Explicit flows for wrapping and token initialization
Addresses https://github.com/project-serum/swap-ui/issues/63
Changes:
- displays wrap/unwrap when swapping between sol/wrapped-sol
- displays "create accounts" when the "to token" (or quote token for a transitive swap) does not have an account created
- displays "create accounts" when the DEX open orders accounts aren't created
TODO:
- display wrap/unwrap when displaying a wormhole or sollet swap market
I'm working to update states after "create accounts" is called, should make a PR tomorrow. It would be better if wrap/unwrap could is implemented through a separate PR, as we want to deploy "create accounts" in production.
Please approve https://github.com/project-serum/swap-ui/pull/77
How to proceed on the Sollet and Wormhole update? I'm thinking as follows:
- swap-ui code has wormhole USDT and USDC market addresses with sufficient liquidity. Swap against them.
- Raydium has example code to unwrap sollet wUSDT into SPL USDT. This could be extended to wUSDC as well. Any other token left out? Also is this update necessary given that everyone uses native USDT now?
Sollet unwrap for wUSDC and wUSDT is supported now. Wormhole token swaps shouldn't need code changes. We just list the wormhole markets on Solana's token list so that swaps are enabled.