FlipsideCrypto / near-models

Data models for the NEAR blockchain, originally built by the MetricsDAO community.
https://flipsidecrypto.github.io/near-models/
MIT License
15 stars 12 forks source link

Table: ez NFT Sales #91

Closed forgxyz closed 1 year ago

forgxyz commented 2 years ago

A NFT Sales table should parse transactions, actions, and receipts for the sale and transfer of NFTs and include the following curated data in a core ez_ view:

TODO:

geewynn commented 2 years ago

While exploring the data, i was able map some columns on the tx table to some columns on the schema above.

buyer - receiver_id seller - tx-signer/sender-id price - amount tx status - tx_status platform - tx_receiver nft address - tx_receiver

Question

platform - tx_receiver. what is the platform here? is this the nft project? currency - not sure about this network fee - what is the network fee? is this same as the transaction fee? nft address - I am assuming this is the nft contract address which is same as the tx_receiver. nft project, if available - same as above nft id, if available - not available platform fee or royalty, if available - not sure about this . platform contract and/or version, if available - not sure about this .

forgxyz commented 2 years ago

platform - tx_receiver. what is the platform here? is this the nft project?
Paras is a large NFT platform on NEAR, for example. Is there some contract interaction in actions or receipts that tell us this? Unsure of other NFT platforms, just an example.

currency - not sure about this
We should be able to determine from the token transfer - is it always NEAR, or do they use USN, or another token?

network fee - what is the network fee? is this same as the transaction fee?
Yes, transaction fee / gas.

nft project, if available - same as above
The name of the collection, looking at Paras for an example: https://paras.id/collection/nearnautnft.near This would be NEARNauts. Contract name nearnautnft.near is ok to list here.

nft address - I am assuming this is the nft contract address which is same as the tx_receiver.
nft id, if available - not available
Unsure about tx_receiver but yes, the contract address for the NFT itself. Lumping these together because I am unsure how NFTs are represented on chain. Using above example, NEARNauts is a collection. Is NEARNaut 1000 represented as a token / contract address? If so, that would be added to the nft address column. If we can determine it is 1000, or if it has a separate on-chain ID of some sort, that is nft id.

platform fee or royalty, if available - not sure about this .
Does Paras collect a royalty? Does the collection owner? If determinable, we can include. If not, that's fine.

platform contract and/or version, if available - not sure about this . Has Paras, or another marketplace, gone from v1 to v2, for example, and do we need to account for any transaction structure changes?

geewynn commented 2 years ago

Paras is a large NFT platform on NEAR, for example. Is there some contract interaction in actions or receipts that tell us this? Unsure of other NFT platforms, just an example.

Yes, the tx-receiver shows the interaction with the nft platform. image

We should be able to determine from the token transfer - is it always NEAR, or do they use USN, or another token?

From what i see in the receipt logs, the currency is a little bit hard to determine, for example in the logs in the below image. I am inclined to say the currency here is the nft platform image

nft address - I am assuming this is the nft contract address which is same as the tx_receiver. nft id, if available - not available Unsure about tx_receiver but yes, the contract address for the NFT itself. Lumping these together because I am unsure how NFTs are represented on chain. Using above example, NEARNauts is a collection. Is NEARNaut 1000 represented as a token / contract address? If so, that would be added to the nft address column. If we can determine it is 1000, or if it has a separate on-chain ID of some sort, that is nft id.

they are represented with the tokenId, this means we can go with the nftId(tokenId) image

The name of the collection, looking at Paras for an example: https://paras.id/collection/nearnautnft.near This would be NEARNauts. Contract name nearnautnft.near is ok to list here.

I am not sure this is available in the tx data.

Has Paras, or another marketplace, gone from v1 to v2, for example, and do we need to account for any transaction structure changes? This too, looks interesting, will poke around more if i can find anything relating to the nft platform.

forgxyz commented 2 years ago

Ok, I think you are on the right track with the schema and the information we can pull out of the transactions @geewynn

Also - Query that should assist with the ez table: https://app.flipsidecrypto.com/velocity/queries/b4781971-7539-41ef-9c1e-4af08afb79de