func AdjustQuantityByMaxAmount(quantity, currentPrice, maxAmount fixedpoint.Value) fixedpoint.Value {
	amount := currentPrice.Mul(quantity)
	if amount < maxAmount {
		return quantity
	}
	ratio := maxAmount.Div(amount)
	return quantity.Mul(ratio)
}
AdjustQuantityByMaxAmount adjusts the quantity to make the amount greater than the given minAmount
package bbgo
import (
	"github.com/c9s/bbgo/pkg/fixedpoint"
	"github.com/pkg/errors"
)
var (
	ErrQuoteBalanceLevelTooLow  = errors.New("quote balance level is too low")
	ErrInsufficientQuoteBalance = errors.New("insufficient quote balance")
	ErrAssetBalanceLevelTooLow  = errors.New("asset balance level too low")
	ErrInsufficientAssetBalance = errors.New("insufficient asset balance")
	ErrAssetBalanceLevelTooHigh = errors.New("asset balance level too high")
)