Design Core Data Structures


Key Considerations for Data Organization

When designing the data structure for our NFT marketplace, we must consider how to autonomously manage listings and transactions. It's essential to store critical information such as price, seller details, and token addresses on-chain to facilitate this process.

We should consider few important points when organizing and managing data structure for listing and trading tokens:

1. Storing Multiple Listings per Seller

Sellers should be able to create multiple listings for different tokens. For instance, Alice might list multiple Aptogotchi tokens, each with its own unique listing information.

This requires a data structure that supports multiple instances of the same type, related to a single seller.

2. Managing the Lifecycle of Listings

Listings have a lifecycle that ends with the sale of the token.

Post-purchase, it's crucial to efficiently clean up and remove the listing data to maintain the integrity of the marketplace.


Utilizing Objects for Data Storage

  • To overcome the limitation of storing only one instance of a resource per account, we'll store listing data as Objects.
  • This approach not only allows for multiple listings per seller but also aligns with our use of the Object model for implementing digital asset standards.


More Resources

The object standard can be found here.

Link