Concepts
Gain an understanding of how the social cycle works to effectively implement the SDK.
Index
Post lifecycle
In order to use the social features of the platform, it is necessary to understand the mechanisms behind it. The concept of Post was born with the intention of creating a safe way for users to declare their trading intentions without directly exposing their assets, perhaps through interaction with a smart contract.
The concept of Post was created to enhance the functionalities of web2 and better adapt them to the web3 context. The developer will therefore be provided with a series of functionalities through the SDK that will allow them to create Posts that will contain, in terms of information, the assets that the user wants to trade or the collections they are interested in.
The idea of the Post also aims to reduce the likelihood of scams that users face when using web2 platforms such as Twitter or Discord. Users are often tricked because they do not know exactly what assets their counterpart possesses, or they are lured into phantom websites that promise to be trustless when in fact they are not. The Post solves this problem, as it provides the possibility to interact with a web2 approach, but at the same time can only be completed if the user actually owns those assets.
The Post is used as a tool to accompany the TradingClient's capabilities. In this way, the user can interact on multiple levels (web2 for the creation of the Post and web3 for the creation of the Trade) safely, without compromising their assets.
Let's take a closer look at what it means to create a Post at the NFT Trader system level.
Status of a Post
The Post can have different types of status, depending on the interaction phase the user has taken towards a single post. The statuses can be the following:
Active
Reserved
Completed
Canceled
Expired
When a Post is Active, users are able to interact with it and make offers. These offers are defined as PostReply
. The original author of the Post will be able to evaluate which offer is most suitable and therefore accept the one that best fits their needs. To assist the user in this phase, each PostReply carries with it a piece of information called a score, which helps the user understand if what has been offered is a perfect match with their needs or something different.
When the author of the Post accepts a PostReply, through the interaction with the chain made possible by the TradingClient class, the status of the post changes to Reserved and therefore communicates to the user who created the PostReply their intention to proceed with the trade. At this point, the counterparty of the trade (the creator of the PostReply) will be able to close the transaction and therefore trigger the change of status from Reserved to Completed.
If for some reason the original author of the Post were to delete it while it is still potentially active, the status will become Canceled. Similarly, if the original author's Post exceeds the expected time limit, the Post status would change to Expired.
Types of Posts
Posts can be of different types, mainly depending on how the user has decided to compose it according to their needs. There are different possible combinations of Posts and each one has different characteristics that affect the calculation of the score of a PostReply.
The types of Posts can be summarized in the following list (below are the identifying codes):
As at first glance the codes do not provide a clear information, let's see the meaning of each of them.
A1 - I'm looking for.. specific NFT Collections or Token / I will offer only NFTs i choose
The A1 Post type describes a situation in which the author of the Post is looking for NFTs from specific collections or specific tokens. Therefore, the author is exclusively looking for those types of assets that they will specify, and any variation offered by the counterparty will result in a different
score. In addition to searching for specific assets, the author also declares their intention to offer the NFTs they will choose from their own wallet in exchange.
A2 - I'm looking for.. specific NFT Collections or Token / I'm open to proposal
The A2 Post type describes a situation in which the author of the Post is looking for NFTs from specific collections or specific tokens. The author is therefore exclusively looking for those types of assets that they will specify, and any variation offered by the counterpart will result in a different
score. In addition to searching for specific assets, the author declares the intention of letting the counterpart select one or more NFTs from their own wallet.
B1 - I'm looking for.. I've preferences but i'm flexible / I will offer only NFTs i choose
The Post type B1 describes a situation in which the author of the post is looking for specific NFTs from certain collections, but any variation offered by the counterparty is not a problem. The same principle applies to tokens, which can vary depending on the counterparty's will. However, the author declares that in exchange, they will only give the counterparty the NFTs selected from their own wallet.
B2 - I'm looking for.. I've preferences but i'm flexible / I'm open to proposal
The B2 Post type describes a situation in which the author of the Post is looking for NFTs from specific collections, but any variation offered by the counterparty is not a problem. The same principle applies to tokens, which can vary depending on the counterparty's preferences. In addition, the author declares that in exchange, they will transfer the NFTs selected by the counterparty from their own wallet.
C1 - I'm open to proposal / I will offer only NFTs i choose
The Post type C1 describes a situation in which the author of the Post wants to receive offers of any kind that include NFTs from any collection or any type of token. However, in exchange, the author will only offer the NFTs selected by him from his own wallet to the counterparty.
R1 - Post Reply
The R1 Post type instead describes a PostReply.
Post Assets
One of the main concepts of a Post is related to the assets that the user seeks and offers when interacting with the platform. Since there are numerous scenarios, there is a need to simplify the possible combinations that the user could use when creating a Post. This coding allows understanding what types of assets have been used and the Post type.
Below, we will delve into the main concepts related to asset coding. Assets can be categorized in two ways - assets wanted and assets offered. We can visualize this principle by creating a map, which helps us understand the various scenarios and how they may determine the type of Post that a user could create.
Post Score
Another basic concept related to the Post and in particular to the PostReply is the so-called score. When the author of the Post receives offers related to the assets specified by him, each response is evaluated according to the type of Post selected by the author. The score is a parameter that serves as an indicator to help the author of the Post accept the most suitable offer. For example, if a user tried to offer a NFT clone of a Bored Ape Yacht Club, which is clearly not from the original collection, the score calculation would be different and not a perfect match, as the author of the Post specified during creation that he wants to receive offers that only include NFTs from the original collection. This is a tool that allows reducing scams, as the score is clear information about what offer is parameterized to meet the original author's needs.
The score mainly assumes two values as specified in the following list:
Perfect Match
Different
Perfect Match indicates a perfect match between the offer proposed by the counterparty and the Post created by the maker.
Different, on the contrary, indicates a poor correspondence between the offer proposed by the counterparty and the Post created by the maker.
Last updated