Shortfall is an auction contract designed to auction off the convertibleBaseAsset accumulated in RiskFund. The convertibleBaseAsset is auctioned in exchange for users paying off the pool's bad debt. An auction can be started by anyone once a pool's bad debt has reached a minimum value. This value is set and can be changed by the authorized accounts. If the pool’s bad debt exceeds the risk fund plus a 10% incentive, then the auction winner is determined by who will pay off the largest percentage of the pool's bad debt. The auction winner then exchanges for the entire risk fund. Otherwise, if the risk fund covers the pool's bad debt plus the 10% incentive, then the auction winner is determined by who will take the smallest percentage of the risk fund in exchange for paying off all the pool's bad debt.
Copy enum AuctionType {
LARGE_POOL_DEBT ,
LARGE_RISK_FUND
}
Copy enum AuctionStatus {
NOT_STARTED ,
STARTED ,
ENDED
}
Copy struct Auction {
uint256 startBlock;
enum Shortfall .AuctionType auctionType;
enum Shortfall.AuctionStatus status;
contract VToken[] markets;
uint256 seizedRiskFund;
address highestBidder;
uint256 highestBidBps;
uint256 highestBidBlock;
uint256 startBidBps;
mapping(contract VToken => uint256) marketDebt;
mapping(contract VToken => uint256) bidAmount;
} Pool registry address
Risk fund address
minimumPoolBadDebt
Minimum USD debt in pool for shortfall to trigger
Incentive to auction participants, initial value set to 1000 or 10%
nextBidderBlockLimit
Time to wait for next bidder. Initially waits for 100 blocks
Boolean of if auctions are paused
waitForFirstBidder
Time to wait for first bidder. Initially waits for 100 blocks
Auctions for each pool
Initialize the shortfall contract
Parameters
RiskFund contract address
Minimum bad debt in base asset for a pool to start auction
AccessControlManager contract address
❌ Errors
ZeroAddressNotAllowed is thrown when convertible base asset address is zero
ZeroAddressNotAllowed is thrown when risk fund address is zero
Place a bid greater than the previous in an ongoing auction
Parameters
Comptroller address of the pool
The bid percent of the risk fund or bad debt depending on auction type
The block number when auction started
📅 Events
Emits BidPlaced event on success
Close an auction
Parameters
Comptroller address of the pool
📅 Events
Emits AuctionClosed event on successful close
Start a auction when there is not currently one active
Parameters
Comptroller address of the pool
📅 Events
Emits AuctionStarted event on success
Errors if auctions are paused
Restart an auction
Parameters
📅 Events
Emits AuctionRestarted event on successful restart
updateNextBidderBlockLimit
Update next bidder block limit which is used determine when an auction can be closed
Parameters
New next bidder block limit
📅 Events
Emits NextBidderBlockLimitUpdated on success
⛔️ Access Requirements
updateIncentiveBps
Updates the incentive BPS
Parameters
📅 Events
Emits IncentiveBpsUpdated on success
⛔️ Access Requirements
updateMinimumPoolBadDebt
Update minimum pool bad debt to start auction
Parameters
Minimum bad debt in the base asset for a pool to start auction
📅 Events
Emits MinimumPoolBadDebtUpdated on success
⛔️ Access Requirements
updateWaitForFirstBidder
Update wait for first bidder block count. If the first bid is not made within this limit, the auction is closed and needs to be restarted
Parameters
New wait for first bidder block count
📅 Events
Emits WaitForFirstBidderUpdated on success
⛔️ Access Requirements
updatePoolRegistry
Update the pool registry this shortfall supports
Parameters
Address of pool registry contract
📅 Events
Emits PoolRegistryUpdated on success
⛔️ Access Requirements
❌ Errors
ZeroAddressNotAllowed is thrown when pool registry address is zero
Pause auctions. This disables starting new auctions but lets the current auction finishes
📅 Events
Emits AuctionsPaused on success
⛔️ Access Requirements
❌ Errors
Errors is auctions are paused
Resume paused auctions.
📅 Events
Emits AuctionsResumed on success
⛔️ Access Requirements
❌ Errors
Errors is auctions are active