IAtomicAuction
Inherits: IAuction
Interface for atomic auctions
The implementing contract should define the following additional areas:
- Any un-implemented functions
- State variables for storage and configuration
Functions
purchase
Purchase tokens from an auction lot
The implementing function should handle the following:
- Validate the purchase parameters
- Store the purchase data
function purchase(
uint96 lotId_,
uint256 amount_,
bytes calldata auctionData_
) external returns (uint256 payout, bytes memory auctionOutput);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
amount_ | uint256 | The amount of quote tokens to purchase |
auctionData_ | bytes | The auction-specific data |
Returns
Name | Type | Description |
---|---|---|
payout | uint256 | The amount of payout tokens to receive |
auctionOutput | bytes | The auction-specific output |
payoutFor
Returns the payout for a given lot and amount
function payoutFor(uint96 lotId_, uint256 amount_) external view returns (uint256 payout);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | ID of the auction lot |
amount_ | uint256 | Amount of quoteToken to purchase with (in native decimals) |
Returns
Name | Type | Description |
---|---|---|
payout | uint256 | Amount of baseToken (in native decimals) to be received by the buyer |
priceFor
Returns the price for a given lot and payout
function priceFor(uint96 lotId_, uint256 payout_) external view returns (uint256 price);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | ID of the auction lot |
payout_ | uint256 | Amount of baseToken (in native decimals) to be received by the buyer |
Returns
Name | Type | Description |
---|---|---|
price | uint256 | The purchase price in terms of the quote token |
maxPayout
Returns the max payout for a given lot
function maxPayout(uint96 lotId_) external view returns (uint256 payout);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | ID of the auction lot |
Returns
Name | Type | Description |
---|---|---|
payout | uint256 | The maximum amount of baseToken (in native decimals) that can be received by the buyer |
maxAmountAccepted
Returns the max amount accepted for a given lot
function maxAmountAccepted(uint96 lotId_) external view returns (uint256 maxAmount);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | ID of the auction lot |
Returns
Name | Type | Description |
---|---|---|
maxAmount | uint256 | The maximum amount of quoteToken (in native decimals) that can be accepted by the auction |