Surplus Auction House
Surplus auctioneer that sells extra stability fees in exchange for protocol tokens
1. Summary
The surplus auction is used to sell off a fixed amount of the surplus in exchange for protocol tokens. The surplus comes from the stability fees charged to SAFEs (and stored in the AccountingEngine
). Bidders submit increasing amounts of protocol tokens and the winner receives all auctioned surplus in exchange for their coins which are burned or transferred to another address.
2. Contract Variables & Functions
Variables
contractEnabled
- settlement flag (available only in the pre-settlement surplus auction house)AUCTION_HOUSE_TYPE
- flag set tobytes32("SURPLUS")
authorizedAccounts[usr: address]
- addresses allowed to callmodifyParameters()
anddisableContract()
.bids[id: uint]
- storage of allBid
s byid
safeEngine
- storage of theSAFEEngine
's addressprotocolToken
- address of the protocol tokenauctionsStarted
- total auction countbidDuration
- bid lifetime / max bid duration (default: 3 hours)bidIncrease
- minimum bid increase (default: 5%)totalAuctionLength
- maximum auction duration (default: 2 days)protocolTokenBidReceiver
- receiver of protocol tokens after an auction is settled. Only present in theRecyclingSurplusAuctionHouse
.
Data Structures
Bid
- state of a specific auctionbidAmount
- quantity being offered for theamountToSell
amountToSell
- amount of surplus soldhighBidder
bidExpiry
auctionDeadline
- when the auction will finish
Modifiers
isAuthorized
- checks whether an address is part ofauthorizedAddresses
(and thus can call authed functions).
Functions
modifyParameters(bytes32 parameter
,uint256 data)
- update auint256
parameter.modifyParameters(bytes32 parameter
,address addr)
- update anaddress
parameter. Only present in theRecyclingSurplusAuctionHouse
.startAuction(amountToSell: uint256
,initialBid: uint256)
- start a new surplus auction.restartAuction(id: uint256)
- restart an auction if there have been 0 bids and theauctionDeadline
has passed.increaseBidSize(id: uint256
,amountToBuy: uint256
,bid: uint256)
- submit a bid with an increasing amount of protocol tokens for a fixed amount of system coins.disableContract()
- disable the contract.settleAuction(id: uint256)
- claim a winning bid / settles a completed auction.terminateAuctionPrematurely(id: uint256)
- is used in case Governance wishes to upgrade (only) thePreSettlementSurplusAuctionHouse
or in caseGlobalSettlement
is triggered. It settlesincreaseBidSize
phase auctions, sending back the protocol tokens submitted by thehighBidder
.
Events
AddAuthorization
- emitted when a new address becomes authorized. Contains:account
- the new authorized account
RemoveAuthorization
- emitted when an address is de-authorized. Contains:account
- the address that was de-authorized
ModifyParameters
- emitted after a parameter is modifiedRestartAuction
- emitted after an auction is restarted. Contains:id
- the ID of the auction being restartedauctionDeadline
- the new auction deadline
IncreaseBidSize
- emitted when someone bids a higher amount of protocol tokens for the same amount of system coins. Contains:id
- the ID of the auction that's being bid onhighBidder
- the new high bidderamountToBuy
- the amount of system coins to buybid
- the amount of protocol tokens bidbidExpiry
- the new deadline when the auction will end which can be before the originalauctionDeadline
StartAuction
- emitted whenstartAuction(uint256
,uint256)
is successfully executed. Contains:id
- auction idauctionsStarted
- total amount of auctions that have started up until nowamountToSell
- amount of system coins sold in the auction.initialBid
- starting bid for the auctionauctionDeadline
- the auction's deadline
SettleAuction
- emitted after an auction is settled. Contains:id
- the ID of the auction that was settled
DisableContract
- emitted after the contract is disabledTerminateAuctionPrematurely
- emitted after an auction is terminated before its deadline. Contains:id
- the ID of the auction that was terminatedsender
- the address that terminated the auctionhighBidder
- the auction's high bidderbidAmount
- the latest bid amount
3. Walkthrough
In a surplus auction, bidders compete for a fixed amountToSell
of system coins with increasing bidAmount
s of protocol tokens.
The surplus auction ends when the last bid's duration is passed (bidDuration
) without another bid getting placed or when the auction duration (totalAuctionLength
) has been surpassed. When the auction settles, the protocol tokens received are burnt in the case of a BurningSurplusAuctionHouse
or transferred to a separate address in the case of RecyclingSurplusAuctionHouse
.
In case governance disables the surplus auction house by calling disableContract
, anyone can call terminateAuctionPrematurely
in order to quickly settle an auction and return the protocol token bid to the highBidder
.
Last updated