Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vNFT: Auctions description #2610

Closed
iorveth opened this issue Sep 2, 2021 · 0 comments
Closed

vNFT: Auctions description #2610

iorveth opened this issue Sep 2, 2021 · 0 comments
Labels

Comments

@iorveth
Copy link
Contributor

iorveth commented Sep 2, 2021

Auction

Runtime representation

/// Information on the auction being created.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
pub struct AuctionRecord<BlockNumber: BaseArithmetic + Copy, Balance, MemberId: Ord> {
    pub starting_price: Balance,
    pub buy_now_price: Option<Balance>,
    /// Auction type (either english or open)
    pub auction_type: AuctionType<BlockNumber>,
    pub minimal_bid_step: Balance,
    pub last_bid: Option<Bid<MemberId, BlockNumber, Balance>>,
    pub starts_at: Option<BlockNumber>,
    pub whitelist: Option<BTreeSet<MemberId>>,
}

starting_price - a minimal price required for the first bid.

buy_now_price - price at what auction can be finished instantly. (optional)

auction_type - enum variant, representing different auction types, available to chose from.

minimal_bid_step - minimum delta between the next and previous bids.

last_bid - last bid details.

starts_at - block height, which is used to define a block at which auction begin to accept bids.

whitelist - a parameter, which constraints auction participant members to a given set (if set).

AuctionType

There are 2 types of auctions currently present in our system

/// Auction type
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
pub enum AuctionType<BlockNumber> {
    // Auction round duration
    English(BlockNumber),
    // Bid lock duration
    Open(BlockNumber),
}

English Auction:

  1. Has a fixed round_time, set during auction initialization.
  2. Each accepted bid resets auction round time to the baseline.
  3. Auction completes either after the round_time expiration or at buy_now_price.

Open auction:

  1. Each bid is locked for a fixed time interval, called bid lock duration.
  2. After bid lock expires, bidder can unlock/revert his bid.
  3. Auction completes either when auctioneer decides to "accept" a bid when he feels okay or at buy_now_price.

Auction Mode

/// Either new auction, which requires vNFT issance or auction for already existing nft.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
pub enum AuctionMode {
    // Auction, where nft issued at the end
    WithIssuance(Metadata),
    // Auction for already existing nft
    WithoutIsuance,
}

Auction Mode is used to say whether we ran auction for the first time or it is an auction for already existing nft.
In case of the latter one, we also need to provide Metadata, which would be raised in the event during the nft issuance.

Initial vnft auction description and requirements for English auction can be found here #2481

@iorveth iorveth added the runtime label Sep 3, 2021
@iorveth iorveth changed the title VNFT auctions description vNFT: Auctions description Sep 3, 2021
@bedeho bedeho closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants