Trustline
Probity
Search
K
Comment on page

Auctioneer

The auctioneer handles collateral auctions for liquidated debt

Concept

Auctioneer is an auction system for liquidated collateral. Liquidator starts an auction when an undercollateralized debt position is liquidated. When the auction first started, the start price is set at above the market price by X% (currently set at 120%). Auction utilizes a priceCalc function contract, that will calculate the price based on some price function that will typically decrease the price over time based on time or volume. (Note: currently, only linear decrease price function is available).
There are two ways a user can purchase the asset, through bids or buyItNow, users are allow to buy partial lot.
bids provides users with the right to buy the asset at the bid price when the current price drops below the bid. Some bids maybe cancelled if other user either bids higher (must be higher by a certain percentage (3%) to be a valid bid) or other user decided to use buyItNow
buyItNow allow the user to purchase the the asset at the current price that is calculated by the priceCalc .

Data Structures

Auction

Property
Type
Description
assetId
bytes32
The collateral ID as bytes
lot
uint256
The amount of asset in the lot
debt
uint256
The target amount for the auction to raise
owner
address
Address of the liquidated vault. Left over collateral will go back to this owner.
beneficiary
address
The stablecoins raised in the auction goes to this address.
startPrice
uint256
The initial starting price for the auction. Decreases over time.
startTime
uint256
Time when the auction started in seconds.
sellAllLot
bool
If true, keep auction going until all the lots are sold
isOver
bool
Indicates whether the auction is active or not.

Bid

Property
Type
Description
price
uint256
The price of the bid
lot
uint256
The lot size of the bid

Methods

Public

functiontotalAuctions() returns(uint256 totalAuctions)
Returns the number of total auction
function nextBidRatio() returns(uint256 nextBidRatio)
The smallest increment for a new bid, relative to the high bid. Currently set to 5%.
function priceBuffer() returns(uint256 nextBidRatio)
The initial premium on the collateral asset's starting price.

External

functionstartAuction(bytes32collId,uint256lotSize,uint256debtSize, addressowner,addressbeneficiary, boolsellAllLot)
Only callable by Liquidator.
Creates an auction for the liquidated collateral. lotSize is the amount of collateral in the auction. debtSize is the amount of stablecoins that needs to be raised in the auction to fully cover the gap. The beneficiary is a ReservePool address. owner is the recipient of the asset if there are any asset left over when the debtSize is reached. If sellAllLot is set to true, all the lot will be sold regardless of the debtSize

functionresetAuction(uint256auctionId)
Auctions can be reset if there is still asset to be sold and price function has reached zero.

functionplaceBid(uint256auctionId,uint256bidPrice,uint256bidLot)
Places a bid on a live collateral auction. If the price of the auction drops at or below the bidPrice , user will be able to call finalizeSale to complete the sale.
You can only place a bid if
  1. 1.
    There are enough stablecoin in Vault Engine for user to cover the bidPrice * bidLot
  2. 2.
    BiddableLot at bidPrice is non zero
Note: User can currently place only one bid. User should either modify or cancel bid if needed.
functionbuyItNow(uint256auctionId,uint256maxPrice,uint256lot)
Purchases the collateral outright at current price. Use maxPrice to ensure that the sale only takes place if current price is lower than max price.
functionfinalizeSale(uint256auctionId)
User who has placed a bid should call this function after the current price has dropped below the bid price to claim the asset.
functiongetBiddableLot(uint256auctionId,uint256bidPrice,uint256bidLot)
Return the amount of lot that can be bid at the bidPrice.
functioncalculatePrice(uint256auctionId)
Return the calculated current price for the auction.
functioncancelAuction(uint256auctionId,addressrecipient)
Only callable by probity
Cancel the active auction and move the asset to the recipient
functiontotalBidValueAtPrice(uint256auctionId,uint256cutoffPrice)
Cumulative Bid values at cutoffPrice , this is used to determine how much lot can be bid at cutOffPrice

Internal

endAuction

functionendAuction(uint256auctionId)
Ends the auction if it is done.