pancaketrade icon indicating copy to clipboard operation
pancaketrade copied to clipboard

Sell Order by USD Value

Open DigiTecK3D opened this issue 4 years ago • 5 comments
trafficstars

I've always thought that at times when I'm holding a coin instead of wanting it to hit a certain price point and then sell, it would be better to understand if the sum of the balance of the token hits a certain USD value and then it could sell. for example, you set a sell order for selling the token if it reaches a total USD value of $200 dollars or something. Thank you!

DigiTecK3D avatar May 29 '21 04:05 DigiTecK3D

Hi!

This is a tricky one, as looking a the balance during price checking would increase the number of requests.

Currently, only monitoring the price of the token in BNB already uses a few requests for each coin (due to pancakeswap v1 + v2 and price display in USD).

Adding on top of that a request for the balance would be an additional request for each token. I could use some caching to improve things, at the risk of having an outdated value if a sell happens. I don't like to use USD for conditions as it's dependent on the price of the BNB token which fluctuates. To me it only makes sense if the condition is set in BNB value of the total balance.

But my main concern is how to implement it in an elegant way to the order creation process without adding additional steps. The current conversation flow is already long for my taste and I do not wish to make it even longer.

Any proposal on how to ask the user about this would be welcome!

beeb avatar May 29 '21 05:05 beeb

Thank you for the explanation, it makes sense now even more since I was tonight giving the bot a first real try with setting up an order on a token to execute, as it stands maybe it's my lack of understanding but gauging on how to set a bnb value to sell is sort of confusing to me right now so I can totally understand under the hood to set up a USD sell value would be even more difficult. Thank you again for the consideration and explanation.

DigiTecK3D avatar May 30 '21 03:05 DigiTecK3D

Thank you so much for the detailed explanation, but the buy/sell with token pair with BUSD or USDT feature is quite a necessity :) , add more commands like /settings

hungtrungthinh avatar Dec 28 '21 06:12 hungtrungthinh

Thank you so much for the detailed explanation, but the buy/sell with token pair with BUSD or USDT feature is quite a necessity :) , add more commands like /settings

What you are describing (using usdt or BUSD pair for liquidity) is already implemented. The best price is automatically chosen. The order will always buy with BNB and sell to BNB but will perform "multihops" to get best price using available liquidity. What this issue refers to, is looking at the balance value to trigger an order.

beeb avatar Dec 28 '21 07:12 beeb

All is good now; the calculation will use BUSD or USDT instead of BNB. It's challenging when estimating value tokens when trading., we usually convert to fiat and stable coin price as pair for calc.

hungtrungthinh avatar Dec 28 '21 08:12 hungtrungthinh