Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate 1inch integration #373

Open
1 task
Tracked by #382 ...
LukSteib opened this issue Jul 22, 2022 · 1 comment
Open
1 task
Tracked by #382 ...

Investigate 1inch integration #373

LukSteib opened this issue Jul 22, 2022 · 1 comment
Assignees

Comments

@LukSteib
Copy link
Contributor

Goal

Get understanding wether it is feasible to create a 1inch based callee contract

Context

An exchange callee contract that is based on 1inch is a thought after feature. This is due to the fact that 1inch functions as a DEX aggregator and allows to determine the most lucrative paths for token swaps across protocols. The existing callees rely on hardcoded paths. Upside of a 1inch based callee would be a dynamic routing resulting in better market prices to execute swaps.

To check feasibility we want to investigate wether 1inch can be used in a way to get the raw call data that could be used to assemble such a callee contract

Assets

Tasks

  • Outline investigation results
@valiafetisov
Copy link
Contributor

valiafetisov commented Sep 14, 2022

Everything seems to be working via the REST API, according to the quick start page, even the transactions are signed off-chain and sent to their REST API in a raw format.

  • There is REST endpoint to get quotes https://docs.1inch.io/docs/aggregation-protocol/api/quote-params
  • The contract that will withdraw funds during the exchange will need to set allowance (not sure what it means in case of a flash loan, does VAT contract needs to set the allowance?)
  • Only works with IERC20 tokens
  • Callee contract will need to utilise clipperSwapToWithPermit
    • It doesn't accept route details, so the data, route, profit, etc returned from the /api/quote can be different from the actual transaction
  • There is no official SDK for their API, but unofficial

Actions that can be taken already:

  • We need to check if we can directly use their API from the frontend (technically, but also legally)
  • We can integrate 1inch quoter into frontend to display 1inch exchange price alongside uniswap price (at least on the dashboard) to see the difference even if we don't yet allow exchange
  • We need to Conceptualise support of several callees per collateral #374 in terms of UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants