diff --git a/packages/packages.json b/packages/packages.json index 2002eac78..b2275c966 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { "skill/valory/market_manager_abci/0.1.0": "bafybeic7o4pclkhnugyn7js5g3asxuqhkxpvunlp3mpup7aovhg2fto22i", - "skill/valory/decision_maker_abci/0.1.0": "bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4", - "skill/valory/trader_abci/0.1.0": "bafybeihqqz7yvn33iirooeqk7e6iz4dr5grwrfbkavamis6bnfoz6yj5pu", + "skill/valory/decision_maker_abci/0.1.0": "bafybeicbv5yf6rfabezmxjpwm7tjufop2yrquby6tq6kimo2tppvknhlym", + "skill/valory/trader_abci/0.1.0": "bafybeieszk2tzxxi5ulku6v5x3i3zltvzbxhgbm6f3pwxbzsejrdru6cla", "contract/valory/market_maker/0.1.0": "bafybeid5jnetbsusgxkpqzwyiqlwut55xktfbeloipxcemcuu5oopmqtl4", - "agent/valory/trader/0.1.0": "bafybeigt6hd5cwuusdbu4u3ieqzvs4v4vihlr344rz55pb6neys55cwlre", - "service/valory/trader/0.1.0": "bafybeiaabwa7whlwpep5j2gpidnfvqgkgyo2vrw655t6epwtbh67umsb5m", + "agent/valory/trader/0.1.0": "bafybeifneutrvfu462ebebzoi7belih7j2jjaxex7f4tsaum4tzl42rus4", + "service/valory/trader/0.1.0": "bafybeif4g4626hotgl7k6vfvdc5zezynkpm3fkuih7xhs7lejuiegbppcu", "contract/valory/erc20/0.1.0": "bafybeiepg5ymxhtylgijs3mf3lezz6cwcsougbrv2gr4xcq3bp5wxusi64", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaqh4pujl2o2ginl5lbe7p7en7t2ncs25gohysxdks5kd4lmqav3q", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicgaji7zj2zqjq4ppvurd3ecdfdjtyhrxzn3meyncji74ndivubdu", "contract/valory/mech/0.1.0": "bafybeieo65rtidzgrx22la7z7azoqbisd35hnoqfw7l3xxctotvctjlkju", "contract/valory/realitio/0.1.0": "bafybeieoily22pasgkzzcyawhqyrsko7b52lghnvwuskhomavb7tlb6pxa", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 8c818f56d..ddc90195e 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -43,10 +43,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiencz2uytz6fqj5wg7mcunevxjh4xg5gd6pqcgkshgqywhcimweyi - valory/termination_abci:0.1.0:bafybeigainmpy37gb33ogbrpggjbkuasodhthh5oz4vbzjdfjozerpf224 - valory/transaction_settlement_abci:0.1.0:bafybeigk3debp6dswutqsuls2lqfvyj4ghe6kwjc2zfinnsvj6hujynxtq -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaqh4pujl2o2ginl5lbe7p7en7t2ncs25gohysxdks5kd4lmqav3q +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgaji7zj2zqjq4ppvurd3ecdfdjtyhrxzn3meyncji74ndivubdu - valory/market_manager_abci:0.1.0:bafybeic7o4pclkhnugyn7js5g3asxuqhkxpvunlp3mpup7aovhg2fto22i -- valory/decision_maker_abci:0.1.0:bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4 -- valory/trader_abci:0.1.0:bafybeihqqz7yvn33iirooeqk7e6iz4dr5grwrfbkavamis6bnfoz6yj5pu +- valory/decision_maker_abci:0.1.0:bafybeicbv5yf6rfabezmxjpwm7tjufop2yrquby6tq6kimo2tppvknhlym +- valory/trader_abci:0.1.0:bafybeieszk2tzxxi5ulku6v5x3i3zltvzbxhgbm6f3pwxbzsejrdru6cla - valory/staking_abci:0.1.0:bafybeia3acxumkjg566dvgagv3swz7htf5xpvwq6ovmecvp5j2zdxdoabe default_ledger: ethereum required_ledgers: @@ -192,9 +192,11 @@ models: realitio_address: ${str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57} event_filtering_batch_size: ${int:5000} reduce_factor: ${float:0.25} + minimum_batch_size: ${int:500} max_filtering_retries: ${int:6} redeeming_batch_size: ${int:5} slippage: ${float:0.01} + redeem_round_timeout: ${float:3600.0} policy_epsilon: ${float:0.1} policy_store_path: ${str:/data/} irrelevant_tools: ${list:["openai-text-davinci-002", "openai-text-davinci-003", diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 42056048c..750c78137 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeigt6hd5cwuusdbu4u3ieqzvs4v4vihlr344rz55pb6neys55cwlre +agent: valory/trader:0.1.0:bafybeifneutrvfu462ebebzoi7belih7j2jjaxex7f4tsaum4tzl42rus4 number_of_agents: 4 deployment: {} --- @@ -107,6 +107,7 @@ type: skill event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} reduce_factor: ${REDUCE_FACTOR:float:0.25} max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6} + minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -119,6 +120,7 @@ type: skill agent_balance_threshold: ${AGENT_BALANCE_THRESHOLD:int:10000000000000000} refill_check_interval: ${REFILL_CHECK_INTERVAL:int:10} tool_punishment_multiplier: ${TOOL_PUNISHMENT_MULTIPLIER:int:1} + redeem_round_timeout: ${REDEEM_ROUND_TIMEOUT:float:3600.0} benchmark_tool: &id005 args: log_dir: ${LOG_DIR:str:/benchmarks} @@ -186,6 +188,7 @@ type: skill event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} reduce_factor: ${REDUCE_FACTOR:float:0.25} max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6} + minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -198,6 +201,7 @@ type: skill agent_balance_threshold: ${AGENT_BALANCE_THRESHOLD:int:10000000000000000} refill_check_interval: ${REFILL_CHECK_INTERVAL:int:10} tool_punishment_multiplier: ${TOOL_PUNISHMENT_MULTIPLIER:int:1} + redeem_round_timeout: ${REDEEM_ROUND_TIMEOUT:float:3600.0} benchmark_tool: *id005 2: models: @@ -263,6 +267,7 @@ type: skill event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} reduce_factor: ${REDUCE_FACTOR:float:0.25} max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6} + minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -275,6 +280,7 @@ type: skill agent_balance_threshold: ${AGENT_BALANCE_THRESHOLD:int:10000000000000000} refill_check_interval: ${REFILL_CHECK_INTERVAL:int:10} tool_punishment_multiplier: ${TOOL_PUNISHMENT_MULTIPLIER:int:1} + redeem_round_timeout: ${REDEEM_ROUND_TIMEOUT:float:3600.0} benchmark_tool: *id005 3: models: @@ -340,6 +346,7 @@ type: skill event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} reduce_factor: ${REDUCE_FACTOR:float:0.25} max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6} + minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -352,6 +359,7 @@ type: skill agent_balance_threshold: ${AGENT_BALANCE_THRESHOLD:int:10000000000000000} refill_check_interval: ${REFILL_CHECK_INTERVAL:int:10} tool_punishment_multiplier: ${TOOL_PUNISHMENT_MULTIPLIER:int:1} + redeem_round_timeout: ${REDEEM_ROUND_TIMEOUT:float:3600.0} benchmark_tool: *id005 --- public_id: valory/ledger:0.19.0 diff --git a/packages/valory/skills/decision_maker_abci/behaviours/reedem.py b/packages/valory/skills/decision_maker_abci/behaviours/reedem.py index 4bae2f3ad..8c4af0263 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/reedem.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/reedem.py @@ -448,11 +448,14 @@ def _check_already_redeemed(self) -> WaitableConditionType: if not result: n_retries += 1 keep_fraction = 1 - self.params.reduce_factor - batch_size = int(batch_size * keep_fraction) + reduced_batch_size = int(batch_size * keep_fraction) + # ensure that the batch size is at least the minimum batch size + batch_size = max(reduced_batch_size, self.params.minimum_batch_size) self.redeeming_progress.event_filtering_batch_size = batch_size self.context.logger.warning( f"Repeating this call with a decreased batch size of {batch_size}." ) + continue self.redeeming_progress.payouts.update(self.payouts_batch) @@ -773,7 +776,6 @@ def _store_utilized_tools(self) -> None: def finish_behaviour(self, payload: BaseTxPayload) -> Generator: """Finish the behaviour.""" - self.redeeming_progress = RedeemingProgress() self._store_utilized_tools() yield from super().finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/fsm_specification.yaml b/packages/valory/skills/decision_maker_abci/fsm_specification.yaml index 28ae210b7..68dca3de7 100644 --- a/packages/valory/skills/decision_maker_abci/fsm_specification.yaml +++ b/packages/valory/skills/decision_maker_abci/fsm_specification.yaml @@ -8,6 +8,7 @@ alphabet_in: - NO_MAJORITY - NO_OP - NO_REDEEMING +- REDEEM_ROUND_TIMEOUT - ROUND_TIMEOUT - SLOTS_UNSUPPORTED_ERROR - TIE @@ -68,7 +69,7 @@ transition_func: (RedeemRound, NONE): ImpossibleRound (RedeemRound, NO_MAJORITY): RedeemRound (RedeemRound, NO_REDEEMING): FinishedWithoutRedeemingRound - (RedeemRound, ROUND_TIMEOUT): RedeemRound + (RedeemRound, REDEEM_ROUND_TIMEOUT): FinishedWithoutRedeemingRound (SamplingRound, DONE): ToolSelectionRound (SamplingRound, NONE): FinishedWithoutDecisionRound (SamplingRound, NO_MAJORITY): SamplingRound diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 35df1bb2e..4604ac3f0 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -231,6 +231,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: "event_filtering_batch_size", kwargs, int ) self.reduce_factor: float = self._ensure("reduce_factor", kwargs, float) + # the minimum batch size for redeeming operations, this is added to avoid the batch size to be too small + self.minimum_batch_size: int = self._ensure("minimum_batch_size", kwargs, int) self.max_filtering_retries: int = self._ensure( "max_filtering_retries", kwargs, int ) @@ -239,6 +241,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.redeeming_batch_size: int = self._ensure( "redeeming_batch_size", kwargs, int ) + self.redeem_round_timeout: float = self._ensure( + "redeem_round_timeout", kwargs, float + ) # a slippage in the range of [0, 1] to apply to the `minOutcomeTokensToBuy` when buying shares on a fpmm self._slippage: float = 0.0 self.slippage: float = self._ensure("slippage", kwargs, float) diff --git a/packages/valory/skills/decision_maker_abci/rounds.py b/packages/valory/skills/decision_maker_abci/rounds.py index 59da51dff..e2bf7c716 100644 --- a/packages/valory/skills/decision_maker_abci/rounds.py +++ b/packages/valory/skills/decision_maker_abci/rounds.py @@ -110,7 +110,7 @@ class DecisionMakerAbciApp(AbciApp[Event]): - done: 8. - no redeeming: 10. - no majority: 6. - - round timeout: 6. + - redeem round timeout: 10. - none: 12. 7. HandleFailedTxRound - blacklist: 4. @@ -126,6 +126,7 @@ class DecisionMakerAbciApp(AbciApp[Event]): Timeouts: round timeout: 30.0 + redeem round timeout: 3600.0 """ initial_round_cls: AppState = SamplingRound @@ -184,7 +185,9 @@ class DecisionMakerAbciApp(AbciApp[Event]): Event.DONE: FinishedDecisionMakerRound, Event.NO_REDEEMING: FinishedWithoutRedeemingRound, Event.NO_MAJORITY: RedeemRound, - Event.ROUND_TIMEOUT: RedeemRound, + # in case of a round timeout, there likely is something wrong with redeeming + # it could be the RPC, or some other issue. We don't want to be stuck trying to redeem. + Event.REDEEM_ROUND_TIMEOUT: FinishedWithoutRedeemingRound, # this is here because of `autonomy analyse fsm-specs` falsely reporting it as missing from the transition Event.NONE: ImpossibleRound, }, @@ -217,6 +220,7 @@ class DecisionMakerAbciApp(AbciApp[Event]): } event_to_timeout: Dict[Event, float] = { Event.ROUND_TIMEOUT: 30.0, + Event.REDEEM_ROUND_TIMEOUT: 3600.0, } db_pre_conditions: Dict[AppState, Set[str]] = { RedeemRound: set(), diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 727fc65f9..7bdb8eb78 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -18,20 +18,20 @@ fingerprint: behaviours/decision_receive.py: bafybeifacce2ke7oltnwnpdjdqfd74eaaw5wxnjfzk6c5tqdsxsmbzjj3m behaviours/decision_request.py: bafybeievr7vae43e7jr4eqqhwe3emvgiih7ysa66jcb5g2oz5lbxua232q behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm - behaviours/reedem.py: bafybeiekq77eatvf7xczbnyd4s6met4ci57ethwwoyxf5mhrcq7vuwiaxu + behaviours/reedem.py: bafybeifegxnjid4obmbodlc7ogw2ahoa64bgfneeltxw6mdubglfijylq4 behaviours/round_behaviour.py: bafybeig4tdktyu6hapoqymnxh2bgpds547st6a44heue657wkctwe4gjvm behaviours/sampling.py: bafybeifzhm4sspdvt227ksl5hjn26offgqpwempgbcwbr6dq7gyi2a46sm behaviours/tool_selection.py: bafybeifpvrrbftlkjsoiysnasihzttousk6hxnukzrln6z2d33e3zexkje dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm - fsm_specification.yaml: bafybeifnob3ceim2mj7lqagtnpwqjqqxs5eg3oiwc73gwm6x5i2dvvlcya + fsm_specification.yaml: bafybeidqrxj3l3e555znk4wxx6spwaijz3bhc5yialhzbhd6ngk52w7jbq handlers.py: bafybeihj33szgrcxnpd73s4nvluyxwwsvhjum2cuq3ilhhe6vfola3k7vy - models.py: bafybeihmqhxixmklpp656o7i27fas2afabusmar2heyfnx5e3kgzdcvkji + models.py: bafybeif3ubulx7cr7bh7yvwhik2footnfi6ofvjoioym3w6eka3owi67pe payloads.py: bafybeigcic4vewdglakzpyqevhfwsolh4ywnbvxo5bgned7gl5uo3jif7m policy.py: bafybeidpmx4ek3qze63zpuwixyf6t7bdv62ewgkzt3ljrzadiwdw64cueq redeem_info.py: bafybeibddfxwp3577c3dl2utaowwltquu5fg6crezpumoebw563wxpbfrm - rounds.py: bafybeibbpiqyifu3bxldmxv3ebwwymwhkqid7eglf4gz7g6mmtcxtconle + rounds.py: bafybeifvov25vwzbbzgg4zvtptsnqve7t7hbjq3b7wuhie4fdwq2e7th7q states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeid265zag7ivlc6fng5croomwds2r43ozzcmom7yp4kzfz7o5bav6a + states/base.py: bafybeibhcc4pc3m6qelvdvxssnuglcwfaff55cr2kule74ekauyf3bahpq states/bet_placement.py: bafybeibalhxhp2c4oljmiwqi6ds3g36fgtabmf42mb5sgq6z22znrcbhda states/blacklisting.py: bafybeifruvxwwltndwazkzzbpc5nnnad3z5t5ofy6d3i7nssljbxl6gvxu states/decision_receive.py: bafybeib3roo27nccj4eylaqwwzztzzzwsi6px5atjrch5wbqmpln2kyy6y @@ -190,9 +190,11 @@ models: conditional_tokens_address: '0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce' realitio_proxy_address: '0xAB16D643bA051C11962DA645f74632d3130c81E2' realitio_address: '0x79e32aE03fb27B07C89c0c568F80287C01ca2E57' + redeem_round_timeout: 3600.0 event_filtering_batch_size: 5000 reduce_factor: 0.25 max_filtering_retries: 6 + minimum_batch_size: 500 redeeming_batch_size: 5 policy_store_path: /data/ slippage: 0.01 diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 41b0ebbd6..a75be3b0d 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -53,6 +53,7 @@ class Event(Enum): BLACKLIST = "blacklist" NO_OP = "no_op" ROUND_TIMEOUT = "round_timeout" + REDEEM_ROUND_TIMEOUT = "redeem_round_timeout" NO_MAJORITY = "no_majority" diff --git a/packages/valory/skills/trader_abci/fsm_specification.yaml b/packages/valory/skills/trader_abci/fsm_specification.yaml index ff44a0330..889ab6efb 100644 --- a/packages/valory/skills/trader_abci/fsm_specification.yaml +++ b/packages/valory/skills/trader_abci/fsm_specification.yaml @@ -21,6 +21,7 @@ alphabet_in: - NO_OP - NO_REDEEMING - REDEEMING_DONE +- REDEEM_ROUND_TIMEOUT - REFILL_REQUIRED - RESET_AND_PAUSE_TIMEOUT - RESET_TIMEOUT @@ -138,7 +139,7 @@ transition_func: (RedeemRound, NONE): ImpossibleRound (RedeemRound, NO_MAJORITY): RedeemRound (RedeemRound, NO_REDEEMING): CallCheckpointRound - (RedeemRound, ROUND_TIMEOUT): RedeemRound + (RedeemRound, REDEEM_ROUND_TIMEOUT): CallCheckpointRound (RegistrationRound, DONE): UpdateBetsRound (RegistrationRound, NO_MAJORITY): RegistrationRound (RegistrationStartupRound, DONE): UpdateBetsRound diff --git a/packages/valory/skills/trader_abci/models.py b/packages/valory/skills/trader_abci/models.py index 343cb026b..e4bbbbf2d 100644 --- a/packages/valory/skills/trader_abci/models.py +++ b/packages/valory/skills/trader_abci/models.py @@ -116,6 +116,7 @@ def setup(self) -> None: TSEvent.VALIDATE_TIMEOUT: self.params.validate_timeout, TSEvent.FINALIZE_TIMEOUT: self.params.finalize_timeout, TSEvent.CHECK_TIMEOUT: self.params.history_check_timeout, + DecisionMakerEvent.REDEEM_ROUND_TIMEOUT: self.params.redeem_round_timeout, ResetPauseEvent.RESET_AND_PAUSE_TIMEOUT: reset_pause_timeout, } diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 0dbd0b22a..eb3536aeb 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -11,9 +11,9 @@ fingerprint: behaviours.py: bafybeieesrefrpo5c5upzztgm5fwfrmxeagilacuau5nacobhsfvgpbzby composition.py: bafybeiajga2m7pv7v4bxsjsnncavdns6gujg7qg7opfjyznlzip3gbd3nm dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeihlhdsmmihnvwtggc2t2neqkm5uduw5krpgcxpz7m7xp5kjkf6jsm + fsm_specification.yaml: bafybeib3ycl5bjo5uilyaly7uoovvc3b3gpjrkuvdos5ffsgmrs73j6bkm handlers.py: bafybeicamc6vmozij5dwvkxmbxjazsgf3sacojhstbjtq7vfggszxugvey - models.py: bafybeifxiptjrnv4hbw5l3mfxvb7hksmxf726kvab5lcms5btuc3vaahem + models.py: bafybeicn2hiu22rwbprphl7zftgxeeehsuj6nirydmyugwiqay6avvjbna fingerprint_ignore_patterns: [] connections: [] contracts: [] @@ -25,8 +25,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeigk3debp6dswutqsuls2lqfvyj4ghe6kwjc2zfinnsvj6hujynxtq - valory/termination_abci:0.1.0:bafybeigainmpy37gb33ogbrpggjbkuasodhthh5oz4vbzjdfjozerpf224 - valory/market_manager_abci:0.1.0:bafybeic7o4pclkhnugyn7js5g3asxuqhkxpvunlp3mpup7aovhg2fto22i -- valory/decision_maker_abci:0.1.0:bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4 -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaqh4pujl2o2ginl5lbe7p7en7t2ncs25gohysxdks5kd4lmqav3q +- valory/decision_maker_abci:0.1.0:bafybeicbv5yf6rfabezmxjpwm7tjufop2yrquby6tq6kimo2tppvknhlym +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgaji7zj2zqjq4ppvurd3ecdfdjtyhrxzn3meyncji74ndivubdu - valory/staking_abci:0.1.0:bafybeia3acxumkjg566dvgagv3swz7htf5xpvwq6ovmecvp5j2zdxdoabe behaviours: main: @@ -173,6 +173,7 @@ models: event_filtering_batch_size: 5000 reduce_factor: 0.25 max_filtering_retries: 6 + minimum_batch_size: 500 redeeming_batch_size: 5 slippage: 0.01 policy_epsilon: 0.1 @@ -189,6 +190,7 @@ models: staking_contract_address: '0x5add592ce0a1B5DceCebB5Dcac086Cd9F9e3eA5C' agent_balance_threshold: 10000000000000000 refill_check_interval: 10 + redeem_round_timeout: 3600.0 tool_punishment_multiplier: 1 class_name: TraderParams network_subgraph: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/behaviours.py b/packages/valory/skills/tx_settlement_multiplexer_abci/behaviours.py index b2f94489c..97f3d202c 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/behaviours.py +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/behaviours.py @@ -28,6 +28,7 @@ AbstractRoundBehaviour, BaseBehaviour, ) +from packages.valory.skills.decision_maker_abci.models import RedeemingProgress from packages.valory.skills.decision_maker_abci.payloads import VotingPayload from packages.valory.skills.tx_settlement_multiplexer_abci.models import ( TxSettlementMultiplexerParams, @@ -128,10 +129,30 @@ def synchronized_data(self) -> SynchronizedData: """Return the synchronized data.""" return SynchronizedData(super().synchronized_data.db) + def _on_redeem_round_tx_settled(self) -> None: + """Handle the redeem round.""" + self.context.logger.info( + "Redeeming transaction was settled. Resetting the redeeming progress." + ) + self.shared_state.redeeming_progress = RedeemingProgress() # type: ignore + + def _on_tx_settled(self) -> None: + """Handle the tx settled event.""" + tx_submitter = self.synchronized_data.tx_submitter + handler_name = f"_on_{tx_submitter}_tx_settled" + handler = getattr(self, handler_name, None) + if handler is None: + self.context.logger.info( + f"No post tx settlement handler exists for {tx_submitter} txs." + ) + return + handler() + def async_act(self) -> Generator: """Simply log that a tx is settled and wait for the round end.""" msg = f"The transaction submitted by {self.synchronized_data.tx_submitter} was successfully settled." self.context.logger.info(msg) + self._on_tx_settled() yield from self.wait_until_round_end() self.set_done() diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index a47fac04a..ba51ceb83 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeiegcjg2wjrsqhrmvyulioch3d67rnbzkx5af3ztkaw7kxathjreda __init__.py: bafybeide6k22zk4f3hyzhpapaoddsnxpw5elqcfvrxxj4nfvpzctv6jqhu - behaviours.py: bafybeihmhpvorg4tgdhrhtv6ks6uxza4k5qxvnxanfhil75t54rfb5ykta + behaviours.py: bafybeifboxplklx3eqaljkugio7y72thpb5jdboqcickefuklhverksw5y dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeidwxjna36auqbtqlehx73kyb6o74suhzj5bothgtiapcj35b7gzve handlers.py: bafybeiafbqr7ojfcbwohvee7x4zzswad3ymfrrbjlfz7uuuttmn3qdfs6q @@ -21,7 +21,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeige5agrztgzfevyglf7mb4o7pzfttmq4f6zi765y4g2zvftbyowru skills: - valory/abstract_round_abci:0.1.0:bafybeidau7loztcfy3mxvoqrv7otbpciemd2wf3lsxyjraq4dcvuvib25e -- valory/decision_maker_abci:0.1.0:bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4 +- valory/decision_maker_abci:0.1.0:bafybeicbv5yf6rfabezmxjpwm7tjufop2yrquby6tq6kimo2tppvknhlym - valory/staking_abci:0.1.0:bafybeia3acxumkjg566dvgagv3swz7htf5xpvwq6ovmecvp5j2zdxdoabe behaviours: main: