Hey,
Iād like to track NFT-Sales on Opensea (in real-time if thats possible). I am new to blockchain development and having a hard time to get my head around whats happening here. As far as I know:
On Opensea once an offer is accepted the atomicMatch_ function gets called which as 2-3 internal transactions. Those vary depending on the NFT-Contract (at least I think so) - the only constant here is OrderMatched (from the Opensea Contract).
So I am listening to (sync) the OrderMatched Topic on the Opensea Contract. The catch here is that there is not actual reference to the NFT-Collection-Contract or token.
So my questions are:
1.) How do I monitor token transfers for a given Contract and store them into a Table/Class? I tried to add it to WatchedEthAddress but the data doesnāt show up in EthTokenTransfers as I would have hoped.
2) What would be the best approach to combine the OrdersMatched events with the actual Token-Info
Plus one bonus question: I do have an afterSave trigger on the OrderMatched event like so:
Moralis.Cloud.afterSave('OpenseaOrdersMatched', async (request) => {
const confirmed = request.object.get('confirmed')
if (!confirmed) {
return
}
const ntfTransaction = {
hash: request.object.get('transaction_hash'),
maker: request.object.get('maker'),
taker: request.object.get('taker'),
price: request.object.get('price'),
block_number: request.object.get('block_number'),
confirmed,
updatedAt: request.object.get('updatedAt'),
}
log.info('>' + JSON.stringify(ntfTransaction))
const nftTx = await new NFTTx(ntfTransaction)
nftTx.save()
})
And there are quiet a few records inserted every second - however the NFTTx Table has only a fraction of the OpenseaOrdersMatched records. Shouldnāt those numbers be the same?