cowprotocol / services

Off-chain services for CoW Protocol
https://cow.fi/
Other
143 stars 60 forks source link

chore: Quote using limit order #2543

Open sunce86 opened 3 months ago

sunce86 commented 3 months ago

Background

Currently we are quoting using market order type: https://github.com/cowprotocol/services/blob/main/crates/driver/src/domain/quote.rs#L124

Unfortunately, baseline solver requires native price of the sell token of the order, in order to calculate the actual amount of sell token required as fee: https://github.com/cowprotocol/services/blob/main/crates/solvers/src/domain/solution.rs#L168

How to resolve this? AFAIS the only way is to issue separate quote for sell token internally in baseline solver to get the native price of sell token. Any other idea? Do we even need to return fee in this case, since now it returns the Static fee which resolves to user_fee which is zero.

This is one of the major hurdles to completely remove market orders and user fee from driver/solvers crates.

github-actions[bot] commented 3 weeks ago

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.