You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
token mint address per dune: DriFtupJYLTosbwoN8koMbEYSx54aFAVLddWsbksjwg7
dune query showing incorrect token mint address:
fromtokens_solana.transfers t
wheret.block_date= cast('2024-07-21'asdate) -- date filter to improve performanceandt.tx_id='2tjLmmksKz636jKacMoNnGKTvUdBCSWsUtzuswGskXae8PNa9Gr1Qb2XZdRtK5ne4BR7oB8mryV2RN6t8bqiULCP'
token mint address per dune: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
dune query showing incorrect token mint address:
select*fromtokens_solana.transfers t
wheret.block_date= cast('2024-04-15'asdate) -- date filter to improve performanceandt.tx_id='47JfrTa9NaPQJmzQM1sJ8JcUbsSDAycjuABV1GxT3bZNQesQSNamtEWWyKFYt81SvEqP9gkvgEyw1KNGaxHsteLk'
Query to retrieve negative balances
here is a dune query showing all negative balances for the MNDE solana token, you can remove the token filter in the first CTE to assess all tokens
-- filtering to only a set of tokens to improve performance-- you can remove this to see the results for all tokens
with transfers_filtered as (
select*fromtokens_solana.transfers t
wheret.token_mint_addressin (
'MNDEFzGvMt87ueuHvVU9VcTqsAP5b3fTGPsHuuPA5ey'
)
),
-- aggregate wallet-level transfers by counting transfers in as positive and transfers out as negative
wallet_transfers as (
select'solana'as chain
,t.block_time
,t.from_token_accountas wallet_address
,-t.amountas transfer_amount
,token_mint_address
from transfers_filtered t
union allselect'solana'as chain
,t.block_time
,t.to_token_accountas wallet_address
,t.amountas transfer_amount
,token_mint_address
from transfers_filtered t
),
-- calculate wallet balances by summing net transfers over time for each wallet
wallet_balances as (
select chain
,block_time
,wallet_address
,token_mint_address
,transfer_amount
,sum(transfer_amount) over (partition by chain,wallet_address,token_mint_address order by block_time asc) as balance
from wallet_transfers
)
select chain
,token_mint_address
,wallet_address
,min(balance) as lowest_balance
from wallet_balances
-- filter to balances below -1 rather than 0 to filter any rounding errorswhere balance <-1group by1,2,3order by1,2,4desc
Description
token_mint_address in tokens_solana.transfers is different on solscan .
some examples in the discord thread https://discord.com/channels/757637422384283659/1281025587405787177/1282371830186774651
Current behavior
token_mint_address showing a different address
Expected behavior
addresses should match with solana explorers
Impacted model(s)
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/solana/models/tokens/solana/tokens_solana_transfers.sql#L66
Possible solution
havnt thought of a solution yet, just creating this issue to track
The text was updated successfully, but these errors were encountered: