Axis-Fi / axis-core

Axis Protocol
https://axis.finance
Other
3 stars 0 forks source link

feat: Allow iterative settlement of batch auctions #167

Closed Oighty closed 2 months ago

Oighty commented 2 months ago

Goal of settlement: Process sorted bids to find marginal clearing price of batch auction.

Problem: The EVM limits the number of bids we can process in a single transaction due to the gas limit. Therefore, auctions that require more bids to settle than can be processed are bricked.

Solution: Allow auction to be settled over multiple transactions if needed.

The implementation of these changes is fairly minimal; however, testing all of the edge cases will require quite a bit of work. I made the following changes:

Tasks

Oighty commented 2 months ago

@0xJem let me know what you think of this version for iterative settlement. It's less invasive than I expected.

0xJem commented 2 months ago

First bid on second settle call is below minPrice

This isn't possible, actually. It will be filtered out in the decryption stage.

0xJem commented 2 months ago

Update callback test salts (think there may be a fix to port over from the other branch?)

I haven't seen any failures

Implement minBidSize -> quoteToken feature on this branch?

Let's clarify what's required

Oighty commented 2 months ago

I haven't seen any failures

I had to clear the bytecode on my end. Disregard

Implement minBidSize -> quoteToken feature on this branch?

Let's clarify what's required

Going to do this on a separate branch.

0xJem commented 2 months ago

Good to merge?

0xJem commented 2 months ago

I changed the base to develop, since we will have a couple of PRs merging in and don't think we should be leaving master in a potentially broken state.