{#if type === 'BUY'} Buy {coin.symbol} {:else} Sell {coin.symbol} {/if} Current price: ${coin.currentPrice.toFixed(6)} per {coin.symbol}
{#if type === 'SELL'}

Available: {userHolding.toFixed(6)} {coin.symbol} {#if maxSellableAmount < userHolding}
Max sellable: {maxSellableAmount.toFixed(0)} {coin.symbol} (pool limit) {/if}

{:else if $USER_DATA}

Balance: ${userBalance.toFixed(6)}

{/if}
{#if hasValidAmount}
{type === 'BUY' ? `${coin.symbol} you'll get:` : "You'll receive:"} {type === 'BUY' ? `~${estimatedResult.result.toFixed(6)} ${coin.symbol}` : `~$${estimatedResult.result.toFixed(6)}`}

AMM estimation - includes slippage from pool impact

{/if} {#if !hasEnoughFunds && hasValidAmount} {type === 'BUY' ? 'Insufficient funds' : 'Insufficient coins'} {/if}