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

Accept flashloan hints during order creation #3214

Closed
Tracked by #3213
MartinquaXD opened this issue Jan 7, 2025 · 0 comments · Fixed by #3236
Closed
Tracked by #3213

Accept flashloan hints during order creation #3214

MartinquaXD opened this issue Jan 7, 2025 · 0 comments · Fixed by #3236

Comments

@MartinquaXD
Copy link
Contributor

MartinquaXD commented Jan 7, 2025

Extend the appdata format to allow users providing hints for how their order can be settled with a flashloan.
Ideally solvers would not need this at all but at least for the initial implementation we'd like users to help solvers out with this non-trivial task.
Without this hint solvers would likely assume if a user doesn't have the necessary sell_tokens that the order is simply unfillable.

New data:

"flashloan": {
	"lender": "0xba12222222228d8ba445958a75a0704d566bf2c8"
	"borrower": "...",
	"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
	"amount": "1000000",
},

flashloan: (optional) field inside the appdata. If it's set the user hints at the solver that it may require a flashloan to settle this order.
lender: which contract could be used to borrow the funds from
borrower: (optional) who should get the proceeds of the trader, if this is not set assume the order's receive should get the funds
token: which token needs to get borrowed (usually the sell token)
amount: how many atoms of the token need to get borrowed (e.g. 1 WETH would be 10**18)

It will be made the responsibility of the driver to get access to this information on its own. So it's not necessary to also put this information into the order.

Initially I think it's okay that the usual order placement requirements apply (user needs to have at least 1 atom of the sell token). However, in the future we may need to reconsider this and find workarounds for 1 case in particular:

  • orders getting filtered out because the owner does not have enough sell_tokens
    That can be tackled later, though.

Acceptance Criteria

The PR should include an e2e test where an order with the new flashloan field in the appdata gets posted.
Afterwards the order should show up in the orderbook and fetching the appdata by the appDataHash should yield the originally submitted JSON string.

@MartinquaXD MartinquaXD changed the title accept flashloan hints in orderbook (no dependencies) Accept flashloan hints during order creation Jan 7, 2025
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

Successfully merging a pull request may close this issue.

1 participant