Skip to content

DEX aggregator intergration #12

Description

@Zergity

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:

  1. UTR TRANSFER 10 USDT to Helper
  2. Helper approve 10 USDT to ParaswapRouter
  3. Helper call ParaswapRouter.data (with recipient is UTR) to receive x WETH
  4. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions