raydium-io / raydium-sdk-V1-demo

119 stars 55 forks source link

Bigger numbers not getting out of bounds during calcMarketStartPrice #18

Closed palinko91 closed 5 months ago

palinko91 commented 5 months ago

Bigger numbers for baseAmount = 10000000000000000000 not going to work, because the .toNumber() will error out.

Minimal example to reproduce the error: new BN("10000000000000000000").toNumber()

So it's better to keep dividing while in BN type and only convert to number when it's much lower quantity.

rudy5348 commented 5 months ago

Since the previous demo did not clarify the meaning of 6 in division, I have updated the demo.
Thank you very much for your advice.