beeb / pancaketrade

Limit orders for PancakeSwap
GNU General Public License v3.0
200 stars 92 forks source link

Different LPs on Pancake #39

Closed yocovn closed 2 years ago

yocovn commented 2 years ago

Hi, First of all, nice job on the bot. One question I have is: is it possible to support different LP on the pancake swap? (maybe a silly question) Also, I'm not very sure, but I think for example MTV/BNB and MTV/USDT are different LP for a single coin? (see screen)

Proposal: when you add a coin you can select which LP to use.

beeb commented 2 years ago

Hello,

Please refer to the release notes at https://github.com/beeb/pancaketrade/releases/tag/v0.6.0

Currently BNB and BUSD are automatically supported and the best price is used. Do you wish to support USDT too?

yocovn commented 2 years ago

Hi, Thanks for the reference. Yes, please Tether USD on Bep20 would be very useful. Because, for example for MTV coin has about $800 in MTV/BNB LP and around $145000 in MTV/USDT LP. So, for this coin makes no sense to use the MTV/BNB pool as it will drain if you sell ... Again, great work. (I'm using it in a docker, works perfectly)

beeb commented 2 years ago

Gotcha, I will add it to the develop branch and test for a while. Feel free to test as well, if you know the risks involved.

yocovn commented 2 years ago

Thanks. I will. Please let me know when you build an image, so I can pull from the docker artifactory.

beeb commented 2 years ago

Ok the develop branch has been updated, there is a new docker image for develop which includes USDT https://hub.docker.com/layers/vbersier/pancaketrade/develop/images/sha256-cc887a4b4482457810c8e1456f562d214fd90ea34a9b6186ada63e5c63da7a23?context=repo

yocovn commented 2 years ago

Will it take decision only based on the price? For example: MTV/BNB price: 0.024 per MTV (LP $800) MTV/USDT price: 0.023 per MTV (LP $140000)

So, if I would sell $1000 worth of MTV will that still go against the MTV/BNB LP assuming the price there is better?

If so, there may be a problem as the LP will not be enough.

I think there should be an option to select to which LP you want to buy/sell when you make a buy/sell order explicitly or automatic: select based on highest price.

beeb commented 2 years ago

Yes the price will be compared and the best path (that leads to the highest output) will be used. This price comparison takes into account the liquidity size (price impact) and pancakeswap fee, so it's not a problem that the liquidity is small.

If there is not enough liquidity in the BNB pool, the output amount will automatically be smaller than using the USDT pool (due to price impact/slippage), so the USDT pool will be used.

beeb commented 2 years ago

Example with MTV. The bot will compare the three paths and use the last because it has a higher output:

If you change the input amount, it could be that another path is more profitable. The bot will take this into account.

beeb commented 2 years ago

Closed via https://github.com/beeb/pancaketrade/commit/817c70626ac0bf3ff81cc326c367aa4b792be063