Intergrate free DEX aggregator API and Contract so position can be opened by any token in the network. And vice versa: closing to any token.
1inch is not free
paraswap seem to be the best option: https://developers.paraswap.network/api/master
testing for: ETH <-> rETH
UTR Flow:
- UTR TRANSFER 10 USDT to Helper
- Helper approve 10 USDT to ParaswapRouter
- Helper call ParaswapRouter.data (with recipient is UTR) to receive x WETH
- UTR call
Helper.swap to open position using x WETH
Execution Flow:
- write an UT to aggAndOpen(a position with TOKEN_R = WETH using USDT as input)
- construct the engine with aggregrator params
- call paraswap api to get target and data
- construct the UTR Flow above and staticcall the data to estimate amountOut
Intergrate free DEX aggregator API and Contract so position can be opened by any token in the network. And vice versa: closing to any token.
1inch is not free
paraswap seem to be the best option: https://developers.paraswap.network/api/master
testing for: ETH <-> rETH
UTR Flow:
Helper.swapto open position using x WETHExecution Flow: