-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP T 16269 broken erc721 balances tables #1525
Conversation
This pull request has been linked to 1 task:
|
@soispoke, I fixed some grouping and partitioning issues I found. (see PR mentioned above) |
* fix ERC721 balances * revert column refs in schemas
…b.com/duneanalytics/spellbook into T-16269-broken-erc721-balances-tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, this should make sure that every NFT (combination of address and id) only exists once in the balances table for any given day or hour.
thanks @0xBoxer |
I found a edge case where the script goes wrong: https://dune.com/queries/1079379 https://etherscan.io/token/0xc7457f480416e145093edb355f626faa0fc7f90e?a=2116 This is a weird contract that minted a token_id twice. The second minter is the correct one and sells his NFT a few minutes after minting, this tx is completely missing from our results. Therefore, in the period between 01/05 to 20/05 this token has wrong owner data. This finding makes me question what usually happens in the script if a token gets traded multiple times within a day, because that seems to be what's going wrong here. |
@0xBoxer Good catch! We could update the query to include the deduplication and favour the entry which had the last incoming transfer. Another option might be to provide ordered output if that guarantees us the deduplication by the merge will choose the correct owner. (Will need to look into spark/databricks docs to confirm) |
Brief comments on the purpose of your changes:
This PR aims to improve/fix erc721 balances on ethereum.
Changes have been added (mainly fix the sign for amounts, and the send/receive fields + some improved incremental filters), but there are still issues with duplicate owners that need to be addressed, see https://dune.com/queries/1246260
The test was also changed (and is currently failing), so that wallet address is not part of it (therefore, it is now actually testing for unique owners)
@hildobby @0xRobin @aalan3
For Dune Engine V2
I've checked that:
General checks:
lowercase_snake_cased
Join logic:
Incremental logic: