rckprtr / pumpdotfun-sdk

PumpDotFun SDK
MIT License
176 stars 75 forks source link

Account data anomaly #35

Open winktool opened 1 month ago

winktool commented 1 month ago
BondingCurveAccount {
  discriminator: 6966180631402821399n,
  virtualTokenReserves: 1057999999750065n,
  virtualSolReserves: 30425330823n,
  realTokenReserves: 778099999750065n,
  realSolReserves: 425330823n,
  tokenTotalSupply: 1000000000000000n,
  complete: false
}

Sometimes, when you continuously request the data from the bondingCurveAccount, the returned data is abnormal, causing the price calculation to fail. Why does this happen? For example, in this case, there is an obvious anomaly in realSolReserves.

rckprtr commented 1 month ago

Hmm first glance I dont see whats wrong, looks like there is 0.4 SOL in the real sol reserves? What am I missing?

winktool commented 1 month ago

realSolReserves should actually have a value much higher than 425330823n, this happens by accident, the next request is back to normal!

matotubol commented 1 month ago

Why dont you use virtualSolReserves instead, never had problem calculating the price that way. Also i think the real sol reserves are right, pumpfun adds 30 sol to the liquidity, i dont think they add that to the real sol reserves?