IBatchAuctionHouse
Inherits: IAuctionHouse
An interface to define the BatchAuctionHouse's buyer-facing functions
Functions
bid
Bid on a lot in a batch auction
The implementing function must perform the following:
- Validate the bid
- Store the bid
- Transfer the amount of quote token from the bidder
function bid(
BidParams memory params_,
bytes calldata callbackData_
) external returns (uint64 bidId);
Parameters
Name | Type | Description |
---|---|---|
params_ | BidParams | Bid parameters |
callbackData_ | bytes | Custom data provided to the onBid callback |
Returns
Name | Type | Description |
---|---|---|
bidId | uint64 | Bid ID |
refundBid
Refund a bid on a lot in a batch auction
The implementing function must perform the following:
- Validate the bid
- Pass the request to the auction module to validate and update data
- Send the refund to the bidder
function refundBid(uint96 lotId_, uint64 bidId_, uint256 index_) external;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | Lot ID |
bidId_ | uint64 | Bid ID |
index_ | uint256 | Index of the bid in the auction's bid list |
claimBids
Claim bid payouts and/or refunds after a batch auction has settled
The implementing function must perform the following:
- Validate the lot ID
- Pass the request to the auction module to validate and update bid data
- Send the refund and/or payout to the bidders
function claimBids(uint96 lotId_, uint64[] calldata bidIds_) external;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | Lot ID |
bidIds_ | uint64[] | Bid IDs |
settle
Settle a batch auction
This function is used for versions with on-chain storage of bids and settlement
The implementing function must perform the following:
- Validate the lot
- Pass the request to the auction module to calculate winning bids
If settlement is completed:
- Send the proceeds (quote tokens) to the seller
- Execute the onSettle callback
- Refund any unused base tokens to the seller
- Allocate the curator fee (base tokens) to the curator
function settle(
uint96 lotId_,
uint256 num_,
bytes calldata callbackData_
) external returns (uint256 totalIn, uint256 totalOut, bool finished, bytes memory auctionOutput);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | Lot ID |
num_ | uint256 | Number of bids to settle in this pass (capped at the remaining number if more is provided) |
callbackData_ | bytes | Custom data provided to the onSettle callback |
Returns
Name | Type | Description |
---|---|---|
totalIn | uint256 | Total amount of quote tokens from bids that were filled |
totalOut | uint256 | Total amount of base tokens paid out to winning bids |
finished | bool | Boolean indicating if the settlement was completed |
auctionOutput | bytes | Custom data returned by the auction module |
abort
Abort a batch auction that cannot be settled, refunding the seller and allowing bidders to claim refunds
This function can be called by anyone. Care should be taken to ensure proper logic is in place to prevent calling when not desired.
The implementing function should handle the following:
- Validate the lot
- Pass the request to the auction module to update the lot data
- Refund the seller
function abort(uint96 lotId_) external;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
Structs
BidParams
Parameters used by the bid function
This reduces the number of variables in scope for the bid function
struct BidParams {
uint96 lotId;
address bidder;
address referrer;
uint256 amount;
bytes auctionData;
bytes permit2Data;
}
Properties
Name | Type | Description |
---|---|---|
lotId | uint96 | Lot ID |
bidder | address | Address to receive refunds and payouts (if not zero address) |
referrer | address | Address of referrer |
amount | uint256 | Amount of quoteToken to purchase with (in native decimals) |
auctionData | bytes | Custom data used by the auction module |
permit2Data | bytes |