ajna-finance / ajna-core

The Ajna protocol is a non-custodial, peer-to-peer, permissionless lending, borrowing and trading system that requires no governance or external price feeds to function.
https://www.ajna.finance/
Other
31 stars 11 forks source link

Claimable Reserve Auction kick timing logic #974

Closed EdNoepel closed 1 year ago

EdNoepel commented 1 year ago

Description

Clean up logic for kicking off claimable reserve auctions (CRAs), bringing implementation in-line with whitepaper, and reducing gas cost. Expanded an existing unit test to cover some more timing use cases.

Purpose

Whitepaper states:

If two weeks have passed since the completion of the last Claimable Reserve Auction, CRA, any user can kick off a new auction.

The code had been checking whether two weeks passed since the start of the last CRA. It also had some expensive redundant operations.

Impact

Expected reduction in gas cost of kickReserveAuction. Analysis revealed small median gas advantage kicking CRAs in ERC20 pools, where tests were unchanged.

Tasks