Feature of the week: Instant peer-to-peer NFT auctions

Antonis Kazoulis
Tatum
Published in
3 min readSep 7, 2021

Plug the auction functionality into your NFT marketplace in a few clicks.

Ready to auction some NFTs? Going once, going twice…

In one of our latest posts, we showed you how to build a peer-to-peer NFT marketplace backend. Today, we pick up where we left off and talk about our latest feature that allows you to create auctions, enable bidding, allocate the auction’s winner the appropriate NFT, transfer funds to the seller, and settle the marketplace fee to the marketplace owner.

Giving your marketplace users the option to both purchase and bid on items can prove to be a deciding factor for its success. Not everyone is ready to buy NFTs from the jump, so giving them a flexible pricing option will only spark more interest. It’s an option that makes the marketplace more interactive and at the same time expands the NFT price range and customer reach.

As you can see, there’s a lot to unpack, so let’s get started. Also, be sure to check out our full guide for a more detailed rundown of the features.

Building the auction feature yourself? Think again.

Deciding to build the auction functionality into your NFT marketplace’s backend yourself would be a time-consuming, and laborious endeavor. There’s a lot that goes into this specific feature.

  • Expiration date
  • Bid status
  • Bid history
  • Price change notifications

The logic and implementation can prove to be a major undertaking for even the most experienced developers.

Tatum offers a plug ’n play auction feature

Our latest feature pack allows you to create a backend with auction functionality at the blockchain level without the headaches of building it from scratch. The new feature is supported on:

  • Binance Smart Chain
  • Harmony.ONE
  • Ethereum
  • Celo
  • Polygon (Matic)

Create an auction house

The first step is to create your own auction house smart contract. This is a one-time step, and the auction house you deploy will be used for every listing in your application going forward. In this example, we’ll deploy our auction house on the Polygon network.

Create an auction

Once the auction house contract is ready, you can enable auctions for your users. The seller must also approve the spending of the NFT asset to the auction house contract.

The seller can choose whether they are selling an ERC-721 or ERC-1155 token and whether they are selling it for ERC-20 tokens or for the native currency of the given blockchain (in our case MATIC).

To sell assets for ERC-20 tokens, a field labeled “erc20Address” must be present with the address of the ERC-20 smart contract of the given token. In order to spend the ERC-20 token at the auction, the auction smart contract must be given approval to spend using this API call.

Every auction must have a unique ID. This ID identifies the auction and is used for performing other operations.

The following API call will create a time-based NFT auction on your marketplace. You need to define the latest block in which the auction will accept bids.

Be sure to check out our full peer-to-peer NFT auction guide for more detailed explanations and additional features, including bidding for the auction, as well as settlement of the auction.

We’re pretty sure you’ll do just fine, but if you need any help or have any questions, feel free to jump onto our Discord channel or subreddit.

Happy coding!

--

--

Antonis Kazoulis
Tatum
Writer for

Writing content that engages the mind and captures the imagination.