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
First issue: const amount = tokenDetails[0].uiTokenAmount.uiAmount;
This doesn't work on some type of swap transaction, 1. transactions that uses jupiter swap api, 2. transactions that interact multiple dex liquidity pools.
Second issue: You are getting the pool price from dexscreener while it's not exactly the entry/exit price of the trader, you could calculate the exact entry/exit price using this formula, (post number of sol in pool / post number of token in pool), using the data.transaction.transaction.meta.postTokenBalances.
hope this helps!
The text was updated successfully, but these errors were encountered:
First issue: const amount = tokenDetails[0].uiTokenAmount.uiAmount;
This doesn't work on some type of swap transaction, 1. transactions that uses jupiter swap api, 2. transactions that interact multiple dex liquidity pools.
Second issue: You are getting the pool price from dexscreener while it's not exactly the entry/exit price of the trader, you could calculate the exact entry/exit price using this formula, (post number of sol in pool / post number of token in pool), using the data.transaction.transaction.meta.postTokenBalances.
hope this helps!
The text was updated successfully, but these errors were encountered: