|
|
@@ -181,17 +181,18 @@ const calculations = computed(() => {
|
|
|
|
|
|
// 可用余额
|
|
|
const maxBalance = spotAccountStore.getAvailableBalance(quoteAccount.value)
|
|
|
- // 预估手续费
|
|
|
+ // 买预估手续费
|
|
|
const buyEstimatedFee = (buyFeeValue.FeeAlgorithm === 2 ? amount : estimatedAmount) * buyFeeValue.feeValue
|
|
|
// 可买数量
|
|
|
- const maxBuyQty = price ? (maxBalance - buyEstimatedFee) / (price * agreeunit) : 0
|
|
|
+ const maxBuyQty = (price && maxBalance>buyEstimatedFee) ? (maxBalance - buyEstimatedFee) / (price * agreeunit) : 0
|
|
|
|
|
|
+ // 卖预估手续费
|
|
|
+ const sellEstimatedFee = (sellFeeValue.FeeAlgorithm === 2 ? amount : estimatedAmount) * sellFeeValue.feeValue
|
|
|
// 可卖数量
|
|
|
- const maxSellQty = spotAccountStore.getAvailableBalance(baseAccount.value)
|
|
|
+ const maxSellQty = (price && maxBalance>sellEstimatedFee) ? (maxBalance - sellEstimatedFee) / (price * agreeunit) : 0
|
|
|
// 可获金额
|
|
|
const maxAmount = price * maxSellQty * agreeunit
|
|
|
- // 预估手续费
|
|
|
- const sellEstimatedFee = (sellFeeValue.FeeAlgorithm === 2 ? amount : estimatedAmount) * sellFeeValue.feeValue
|
|
|
+
|
|
|
|
|
|
return {
|
|
|
estimatedAmount,
|