increase trade limits by factor of 10

popup warning displays effective trade limit
This commit is contained in:
woodser 2021-05-23 09:38:40 -04:00
parent 2be32fcb8d
commit be2a71b9b5
4 changed files with 11 additions and 6 deletions

View File

@ -36,7 +36,7 @@ public class OfferRestrictions {
return new Date().after(REQUIRE_UPDATE_DATE); return new Date().after(REQUIRE_UPDATE_DATE);
} }
public static Coin TOLERATED_SMALL_TRADE_AMOUNT = Coin.parseCoin("0.1"); public static Coin TOLERATED_SMALL_TRADE_AMOUNT = Coin.parseCoin("1.0");
static boolean hasOfferMandatoryCapability(Offer offer, Capability mandatoryCapability) { static boolean hasOfferMandatoryCapability(Offer offer, Capability mandatoryCapability) {
Map<String, String> extraDataMap = offer.getOfferPayload().getExtraDataMap(); Map<String, String> extraDataMap = offer.getOfferPayload().getExtraDataMap();

View File

@ -60,10 +60,10 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
// risk factor so the relation between the risk categories stays the same as with the default values. // risk factor so the relation between the risk categories stays the same as with the default values.
// We must not change those values as it could lead to invalid offers if amount becomes lower then new trade limit. // We must not change those values as it could lead to invalid offers if amount becomes lower then new trade limit.
// Increasing might be ok, but needs more thought as well... // Increasing might be ok, but needs more thought as well...
private static final Coin DEFAULT_TRADE_LIMIT_VERY_LOW_RISK = Coin.parseCoin("10"); private static final Coin DEFAULT_TRADE_LIMIT_VERY_LOW_RISK = Coin.parseCoin("100");
private static final Coin DEFAULT_TRADE_LIMIT_LOW_RISK = Coin.parseCoin("5"); private static final Coin DEFAULT_TRADE_LIMIT_LOW_RISK = Coin.parseCoin("50");
private static final Coin DEFAULT_TRADE_LIMIT_MID_RISK = Coin.parseCoin("2.5"); private static final Coin DEFAULT_TRADE_LIMIT_MID_RISK = Coin.parseCoin("25");
private static final Coin DEFAULT_TRADE_LIMIT_HIGH_RISK = Coin.parseCoin("1.25"); private static final Coin DEFAULT_TRADE_LIMIT_HIGH_RISK = Coin.parseCoin("12.5");
public static final String UPHOLD_ID = "UPHOLD"; public static final String UPHOLD_ID = "UPHOLD";
public static final String MONEY_BEAM_ID = "MONEY_BEAM"; public static final String MONEY_BEAM_ID = "MONEY_BEAM";

View File

@ -729,7 +729,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
} else if (amount.get() != null && btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) { } else if (amount.get() != null && btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) {
amount.set(btcFormatter.formatCoin(btcValidator.getMaxTradeLimit())); amount.set(btcFormatter.formatCoin(btcValidator.getMaxTradeLimit()));
new Popup().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.buyer", new Popup().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.buyer",
btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), btcFormatter.formatCoinWithCode(getEffectiveLimit()),
Res.get("offerbook.warning.newVersionAnnouncement"))) Res.get("offerbook.warning.newVersionAnnouncement")))
.width(900) .width(900)
.show(); .show();
@ -746,6 +746,10 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
} }
} }
private Coin getEffectiveLimit() {
return btcValidator.getMaxValue() == null ? btcValidator.getMaxTradeLimit() : btcValidator.getMaxValue();
}
public void onFocusOutMinAmountTextField(boolean oldValue, boolean newValue) { public void onFocusOutMinAmountTextField(boolean oldValue, boolean newValue) {
if (oldValue && !newValue) { if (oldValue && !newValue) {
InputValidator.ValidationResult result = isBtcInputValid(minAmount.get()); InputValidator.ValidationResult result = isBtcInputValid(minAmount.get());

View File

@ -44,6 +44,7 @@ public class BtcValidator extends NumberValidator {
@Nullable @Nullable
@Setter @Setter
@Getter
protected Coin maxValue; protected Coin maxValue;
@Nullable @Nullable