- Notifications
You must be signed in to change notification settings - Fork386
-
Quick question - I noticed that when using get_price_input I get unexpected results for the token CHESS (BSC token). For example, when I run the code I get the following results -
However, when I check via the PancakeSwap website I get the following results
I'm not sure it's related to the code and could potentially be related to available liquidity. However I can't explain the difference between the get_price_input amounts and the PancakeSwap website. I've only so far noticed this with CHESS, other BSC tokens I've tested are within tolerance (e.g. get_price_input is typically the very close to the PancakeSwap website). Any insights appreciated. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments 1 reply
-
There's a difference between BNB (0x0) and WBNB (some address). In any case, the discrepancy is most likely due to the different routes (but check with a debugger). AFAIK the low level quote mechanism works as follows:
|
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I guess that it's because the quote is produced by doing token0->BNB->token1: |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hey Roman Thanks for taking the time to review and reply. I must admit my initial thought was something along those lines too, however that line of code is never executed. When using BSC, the self.get_weth_address() will actually resolve to WBNB and not weth, therefore the IF condition at L258 will be true and it will execute line 259 to get the token amount. Eiterhway, I don't think that routing would explain why this only seems to be a problem with CHESS (at least with to the extent that I've tested it). Thanks |
BetaWas this translation helpful?Give feedback.