cowprotocol / services

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

feat: Refactor `get_auction` API to return historic entries #2844

Open sunce86 opened 3 months ago

sunce86 commented 3 months ago

Problem

Currently get_auction API function returns only the latest auction built by autopilot.

We need to add possibility for this endpoint to return auction by given auction_id/block_number.

Suggested solution

Most of the data can be fetched from database even now. Tables of interest are orders, auction_orders, auction_prices, fee_policies, surplus_capturing_jit_order_owners. Things missing in the database are: auction.block, auction. latest_settlement_block and order.executed field. These fields should be saved and then all the data required to reconstruct the auction will exist.

@fleupold commented (todo check): Can’t auction.lastest_settlement_block and executed be reconstructed from the existing trades/settlements table assuming auction.block is saved?

Additional context

Solvers, solver-team and other parties are very interested in this endpoint and this could have a significant impact on those parties making their work easier, faster and cleaner.

github-actions[bot] commented 1 month 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.