NFT Sales listing as Transfers

As we test our app, we’re running into a lot of NFT sales that are not being properly processed by moralis, and showing up as transfers instead of sales.

One example:
https://etherscan.io/tx/0x391a8fba57266d5015827cd778b39fa5c1432d73331871f616bd8c3b80ffb35a

Shows in the moralis api response as:

    {
      "block_number": "14333915",
      "block_timestamp": "2022-03-06T14:36:41.000Z",
      "block_hash": "0xdf50fcc46ffd285be6290ff44abc6aab5a88982bd19bba51ddfc9891118b3b45",
      "transaction_hash": "0x391a8fba57266d5015827cd778b39fa5c1432d73331871f616bd8c3b80ffb35a",
      "transaction_index": 153,
      "log_index": 226,
      "value": "0",
      "contract_type": "ERC721",
      "transaction_type": "Single",
      "token_address": "0xccc441ac31f02cd96c153db6fd5fe0a2f4e6a68d",
      "token_id": "7761",
      "from_address": "0xe3e182bc39951f99af86d8cd0c42a4b7c4cd93f7",
      "to_address": "0x451a535dd5703629239c4d0b5571a90f5a18f39c",
      "amount": "1",
      "verified": 1,
      "operator": null
    },
1 Like

it looks like I found that sale too:

https://deep-index.moralis.io/api/v2/nft/0xCcc441ac31f02cD96C153DB6fd5Fe0a2F4e6A68d/trades?chain=eth&from_block=14333915&to_block=14333915&marketplace=opensea

=>

"total": 1,
  "page": 0,
  "page_size": 1,
  "result": [
    {
      "transaction_hash": "0x391a8fba57266d5015827cd778b39fa5c1432d73331871f616bd8c3b80ffb35a",
      "transaction_index": "153",
      "token_ids": [
        "7761"
      ],
      "seller_address": "0xe3e182bc39951f99af86d8cd0c42a4b7c4cd93f7",
      "buyer_address": "0x451a535dd5703629239c4d0b5571a90f5a18f39c",
      "token_address": "0xccc441ac31f02cd96c153db6fd5fe0a2f4e6a68d",
      "marketplace_address": "0x7be8076f4ea4a4ad08075c2508e481d6c946d12b",
      "price": "2810000000000000000",
      "price_token_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "block_timestamp": "2022-03-06T14:36:41.000Z",
      "block_number": "14333915",
      "block_hash": "0xdf50fcc46ffd285be6290ff44abc6aab5a88982bd19bba51ddfc9891118b3b45"
    }
  ]
}

That looks correct, but when viewing the block, it’s incorrect.

See:
https://deep-index.moralis.io/api/v2/block/14333915/nft/transfers?chain=eth&limit=500

what you mean by being wrong in the block? the block has only the transfers, and a sell includes a transfer

the block often shows the sale (has a value in the “value” field)

Are you saying that I need to run another query for each transaction in order to get the sale data?

that may be the case (that you may need to run another query), if the sell included an erc20 token, then the data will not be in the original transfer info that you find in block transfers