dashed-slug.net › Forums › Exchange extension support › Displaying maximum available amount of coins to buy with
Tagged: frontend, limit order, market-order, max, max button, Maximum, UI
- This topic has 3 replies, 2 voices, and was last updated 3 years, 7 months ago by alexg.
-
AuthorPosts
-
May 11, 2021 at 9:59 am #10527LeinAdParticipant
is there an “easy” way to display the available number of coins to buy with? in this example it should say btc above
Attachments:
You must be logged in to view attached files.May 12, 2021 at 9:15 am #10532alexgKeymasterHello,
Unfortunately no, there is no easy way to display the maximum number of base currency that can be spent in a limit order, without knowing the price for the order. Note that the available BTC balance is not necessarily the amount you want to display.
Consider this: In your example, the maximum amount of BTC that you can spend to buy DOGE is determined by two things:
1. Your available BTC balance.
2. The orderbook depth.
Once you choose a price and an amount of DOGE to buy, then the UI can calculate how much BTC you can spend.
Fortunately, the functionality you want is already there, but you don’t see it because you are using a modified template.
If you use the built-in template for limit orders, you get a “Max” button in both limit orders and market orders. With limit orders, the button appears when the user selects a price, whereas in market orders, the “Max” button is always available.
For limit orders, the “Max” button will set the maximum amount of DOGE that you can buy given the current user’s available balance, the current user price, AND the orderbook depth. In more detail:
1. The user sets a price that they want to buy in
2. Once the price is known, the “Max” button appears. This takes into account the available BTC balance (i.e. not locked in existing trades or pending transactions), AND the market depth, i.e. liquidity.
3. Once the user clicks on the “Max” button, the “Total” field shows how much BTC is going to be spent, at that price. You get two amounts because there is a best-case and a worst-case scenario, depending on whether maker or taker fees will be charged at the time of execution.
The same “Max” button is available for market orders, where there is no “Price field”. The only difference is this: with market orders, the “Max” button is always available. The UI can calculate exactly what will happen if you buy or sell the available amount. This is because market orders always incur the “taker” fees, so there is only one possible execution at the time of order placement, given the orderbook.
In both cases, the user will be able to see exactly in the “Total” field how much BTC can be spent on a DOGE buy, before placing the order.
So, in conclusion, revert to the built-in templates and you will get the functionality.
Hope this helps.
with regards
May 12, 2021 at 1:28 pm #10534LeinAdParticipant[wallets_exchange_limit_buy]
an user asked me to make it similar to attached file:
Attachments:
You must be logged in to view attached files.May 13, 2021 at 6:46 am #10537alexgKeymasterOK, but unfortunately I no longer accept new feature requests for users, as I am too busy with the next iteration of the plugins.
Plus, I do not plan to change the exchange UIs in the near future.
with regards
-
AuthorPosts
- You must be logged in to reply to this topic.