Auctioneer
The auctioneer handles collateral auctions for liquidated debt
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
.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. |
Property | Type | Description |
---|---|---|
price | uint256 | The price of the bid |
lot | uint256 | The lot size of the bid |
function
totalAuctions()
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.
function
startAuction(
bytes32
collId,
uint256
lotSize,
uint256
debtSize,
address
owner,
address
beneficiary,
bool
sellAllLot)
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
function
resetAuction(
uint256
auctionId)
Auctions can be reset if there is still asset to be sold and price function has reached zero.
function
placeBid(
uint256
auctionId,
uint256
bidPrice,
uint256
bidLot)
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.There are enough stablecoin in Vault Engine for user to cover the
bidPrice * bidLot
- 2.BiddableLot at
bidPrice
is non zero
Note: User can currently place only one bid. User should either modify or cancel bid if needed.
function
buyItNow(
uint256
auctionId,
uint256
maxPrice,
uint256
lot)
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.
function
finalizeSale(
uint256
auctionId)
User who has placed a bid should call this function after the current price has dropped below the bid price to claim the asset.
function
getBiddableLot(
uint256
auctionId,
uint256
bidPrice,
uint256
bidLot)
Return the amount of lot that can be bid at the
bidPrice
.
function
calculatePrice(
uint256
auctionId)
Return the calculated current price for the auction.
function
cancelAuction(
uint256
auctionId,
address
recipient)
Only callable by probity
Cancel the active auction and move the asset to the
recipient
function
totalBidValueAtPrice(
uint256
auctionId,
uint256
cutoffPrice)
Cumulative Bid values at
cutoffPrice
, this is used to determine how much lot can be bid at cutOffPrice
function
endAuction(
uint256
auctionId)
Ends the auction if it is done.
Last modified 7mo ago