Shortfall
Shortfall
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.
Solidity API
enum AuctionType {
LARGE_POOL_DEBT,
LARGE_RISK_FUND
}
enum AuctionStatus {
NOT_STARTED,
STARTED,
ENDED
}
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;
}
poolRegistry
Pool registry address
address poolRegistry
riskFund
Risk fund address
contract IRiskFund riskFund
minimumPoolBadDebt
Minimum USD debt in pool for shortfall to trigger
uint256 minimumPoolBadDebt
incentiveBps
Incentive to auction participants, initial value set to 1000 or 10%
uint256 incentiveBps
nextBidderBlockLimit
Time to wait for next bidder. Initially waits for 100 blocks
uint256 nextBidderBlockLimit
auctionsPaused
Boolean of if auctions are paused
bool auctionsPaused
waitForFirstBidder
Time to wait for first bidder. Initially waits for 100 blocks
uint256 waitForFirstBidder
auctions
Auctions for each pool
mapping(address => struct Shortfall.Auction) auctions
initialize
Initialize the shortfall contract
function initialize(contract IRiskFund riskFund_, uint256 minimumPoolBadDebt_, address accessControlManager_) external
Parameters
riskFund_
contract IRiskFund
RiskFund contract address
minimumPoolBadDebt_
uint256
Minimum bad debt in base asset for a pool to start auction
accessControlManager_
address
AccessControlManager contract address
❌ Errors
ZeroAddressNotAllowed is thrown when convertible base asset address is zero
ZeroAddressNotAllowed is thrown when risk fund address is zero
placeBid
Place a bid greater than the previous in an ongoing auction
function placeBid(address comptroller, uint256 bidBps, uint256 auctionStartBlock) external
Parameters
comptroller
address
Comptroller address of the pool
bidBps
uint256
The bid percent of the risk fund or bad debt depending on auction type
auctionStartBlock
uint256
The block number when auction started
📅 Events
Emits BidPlaced event on success
closeAuction
Close an auction
function closeAuction(address comptroller) external
Parameters
comptroller
address
Comptroller address of the pool
📅 Events
Emits AuctionClosed event on successful close
startAuction
Start a auction when there is not currently one active
function startAuction(address comptroller) external
Parameters
comptroller
address
Comptroller address of the pool
📅 Events
Emits AuctionStarted event on success
Errors if auctions are paused
restartAuction
Restart an auction
function restartAuction(address comptroller) external
Parameters
comptroller
address
Address of the pool
📅 Events
Emits AuctionRestarted event on successful restart
updateNextBidderBlockLimit
Update next bidder block limit which is used determine when an auction can be closed
function updateNextBidderBlockLimit(uint256 _nextBidderBlockLimit) external
Parameters
_nextBidderBlockLimit
uint256
New next bidder block limit
📅 Events
Emits NextBidderBlockLimitUpdated on success
⛔️ Access Requirements
Restricted by ACM
updateIncentiveBps
Updates the incentive BPS
function updateIncentiveBps(uint256 _incentiveBps) external
Parameters
_incentiveBps
uint256
New incentive BPS
📅 Events
Emits IncentiveBpsUpdated on success
⛔️ Access Requirements
Restricted by ACM
updateMinimumPoolBadDebt
Update minimum pool bad debt to start auction
function updateMinimumPoolBadDebt(uint256 _minimumPoolBadDebt) external
Parameters
_minimumPoolBadDebt
uint256
Minimum bad debt in the base asset for a pool to start auction
📅 Events
Emits MinimumPoolBadDebtUpdated on success
⛔️ Access Requirements
Restricted by ACM
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
function updateWaitForFirstBidder(uint256 _waitForFirstBidder) external
Parameters
_waitForFirstBidder
uint256
New wait for first bidder block count
📅 Events
Emits WaitForFirstBidderUpdated on success
⛔️ Access Requirements
Restricted by ACM
updatePoolRegistry
Update the pool registry this shortfall supports
function updatePoolRegistry(address poolRegistry_) external
Parameters
poolRegistry_
address
Address of pool registry contract
📅 Events
Emits PoolRegistryUpdated on success
⛔️ Access Requirements
Restricted to owner
❌ Errors
ZeroAddressNotAllowed is thrown when pool registry address is zero
pauseAuctions
Pause auctions. This disables starting new auctions but lets the current auction finishes
function pauseAuctions() external
📅 Events
Emits AuctionsPaused on success
⛔️ Access Requirements
Restricted by ACM
❌ Errors
Errors is auctions are paused
resumeAuctions
Resume paused auctions.
function resumeAuctions() external
📅 Events
Emits AuctionsResumed on success
⛔️ Access Requirements
Restricted by ACM
❌ Errors
Errors is auctions are active
Last updated