Improve take offer criteria summary text

This commit is contained in:
ghubstan 2022-06-25 11:45:35 -03:00
parent b8bec32574
commit 25f12c8232
No known key found for this signature in database
GPG Key ID: E35592D6800A861E
5 changed files with 55 additions and 28 deletions

View File

@ -307,6 +307,12 @@ public class TakeBestPricedOfferToBuyBsq extends AbstractBot {
} }
void printCriteriaSummary() { void printCriteriaSummary() {
if (isZero.test(minMarketPriceMargin)) {
log.info("Looking for offers to {}, with a fixed-price at or greater than"
+ " the 30-day average BSQ trade price of {} BTC.",
MARKET_DESCRIPTION,
avgBsqPrice);
} else {
log.info("Looking for offers to {}, with a fixed-price at or greater than" log.info("Looking for offers to {}, with a fixed-price at or greater than"
+ " {}% {} the 30-day average BSQ trade price of {} BTC.", + " {}% {} the 30-day average BSQ trade price of {} BTC.",
MARKET_DESCRIPTION, MARKET_DESCRIPTION,
@ -314,6 +320,7 @@ public class TakeBestPricedOfferToBuyBsq extends AbstractBot {
aboveOrBelowMarketPrice.apply(minMarketPriceMargin), aboveOrBelowMarketPrice.apply(minMarketPriceMargin),
avgBsqPrice); avgBsqPrice);
} }
}
void printOffersAgainstCriteria(List<OfferInfo> offers) { void printOffersAgainstCriteria(List<OfferInfo> offers) {
log.info("Currently available {} offers -- want to take BSQ swap offer with fixed-price >= {} BTC.", log.info("Currently available {} offers -- want to take BSQ swap offer with fixed-price >= {} BTC.",

View File

@ -382,13 +382,20 @@ public class TakeBestPricedOfferToBuyBtc extends AbstractBot {
} }
void printCriteriaSummary() { void printCriteriaSummary() {
log.info("Looking for offers to {}, priced at or more than {}% {} the current market price {} {}.", if (isZero.test(minMarketPriceMargin)) {
log.info("Looking for offers to {}, priced at or higher than the current market price {} {}.",
marketDescription.get(),
currentMarketPrice,
isXmr.test(currencyCode) ? "BTC" : currencyCode);
} else {
log.info("Looking for offers to {}, priced at or more than {}% {} from the current market price {} {}.",
marketDescription.get(), marketDescription.get(),
minMarketPriceMargin.abs(), // Hide the sign, text explains target price % "above or below". minMarketPriceMargin.abs(), // Hide the sign, text explains target price % "above or below".
aboveOrBelowMarketPrice.apply(minMarketPriceMargin), aboveOrBelowMarketPrice.apply(minMarketPriceMargin),
currentMarketPrice, currentMarketPrice,
isXmr.test(currencyCode) ? "BTC" : currencyCode); isXmr.test(currencyCode) ? "BTC" : currencyCode);
} }
}
void printOffersAgainstCriteria(List<OfferInfo> offers) { void printOffersAgainstCriteria(List<OfferInfo> offers) {
log.info("Currently available {} offers -- want to take {} offer with price >= {} {}.", log.info("Currently available {} offers -- want to take {} offer with price >= {} {}.",

View File

@ -308,6 +308,12 @@ public class TakeBestPricedOfferToSellBsq extends AbstractBot {
} }
void printCriteriaSummary() { void printCriteriaSummary() {
if (isZero.test(maxMarketPriceMargin)) {
log.info("Looking for offers to {}, with a fixed-price at or less than"
+ " the 30-day average BSQ trade price of {} BTC.",
MARKET_DESCRIPTION,
avgBsqPrice);
} else {
log.info("Looking for offers to {}, with a fixed-price at or less than" log.info("Looking for offers to {}, with a fixed-price at or less than"
+ " {}% {} the 30-day average BSQ trade price of {} BTC.", + " {}% {} the 30-day average BSQ trade price of {} BTC.",
MARKET_DESCRIPTION, MARKET_DESCRIPTION,
@ -315,7 +321,7 @@ public class TakeBestPricedOfferToSellBsq extends AbstractBot {
aboveOrBelowMarketPrice.apply(maxMarketPriceMargin), aboveOrBelowMarketPrice.apply(maxMarketPriceMargin),
avgBsqPrice); avgBsqPrice);
} }
}
void printOffersAgainstCriteria(List<OfferInfo> offers) { void printOffersAgainstCriteria(List<OfferInfo> offers) {
log.info("Currently available {} offers -- want to take BSQ swap offer with fixed-price <= {} BTC.", log.info("Currently available {} offers -- want to take BSQ swap offer with fixed-price <= {} BTC.",

View File

@ -382,13 +382,20 @@ public class TakeBestPricedOfferToSellBtc extends AbstractBot {
} }
void printCriteriaSummary() { void printCriteriaSummary() {
log.info("Looking for offers to {}, priced at or less than {}% {} the current market price {} {}.", if (isZero.test(maxMarketPriceMargin)) {
log.info("Looking for offers to {}, priced at or lower than the current market price {} {}.",
marketDescription.get(),
currentMarketPrice,
isXmr.test(currencyCode) ? "BTC" : currencyCode);
} else {
log.info("Looking for offers to {}, priced at or less than {}% {} from the current market price {} {}.",
marketDescription.get(), marketDescription.get(),
maxMarketPriceMargin.abs(), // Hide the sign, text explains target price % "above or below". maxMarketPriceMargin.abs(), // Hide the sign, text explains target price % "above or below".
aboveOrBelowMarketPrice.apply(maxMarketPriceMargin), aboveOrBelowMarketPrice.apply(maxMarketPriceMargin),
currentMarketPrice, currentMarketPrice,
isXmr.test(currencyCode) ? "BTC" : currencyCode); isXmr.test(currencyCode) ? "BTC" : currencyCode);
} }
}
void printOffersAgainstCriteria(List<OfferInfo> offers) { void printOffersAgainstCriteria(List<OfferInfo> offers) {
log.info("Currently available {} offers -- want to take {} offer with price <= {} {}.", log.info("Currently available {} offers -- want to take {} offer with price <= {} {}.",

View File

@ -1,13 +1,13 @@
# #
# Maximum # of offers to take during one bot session. When reached, bot will shut down API daemon then itself. # Maximum # of offers to take during one bot session. When reached, bot will shut down API daemon then itself.
maxTakeOffers=10 maxTakeOffers=1
# #
# Taker bot's payment account id. Only BUY BTC offers using the same payment method will be considered for taking. # Taker bot's payment account id. Only BUY BTC offers using the same payment method will be considered for taking.
paymentAccountId=9ad3cc7a-7d32-453c-b9db-a3714b5b8f61 paymentAccountId=28030c83-f07d-4f0b-b824-019529279630
# #
# Taker bot's min market price margin. A candidate BUY BTC offer's price margin must be >= minMarketPriceMargin. # Taker bot's min market price margin. A candidate BUY BTC offer's price margin must be >= minMarketPriceMargin.
# #
minMarketPriceMargin=1.00 minMarketPriceMargin=0
# #
# Taker bot's min BTC amount to sell. The candidate BUY offer's amount must be >= minAmount BTC. # Taker bot's min BTC amount to sell. The candidate BUY offer's amount must be >= minAmount BTC.
minAmount=0.01 minAmount=0.01