Skip to main content

IBatchAuctionHouse

Git Source

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:

  1. Validate the bid
  2. Store the bid
  3. Transfer the amount of quote token from the bidder
function bid(
BidParams memory params_,
bytes calldata callbackData_
) external returns (uint64 bidId);

Parameters

NameTypeDescription
params_BidParamsBid parameters
callbackData_bytesCustom data provided to the onBid callback

Returns

NameTypeDescription
bidIduint64Bid ID

refundBid

Refund a bid on a lot in a batch auction

The implementing function must perform the following:

  1. Validate the bid
  2. Pass the request to the auction module to validate and update data
  3. Send the refund to the bidder
function refundBid(uint96 lotId_, uint64 bidId_, uint256 index_) external;

Parameters

NameTypeDescription
lotId_uint96Lot ID
bidId_uint64Bid ID
index_uint256Index 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:

  1. Validate the lot ID
  2. Pass the request to the auction module to validate and update bid data
  3. Send the refund and/or payout to the bidders
function claimBids(uint96 lotId_, uint64[] calldata bidIds_) external;

Parameters

NameTypeDescription
lotId_uint96Lot 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:

  1. Validate the lot
  2. Pass the request to the auction module to calculate winning bids

If settlement is completed:

  1. Send the proceeds (quote tokens) to the seller
  2. Execute the onSettle callback
  3. Refund any unused base tokens to the seller
  4. 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

NameTypeDescription
lotId_uint96Lot ID
num_uint256Number of bids to settle in this pass (capped at the remaining number if more is provided)
callbackData_bytesCustom data provided to the onSettle callback

Returns

NameTypeDescription
totalInuint256Total amount of quote tokens from bids that were filled
totalOutuint256Total amount of base tokens paid out to winning bids
finishedboolBoolean indicating if the settlement was completed
auctionOutputbytesCustom 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:

  1. Validate the lot
  2. Pass the request to the auction module to update the lot data
  3. Refund the seller
function abort(uint96 lotId_) external;

Parameters

NameTypeDescription
lotId_uint96The 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

NameTypeDescription
lotIduint96Lot ID
bidderaddressAddress to receive refunds and payouts (if not zero address)
referreraddressAddress of referrer
amountuint256Amount of quoteToken to purchase with (in native decimals)
auctionDatabytesCustom data used by the auction module
permit2Databytes