From c322c9ae0c3cda64b9ecb04ac4cc3f7215614ce8 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Fri, 17 Feb 2023 22:51:49 +0200 Subject: [PATCH] Add total_bids_value_multiplier to automation strategies. order value is the max value of a bid that can be accepted. order value * total_bids_value_multiplier is the max sum of all bids that can be accepted. --- basicswap/basicswap.py | 6 ++++-- doc/release-notes.md | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 2c0cd9a..dcb7a8e 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -4247,8 +4247,10 @@ class BasicSwap(BaseApp): active_bids, total_bids_value = self.getCompletedAndActiveBidsValue(offer, use_session) - if total_bids_value + bid.amount > offer.amount_from: - raise AutomationConstraint('Over remaining offer value {}'.format(offer.amount_from - total_bids_value)) + total_bids_value_multiplier = opts.get('total_bids_value_multiplier', 1.0) + if total_bids_value_multiplier > 0.0: + if total_bids_value + bid.amount > offer.amount_from * total_bids_value_multiplier: + raise AutomationConstraint('Over remaining offer value {}'.format(offer.amount_from * total_bids_value_multiplie - total_bids_value)) num_not_completed = 0 for active_bid in active_bids: diff --git a/doc/release-notes.md b/doc/release-notes.md index c8daaa6..596d786 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -2,6 +2,22 @@ 0.0.x ============== +0.0.59 +============== + +- Added total_bids_value_multiplier option to automation strategies. + - System won't automatically accept a bid for an offer if the sum of the values of all completed + and in-porgress bids and the candidate bid exceeds total_bids_value_multiplier times the offer value. + - default is 1.0. +- ui: The rpc page can send commands over http. + - Must manually specify the argument types bsij for (bool, string, int, json). +- Removed error message for unprocessed revoke messages. + - Some nodes won't have all messages. +- Started test framework for scripts. +- api: Can abandon bids. +- If wallets are encrypted the system will only load in-progress bids when unlocked rather than at startup. +- Can set overrides for automation strategies per identity. + 0.0.54 ==============