I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: Displaying maximum available amount of coins to buy with

dashed-slug.net Forums Exchange extension support Displaying maximum available amount of coins to buy with Reply To: Displaying maximum available amount of coins to buy with



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