Skip to content

Commit

Permalink
Print the day's BSQ swaps after each completed swap
Browse files Browse the repository at this point in the history
  • Loading branch information
ghubstan committed Jun 26, 2022
1 parent 0310212 commit c5d0259
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion java-examples/src/main/java/bisq/bots/BotUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ public static void printTradeSummary(TradeInfo trade) {
* @param trades list of trades
*/
public static void printTradesSummary(GetTradesRequest.Category category, List<TradeInfo> trades) {
log.info("{} trades:", category.name());
switch (category) {
case CLOSED -> new TableBuilder(CLOSED_TRADES_TBL, trades).build().print(out);
case FAILED -> new TableBuilder(FAILED_TRADES_TBL, trades).build().print(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.function.Predicate;

import static bisq.bots.BotUtils.*;
import static bisq.proto.grpc.GetTradesRequest.Category.CLOSED;
import static java.lang.String.format;
import static java.lang.System.exit;
import static java.math.RoundingMode.HALF_UP;
Expand Down Expand Up @@ -227,6 +228,9 @@ private void handleFatalException(StatusRuntimeException fatalException) {
* Lock the wallet, stop the API daemon, and terminate the bot.
*/
private void maybeShutdownAfterSuccessfulSwap() {
log.info("Here are today's completed trades:");
printTradesSummaryForToday(CLOSED);

if (!isDryRun) {
try {
lockWallet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.function.Predicate;

import static bisq.bots.BotUtils.*;
import static bisq.proto.grpc.GetTradesRequest.Category.CLOSED;
import static java.lang.String.format;
import static java.lang.System.exit;
import static java.math.RoundingMode.HALF_UP;
Expand Down Expand Up @@ -227,6 +228,9 @@ private void handleFatalException(StatusRuntimeException fatalException) {
* Lock the wallet, stop the API daemon, and terminate the bot.
*/
private void maybeShutdownAfterSuccessfulSwap() {
log.info("Here are today's completed trades:");
printTradesSummaryForToday(CLOSED);

if (!isDryRun) {
try {
lockWallet();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Maximum # of offers to take during one bot session. When reached, bot will shut down (but not the API daemon).
maxTakeOffers=1
maxTakeOffers=50
#
# Minimum distance from 30-day average BSQ trade price.
# Note: all BSQ Swap offers have a fixed-price, but the bot uses a margin (%) of the 30-day price for comparison.
minMarketPriceMargin=0
minMarketPriceMargin=0.00
#
# Hard coded 30-day average BSQ trade price, used for development over regtest.
regtest30DayAvgBsqPrice=0.00005
Expand All @@ -12,7 +12,7 @@ regtest30DayAvgBsqPrice=0.00005
minAmount=0.01
#
# Taker bot's max BTC amount to sell. The candidate SELL BTC offer's amount must be <= maxAmount BTC.
maxAmount=0.50
maxAmount=0.90
#
# Taker bot's max acceptable transaction fee rate (sats / byte).
# Regtest fee rates are from https://price.bisq.wiz.biz/getFees
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Maximum # of offers to take during one bot session. When reached, bot will shut down (but not the API daemon).
maxTakeOffers=100
maxTakeOffers=50
#
# Maximum distance from 30-day average BSQ trade price.
# Note: all BSQ Swap offers have a fixed-price, but the bot uses a margin (%) of the 30-day price for comparison.
Expand Down

0 comments on commit c5d0259

Please sign in to comment.