From 383737ff4ecc8cbff45a89e9c9537ea127cc5cb4 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 13 Dec 2024 10:44:59 +0000 Subject: [PATCH 01/32] feat: prometheus endpoint --- .../check_stop_trading_abci/behaviours.py | 2 +- .../check_stop_trading_abci/payloads.py | 2 + .../skills/check_stop_trading_abci/rounds.py | 22 ++- .../behaviours/bet_placement.py | 2 + .../skills/decision_maker_abci/handlers.py | 141 ++++++++++++++++-- .../skills/decision_maker_abci/models.py | 3 + .../skills/decision_maker_abci/payloads.py | 1 + .../skills/decision_maker_abci/skill.yaml | 2 + .../skills/decision_maker_abci/states/base.py | 13 ++ .../states/bet_placement.py | 6 +- poetry.lock | 131 +++++++++++----- pyproject.toml | 1 + 12 files changed, 268 insertions(+), 58 deletions(-) diff --git a/packages/valory/skills/check_stop_trading_abci/behaviours.py b/packages/valory/skills/check_stop_trading_abci/behaviours.py index cbc0191ec..763dcf6ea 100644 --- a/packages/valory/skills/check_stop_trading_abci/behaviours.py +++ b/packages/valory/skills/check_stop_trading_abci/behaviours.py @@ -167,7 +167,7 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).local(): stop_trading = yield from self._compute_stop_trading() self.context.logger.info(f"Computed {stop_trading=}") - payload = CheckStopTradingPayload(self.context.agent_address, stop_trading) + payload = CheckStopTradingPayload(self.context.agent_address, stop_trading, self.mech_request_count) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): yield from self.send_a2a_transaction(payload) diff --git a/packages/valory/skills/check_stop_trading_abci/payloads.py b/packages/valory/skills/check_stop_trading_abci/payloads.py index 5831cff87..9d3059a62 100644 --- a/packages/valory/skills/check_stop_trading_abci/payloads.py +++ b/packages/valory/skills/check_stop_trading_abci/payloads.py @@ -20,6 +20,7 @@ """This module contains the transaction payloads for the check stop trading abci.""" from dataclasses import dataclass +from typing import Optional from packages.valory.skills.abstract_round_abci.base import BaseTxPayload @@ -29,3 +30,4 @@ class CheckStopTradingPayload(BaseTxPayload): """A transaction payload for the check stop trading abci.""" vote: bool + mech_request_count: Optional[int] diff --git a/packages/valory/skills/check_stop_trading_abci/rounds.py b/packages/valory/skills/check_stop_trading_abci/rounds.py index 21b93e89b..b3936317c 100644 --- a/packages/valory/skills/check_stop_trading_abci/rounds.py +++ b/packages/valory/skills/check_stop_trading_abci/rounds.py @@ -61,10 +61,16 @@ def _get_deserialized(self, key: str) -> DeserializedCollection: serialized = self.db.get_strict(key) return CollectionRound.deserialize_collection(serialized) + @property def is_staking_kpi_met(self) -> bool: """Get the status of the staking kpi.""" return bool(self.db.get("is_staking_kpi_met", False)) + @property + def n_mech_requests(self) -> int: + """Get the number of mech requests.""" + return int(self.db.get("n_mech_requests", 0)) + class CheckStopTradingRound(VotingRound): """A round for checking stop trading conditions.""" @@ -77,6 +83,15 @@ class CheckStopTradingRound(VotingRound): no_majority_event = Event.NO_MAJORITY collection_key = get_name(SynchronizedData.participant_to_votes) + @property + def mech_request_count(self) -> int: + """Get the mech request count from the payload.""" + payload = self.payloads[0] + + if not hasattr(payload, "mech_request_count"): + return 0 + return payload.mech_request_count + def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: """Process the end of the block.""" res = super().end_block() @@ -85,7 +100,12 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: return None is_staking_kpi_met = self.positive_vote_threshold_reached - self.synchronized_data.update(is_staking_kpi_met=is_staking_kpi_met) + n_mech_requests = self.mech_request_count + + self.synchronized_data.update( + is_staking_kpi_met=is_staking_kpi_met, + n_mech_requests=n_mech_requests + ) return res diff --git a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py index 70c39408c..b94075304 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py @@ -230,6 +230,7 @@ def async_act(self) -> Generator: tx_submitter = self.matching_round.auto_round_id() betting_tx_hex = yield from self._prepare_safe_tx() wallet_balance = self.wallet_balance + token_balance = self.token_balance payload = BetPlacementPayload( agent, @@ -237,6 +238,7 @@ def async_act(self) -> Generator: betting_tx_hex, mocking_mode, wallet_balance, + token_balance ) yield from self.finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index b0f6ad169..27d07b68c 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -20,19 +20,25 @@ """This module contains the handler for the 'decision_maker_abci' skill.""" import json +import prometheus_client import re from datetime import datetime from enum import Enum from typing import Callable, Dict, Optional, Tuple, cast from urllib.parse import urlparse +import requests + from aea.protocols.base import Message +from aea_ledger_ethereum import EthereumApi +from prometheus_client import MetricsHandler, Gauge, generate_latest from packages.valory.connections.http_server.connection import ( PUBLIC_ID as HTTP_SERVER_PUBLIC_ID, ) from packages.valory.protocols.http.message import HttpMessage from packages.valory.protocols.ipfs import IpfsMessage +from packages.valory.skills.abstract_round_abci.base import LEDGER_API_ADDRESS from packages.valory.skills.abstract_round_abci.handlers import ( ABCIRoundHandler as BaseABCIRoundHandler, ) @@ -59,7 +65,6 @@ from packages.valory.skills.decision_maker_abci.models import SharedState from packages.valory.skills.decision_maker_abci.rounds import SynchronizedData - ABCIHandler = BaseABCIRoundHandler SigningHandler = BaseSigningHandler LedgerApiHandler = BaseLedgerApiHandler @@ -133,11 +138,13 @@ def setup(self) -> None: hostname_regex = rf".*({config_uri_base_hostname}|{propel_uri_base_hostname}|{local_ip_regex}|localhost|127.0.0.1|0.0.0.0)(:\d+)?" self.handler_url_regex = rf"{hostname_regex}\/.*" health_url_regex = rf"{hostname_regex}\/healthcheck" + metrics_url_regex = rf"{hostname_regex}\/metrics" # Routes self.routes = { (HttpMethod.GET.value, HttpMethod.HEAD.value): [ (health_url_regex, self._handle_get_health), + (metrics_url_regex, self._handle_get_metrics) ], } @@ -194,8 +201,8 @@ def handle(self, message: Message) -> None: # Check if this is a request sent from the http_server skill if ( - http_msg.performative != HttpMessage.Performative.REQUEST - or message.sender != str(HTTP_SERVER_PUBLIC_ID.without_hash()) + http_msg.performative != HttpMessage.Performative.REQUEST + or message.sender != str(HTTP_SERVER_PUBLIC_ID.without_hash()) ): super().handle(message) return @@ -230,7 +237,7 @@ def handle(self, message: Message) -> None: handler(http_msg, http_dialogue, **kwargs) def _handle_bad_request( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue + self, http_msg: HttpMessage, http_dialogue: HttpDialogue ) -> None: """ Handle a Http bad request. @@ -253,7 +260,7 @@ def _handle_bad_request( self.context.outbox.put_message(message=http_response) def _handle_get_health( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue + self, http_msg: HttpMessage, http_dialogue: HttpDialogue ) -> None: """ Handle a Http request of verb GET. @@ -284,9 +291,9 @@ def _handle_get_health( ) is_transitioning_fast = ( - not is_tm_unhealthy - and seconds_since_last_transition - < 2 * self.context.params.reset_pause_duration + not is_tm_unhealthy + and seconds_since_last_transition + < 2 * self.context.params.reset_pause_duration ) if round_sequence._abci_app: @@ -314,7 +321,7 @@ def _handle_get_health( self._send_ok_response(http_msg, http_dialogue, data) def _send_ok_response( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue, data: Dict + self, http_msg: HttpMessage, http_dialogue: HttpDialogue, data: Dict ) -> None: """Send an OK response with the provided data""" http_response = http_dialogue.reply( @@ -332,7 +339,7 @@ def _send_ok_response( self.context.outbox.put_message(message=http_response) def _send_not_found_response( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue + self, http_msg: HttpMessage, http_dialogue: HttpDialogue ) -> None: """Send an not found response""" http_response = http_dialogue.reply( @@ -351,8 +358,8 @@ def _send_not_found_response( def _check_required_funds(self) -> bool: """Check the agent has enough funds.""" return ( - self.synchronized_data.wallet_balance - > self.context.params.agent_balance_threshold + self.synchronized_data.wallet_balance + > self.context.params.agent_balance_threshold ) def _check_is_receiving_mech_responses(self) -> bool: @@ -360,7 +367,111 @@ def _check_is_receiving_mech_responses(self) -> bool: # Checks the most recent decision receive timestamp, which can only be returned after making a mech call # (an on chain transaction) return ( - self.synchronized_data.decision_receive_timestamp - < int(datetime.utcnow().timestamp()) - - self.context.params.expected_mech_response_time + self.synchronized_data.decision_receive_timestamp + < int(datetime.utcnow().timestamp()) + - self.context.params.expected_mech_response_time ) + + def _handle_get_metrics(self, http_msg, http_dialogue): + """ + Handle the /metrics endpoint. + """ + self.set_metrics() + # Generate the metrics data + metrics_data = generate_latest() + + # Create a response with the metrics data + http_response = http_dialogue.reply( + performative=HttpMessage.Performative.RESPONSE, + target_message=http_msg, + version=http_msg.version, + status_code=OK_CODE, + status_text="Success", + headers=f"Content-Type: {prometheus_client.CONTENT_TYPE_LATEST}\n{http_msg.headers}", + body=metrics_data, + ) + + # Send response + self.context.logger.info("Responding with metrics data") + self.context.outbox.put_message(message=http_response) + + def set_metrics(self): + agent_address = self.context.agent_address + safe_address = self.synchronized_data.safe_contract_address + service_id = self.context.params.on_chain_service_id + + native_balance = self.synchronized_data.wallet_balance + wxdai_balance = self.synchronized_data.token_balance + # staking_contract_available_slots = self.get_available_staking_slots(LEDGER_API_ADDRESS) + staking_state = self.synchronized_data.service_staking_state.value + time_since_last_successful_mech_tx = self.synchronized_data.decision_receive_timestamp + n_total_mech_requests = len(self.synchronized_data.mech_requests) + n_successful_mech_requests = len(self.synchronized_data.mech_responses) + n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests + + NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( + native_balance) + WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(wxdai_balance) + # STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.set(staking_contract_available_slots) + STAKING_STATE_GAUGE.labels(agent_address, safe_address, service_id).set(staking_state) + TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels(agent_address, safe_address, service_id).set( + time_since_last_successful_mech_tx) + TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_total_mech_requests) + TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) + TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) + + def get_available_staking_slots(self, + ledger_api: EthereumApi + ) -> int: + """Get available staking slots""" + staking_contract_address = self.context.params.staking_contract_address + + max_num_services = staking_contract_address.max_num_services( + ledger_api, staking_contract_address).pop("data") + + service_ids = staking_contract_address.get_service_ids( + ledger_api, staking_contract_address).pop("data") + + return max_num_services - len(service_ids) + + +NATIVE_BALANCE_GAUGE = Gauge("olas_agent_native_balance", + "Native token balance in xDai", + ['agent_address', 'operator_address', 'safe_address', 'service_id'] + ) + +OLAS_BALANCE_GAUGE = Gauge("olas_agent_olas_balance", + "OLAS token balance" + ) + +WXDAI_BALANCE_GAUGE = Gauge("olas_agent_wxdai_balance", + "WXDAI token balance" + ) + +STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE = Gauge("olas_staking_contract_available_slots", + "Number of available slots in the staking contract" + ) + +STAKING_STATE_GAUGE = Gauge("olas_agent_staked", + "Indicates if an agent is staked (1), not staked (0) or eviceted (2)" + ) + +TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE = Gauge("olas_agent_time_since_last_successful_tx", + "Time in seconds since last successful mech transaction" + ) + +TIME_SINCE_LAST_MECH_TX_ATTEMPT = Gauge("olas_agent_time_since_last_tx_attempt", + "Time in seconds since last transaction attempt (successful or not)" + ) + +TOTAL_MECH_TXS = Gauge("olas_agent_txs", + "Total number of transactions" + ) + +TOTAL_SUCCESSFUL_MECH_TXS = Gauge("olas_successful_agent_txs", + "Total successful number of transactions" + ) + +TOTAL_FAILED_MECH_TXS = Gauge("olas_failed_agent_txs", + "Total failed number of transaction" + ) diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 4ecfaa231..28f5229b9 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -476,6 +476,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.expected_mech_response_time = self._ensure( "expected_mech_response_time", kwargs, int ) + self.staking_contract_address = self._ensure( + "staking_contract_address", kwargs, str + ) super().__init__(*args, **kwargs) @property diff --git a/packages/valory/skills/decision_maker_abci/payloads.py b/packages/valory/skills/decision_maker_abci/payloads.py index 33ec183bb..1ad6096ac 100644 --- a/packages/valory/skills/decision_maker_abci/payloads.py +++ b/packages/valory/skills/decision_maker_abci/payloads.py @@ -119,3 +119,4 @@ class BetPlacementPayload(MultisigTxPayload): """Represents a transaction payload for placing a bet.""" wallet_balance: Optional[int] = None + token_balance: Optional[int] = None diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index fccbe682c..e934ad69f 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -105,6 +105,7 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne +- valory/check_stop_trading_abci:0.1.0:bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54 behaviours: main: args: {} @@ -317,6 +318,7 @@ models: response_timeout: 300 agent_balance_threshold: 10000000000000000 expected_mech_response_time: 300 + staking_contract_address: '0x2Ef503950Be67a98746F484DA0bBAdA339DF3326' class_name: DecisionMakerParams benchmarking_mode: args: diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 33bdc4638..e6be9775f 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -268,6 +268,19 @@ def service_staking_state(self) -> StakingState: """Get the service's staking state.""" return StakingState(self.db.get("service_staking_state", 0)) + @property + def n_mech_requests(self) -> int: + """Get the number of mech requests.""" + return int(self.db.get("n_mech_requests", 0)) + + @property + def token_balance(self) -> int: + """Get the token balance.""" + token_balance = self.db.get("token_balance", 0) + if token_balance is None: + return 0 + return int(token_balance) + class TxPreparationRound(CollectSameUntilThresholdRound): """A round for preparing a transaction.""" diff --git a/packages/valory/skills/decision_maker_abci/states/bet_placement.py b/packages/valory/skills/decision_maker_abci/states/bet_placement.py index 35e7c63f1..79976c754 100644 --- a/packages/valory/skills/decision_maker_abci/states/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/states/bet_placement.py @@ -46,6 +46,8 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: return None sync_data, event = update - wallet_balance = self.most_voted_payload_values[-1] - sync_data = sync_data.update(wallet_balance=wallet_balance) + wallet_balance = self.most_voted_payload_values[-2] + token_balance = self.most_voted_payload_values[-1] + sync_data = sync_data.update(wallet_balance=wallet_balance, + token_balance=token_balance) return sync_data, event diff --git a/poetry.lock b/poetry.lock index 7be6dc090..b334b426a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,14 +1,14 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" -version = "2.4.3" +version = "2.4.4" description = "Happy Eyeballs for asyncio" optional = false python-versions = ">=3.8" files = [ - {file = "aiohappyeyeballs-2.4.3-py3-none-any.whl", hash = "sha256:8a7a83727b2756f394ab2895ea0765a0a8c475e3c71e98d43d76f22b4b435572"}, - {file = "aiohappyeyeballs-2.4.3.tar.gz", hash = "sha256:75cf88a15106a5002a8eb1dab212525c00d1f4c0fa96e551c9fbe6f09a621586"}, + {file = "aiohappyeyeballs-2.4.4-py3-none-any.whl", hash = "sha256:a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8"}, + {file = "aiohappyeyeballs-2.4.4.tar.gz", hash = "sha256:5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745"}, ] [[package]] @@ -238,38 +238,36 @@ tests = ["PyHamcrest (>=2.0.2)", "mypy", "pytest (>=4.6)", "pytest-benchmark", " [[package]] name = "bcrypt" -version = "4.2.0" +version = "4.2.1" description = "Modern password hashing for your software and your servers" optional = false python-versions = ">=3.7" files = [ - {file = "bcrypt-4.2.0-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:096a15d26ed6ce37a14c1ac1e48119660f21b24cba457f160a4b830f3fe6b5cb"}, - {file = "bcrypt-4.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c02d944ca89d9b1922ceb8a46460dd17df1ba37ab66feac4870f6862a1533c00"}, - {file = "bcrypt-4.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1d84cf6d877918620b687b8fd1bf7781d11e8a0998f576c7aa939776b512b98d"}, - {file = "bcrypt-4.2.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:1bb429fedbe0249465cdd85a58e8376f31bb315e484f16e68ca4c786dcc04291"}, - {file = "bcrypt-4.2.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:655ea221910bcac76ea08aaa76df427ef8625f92e55a8ee44fbf7753dbabb328"}, - {file = "bcrypt-4.2.0-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:1ee38e858bf5d0287c39b7a1fc59eec64bbf880c7d504d3a06a96c16e14058e7"}, - {file = "bcrypt-4.2.0-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:0da52759f7f30e83f1e30a888d9163a81353ef224d82dc58eb5bb52efcabc399"}, - {file = "bcrypt-4.2.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:3698393a1b1f1fd5714524193849d0c6d524d33523acca37cd28f02899285060"}, - {file = "bcrypt-4.2.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:762a2c5fb35f89606a9fde5e51392dad0cd1ab7ae64149a8b935fe8d79dd5ed7"}, - {file = "bcrypt-4.2.0-cp37-abi3-win32.whl", hash = "sha256:5a1e8aa9b28ae28020a3ac4b053117fb51c57a010b9f969603ed885f23841458"}, - {file = "bcrypt-4.2.0-cp37-abi3-win_amd64.whl", hash = "sha256:8f6ede91359e5df88d1f5c1ef47428a4420136f3ce97763e31b86dd8280fbdf5"}, - {file = "bcrypt-4.2.0-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:c52aac18ea1f4a4f65963ea4f9530c306b56ccd0c6f8c8da0c06976e34a6e841"}, - {file = "bcrypt-4.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3bbbfb2734f0e4f37c5136130405332640a1e46e6b23e000eeff2ba8d005da68"}, - {file = "bcrypt-4.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3413bd60460f76097ee2e0a493ccebe4a7601918219c02f503984f0a7ee0aebe"}, - {file = "bcrypt-4.2.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:8d7bb9c42801035e61c109c345a28ed7e84426ae4865511eb82e913df18f58c2"}, - {file = "bcrypt-4.2.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3d3a6d28cb2305b43feac298774b997e372e56c7c7afd90a12b3dc49b189151c"}, - {file = "bcrypt-4.2.0-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:9c1c4ad86351339c5f320ca372dfba6cb6beb25e8efc659bedd918d921956bae"}, - {file = "bcrypt-4.2.0-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:27fe0f57bb5573104b5a6de5e4153c60814c711b29364c10a75a54bb6d7ff48d"}, - {file = "bcrypt-4.2.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:8ac68872c82f1add6a20bd489870c71b00ebacd2e9134a8aa3f98a0052ab4b0e"}, - {file = "bcrypt-4.2.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:cb2a8ec2bc07d3553ccebf0746bbf3d19426d1c6d1adbd4fa48925f66af7b9e8"}, - {file = "bcrypt-4.2.0-cp39-abi3-win32.whl", hash = "sha256:77800b7147c9dc905db1cba26abe31e504d8247ac73580b4aa179f98e6608f34"}, - {file = "bcrypt-4.2.0-cp39-abi3-win_amd64.whl", hash = "sha256:61ed14326ee023917ecd093ee6ef422a72f3aec6f07e21ea5f10622b735538a9"}, - {file = "bcrypt-4.2.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:39e1d30c7233cfc54f5c3f2c825156fe044efdd3e0b9d309512cc514a263ec2a"}, - {file = "bcrypt-4.2.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:f4f4acf526fcd1c34e7ce851147deedd4e26e6402369304220250598b26448db"}, - {file = "bcrypt-4.2.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:1ff39b78a52cf03fdf902635e4c81e544714861ba3f0efc56558979dd4f09170"}, - {file = "bcrypt-4.2.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:373db9abe198e8e2c70d12b479464e0d5092cc122b20ec504097b5f2297ed184"}, - {file = "bcrypt-4.2.0.tar.gz", hash = "sha256:cf69eaf5185fd58f268f805b505ce31f9b9fc2d64b376642164e9244540c1221"}, + {file = "bcrypt-4.2.1-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:1340411a0894b7d3ef562fb233e4b6ed58add185228650942bdc885362f32c17"}, + {file = "bcrypt-4.2.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1ee315739bc8387aa36ff127afc99120ee452924e0df517a8f3e4c0187a0f5f"}, + {file = "bcrypt-4.2.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8dbd0747208912b1e4ce730c6725cb56c07ac734b3629b60d4398f082ea718ad"}, + {file = "bcrypt-4.2.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:aaa2e285be097050dba798d537b6efd9b698aa88eef52ec98d23dcd6d7cf6fea"}, + {file = "bcrypt-4.2.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:76d3e352b32f4eeb34703370e370997065d28a561e4a18afe4fef07249cb4396"}, + {file = "bcrypt-4.2.1-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:b7703ede632dc945ed1172d6f24e9f30f27b1b1a067f32f68bf169c5f08d0425"}, + {file = "bcrypt-4.2.1-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:89df2aea2c43be1e1fa066df5f86c8ce822ab70a30e4c210968669565c0f4685"}, + {file = "bcrypt-4.2.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:04e56e3fe8308a88b77e0afd20bec516f74aecf391cdd6e374f15cbed32783d6"}, + {file = "bcrypt-4.2.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:cfdf3d7530c790432046c40cda41dfee8c83e29482e6a604f8930b9930e94139"}, + {file = "bcrypt-4.2.1-cp37-abi3-win32.whl", hash = "sha256:adadd36274510a01f33e6dc08f5824b97c9580583bd4487c564fc4617b328005"}, + {file = "bcrypt-4.2.1-cp37-abi3-win_amd64.whl", hash = "sha256:8c458cd103e6c5d1d85cf600e546a639f234964d0228909d8f8dbeebff82d526"}, + {file = "bcrypt-4.2.1-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:8ad2f4528cbf0febe80e5a3a57d7a74e6635e41af1ea5675282a33d769fba413"}, + {file = "bcrypt-4.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:909faa1027900f2252a9ca5dfebd25fc0ef1417943824783d1c8418dd7d6df4a"}, + {file = "bcrypt-4.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cde78d385d5e93ece5479a0a87f73cd6fa26b171c786a884f955e165032b262c"}, + {file = "bcrypt-4.2.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:533e7f3bcf2f07caee7ad98124fab7499cb3333ba2274f7a36cf1daee7409d99"}, + {file = "bcrypt-4.2.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:687cf30e6681eeda39548a93ce9bfbb300e48b4d445a43db4298d2474d2a1e54"}, + {file = "bcrypt-4.2.1-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:041fa0155c9004eb98a232d54da05c0b41d4b8e66b6fc3cb71b4b3f6144ba837"}, + {file = "bcrypt-4.2.1-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:f85b1ffa09240c89aa2e1ae9f3b1c687104f7b2b9d2098da4e923f1b7082d331"}, + {file = "bcrypt-4.2.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:c6f5fa3775966cca251848d4d5393ab016b3afed251163c1436fefdec3b02c84"}, + {file = "bcrypt-4.2.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:807261df60a8b1ccd13e6599c779014a362ae4e795f5c59747f60208daddd96d"}, + {file = "bcrypt-4.2.1-cp39-abi3-win32.whl", hash = "sha256:b588af02b89d9fad33e5f98f7838bf590d6d692df7153647724a7f20c186f6bf"}, + {file = "bcrypt-4.2.1-cp39-abi3-win_amd64.whl", hash = "sha256:e84e0e6f8e40a242b11bce56c313edc2be121cec3e0ec2d76fce01f6af33c07c"}, + {file = "bcrypt-4.2.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:76132c176a6d9953cdc83c296aeaed65e1a708485fd55abf163e0d9f8f16ce0e"}, + {file = "bcrypt-4.2.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e158009a54c4c8bc91d5e0da80920d048f918c61a581f0a63e4e93bb556d362f"}, + {file = "bcrypt-4.2.1.tar.gz", hash = "sha256:6765386e3ab87f569b276988742039baab087b2cdb01e809d74e74503c2faafe"}, ] [package.extras] @@ -2415,6 +2413,20 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "prometheus-client" +version = "0.21.1" +description = "Python client for the Prometheus monitoring system." +optional = false +python-versions = ">=3.8" +files = [ + {file = "prometheus_client-0.21.1-py3-none-any.whl", hash = "sha256:594b45c410d6f4f8888940fe80b5cc2521b305a1fafe1c58609ef715a001f301"}, + {file = "prometheus_client-0.21.1.tar.gz", hash = "sha256:252505a722ac04b0456be05c05f75f45d760c2911ffc45f2a06bcaed9f3ae3fb"}, +] + +[package.extras] +twisted = ["twisted"] + [[package]] name = "propcache" version = "0.2.0" @@ -3010,6 +3022,7 @@ files = [ {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, @@ -3017,8 +3030,16 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, @@ -3035,6 +3056,7 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -3042,6 +3064,7 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, @@ -3294,13 +3317,43 @@ files = [ [[package]] name = "tomli" -version = "2.1.0" +version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, - {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] [[package]] @@ -3443,13 +3496,13 @@ files = [ [[package]] name = "virtualenv" -version = "20.27.1" +version = "20.28.0" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" files = [ - {file = "virtualenv-20.27.1-py3-none-any.whl", hash = "sha256:f11f1b8a29525562925f745563bfd48b189450f61fb34c4f9cc79dd5aa32a1f4"}, - {file = "virtualenv-20.27.1.tar.gz", hash = "sha256:142c6be10212543b32c6c45d3d3893dff89112cc588b7d0879ae5a1ec03a47ba"}, + {file = "virtualenv-20.28.0-py3-none-any.whl", hash = "sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0"}, + {file = "virtualenv-20.28.0.tar.gz", hash = "sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa"}, ] [package.dependencies] @@ -3800,4 +3853,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "<3.12,>=3.8" -content-hash = "43c654a308c15072bda54f5c78ee81e355a9c7172183b4deeb3e61f2728eb6f8" +content-hash = "a85ee47682e65262566458132526bab127e65b966da955a26795710eb692cdc3" diff --git a/pyproject.toml b/pyproject.toml index 3afa98363..e951b93d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ jsonschema = "<4.4.0,>=4.3.0" openapi-core = "==0.15.0" openapi-spec-validator = "<0.5.0,>=0.4.0" pyinstaller = "==6.8.0" +prometheus_client = "==0.21.1" [tool.poetry.dependencies.tomte] version = "==0.2.17" From c97ef40e8bc4f8d672e3e9ab886cd0b81959bc58 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 13 Dec 2024 11:12:31 +0000 Subject: [PATCH 02/32] fix: metric labels --- .../skills/decision_maker_abci/handlers.py | 42 +++++++------------ .../skills/decision_maker_abci/models.py | 3 -- .../skills/decision_maker_abci/skill.yaml | 1 - 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index 27d07b68c..4e925bf4f 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -406,8 +406,8 @@ def set_metrics(self): staking_state = self.synchronized_data.service_staking_state.value time_since_last_successful_mech_tx = self.synchronized_data.decision_receive_timestamp n_total_mech_requests = len(self.synchronized_data.mech_requests) - n_successful_mech_requests = len(self.synchronized_data.mech_responses) - n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests + # n_successful_mech_requests = len(self.synchronized_data.mech_responses) + # n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( native_balance) @@ -417,61 +417,47 @@ def set_metrics(self): TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels(agent_address, safe_address, service_id).set( time_since_last_successful_mech_tx) TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_total_mech_requests) - TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) - TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) - - def get_available_staking_slots(self, - ledger_api: EthereumApi - ) -> int: - """Get available staking slots""" - staking_contract_address = self.context.params.staking_contract_address - - max_num_services = staking_contract_address.max_num_services( - ledger_api, staking_contract_address).pop("data") - - service_ids = staking_contract_address.get_service_ids( - ledger_api, staking_contract_address).pop("data") - - return max_num_services - len(service_ids) + # TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) + # TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) NATIVE_BALANCE_GAUGE = Gauge("olas_agent_native_balance", "Native token balance in xDai", - ['agent_address', 'operator_address', 'safe_address', 'service_id'] + ['agent_address', 'safe_address', 'service_id'] ) OLAS_BALANCE_GAUGE = Gauge("olas_agent_olas_balance", - "OLAS token balance" + "OLAS token balance", ['agent_address', 'safe_address', 'service_id'] ) WXDAI_BALANCE_GAUGE = Gauge("olas_agent_wxdai_balance", - "WXDAI token balance" + "WXDAI token balance", ['agent_address', 'safe_address', 'service_id'] ) STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE = Gauge("olas_staking_contract_available_slots", - "Number of available slots in the staking contract" + "Number of available slots in the staking contract", ['agent_address', 'safe_address', 'service_id'] ) STAKING_STATE_GAUGE = Gauge("olas_agent_staked", - "Indicates if an agent is staked (1), not staked (0) or eviceted (2)" + "Indicates if an agent is staked (1), not staked (0) or eviceted (2)", ['agent_address', 'safe_address', 'service_id'] ) TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE = Gauge("olas_agent_time_since_last_successful_tx", - "Time in seconds since last successful mech transaction" + "Time in seconds since last successful mech transaction", ['agent_address', 'safe_address', 'service_id'] ) TIME_SINCE_LAST_MECH_TX_ATTEMPT = Gauge("olas_agent_time_since_last_tx_attempt", - "Time in seconds since last transaction attempt (successful or not)" + "Time in seconds since last transaction attempt (successful or not)", ['agent_address', 'safe_address', 'service_id'] ) TOTAL_MECH_TXS = Gauge("olas_agent_txs", - "Total number of transactions" + "Total number of transactions", ['agent_address', 'safe_address', 'service_id'] ) TOTAL_SUCCESSFUL_MECH_TXS = Gauge("olas_successful_agent_txs", - "Total successful number of transactions" + "Total successful number of transactions", ['agent_address', 'safe_address', 'service_id'] ) TOTAL_FAILED_MECH_TXS = Gauge("olas_failed_agent_txs", - "Total failed number of transaction" + "Total failed number of transaction", ['agent_address', 'safe_address', 'service_id'] ) diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 28f5229b9..4ecfaa231 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -476,9 +476,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.expected_mech_response_time = self._ensure( "expected_mech_response_time", kwargs, int ) - self.staking_contract_address = self._ensure( - "staking_contract_address", kwargs, str - ) super().__init__(*args, **kwargs) @property diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index e934ad69f..6353e8a03 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -105,7 +105,6 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne -- valory/check_stop_trading_abci:0.1.0:bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54 behaviours: main: args: {} From b30afc89d14728c41d17aecf332bbfec1807111c Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 13 Dec 2024 16:29:24 +0000 Subject: [PATCH 03/32] chore: generators --- packages/packages.json | 16 ++++++++-------- packages/valory/agents/trader/aea-config.yaml | 10 +++++----- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 6 +++--- .../valory/skills/decision_maker_abci/skill.yaml | 13 +++++++------ .../valory/skills/market_manager_abci/skill.yaml | 1 + packages/valory/skills/trader_abci/skill.yaml | 8 ++++---- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 31 insertions(+), 29 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 20a41cbf4..eb7610925 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa", - "skill/valory/decision_maker_abci/0.1.0": "bafybeig3sqaeqedobqdg7gynrxnbq2kgzh4gp5pe5gxo5kw4hczfjmj6e4", - "skill/valory/trader_abci/0.1.0": "bafybeigm2oqol7yvbspdapdrq3hxugybwmaazom773ncsyz6mlgps7y3pi", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibx63ico4nlp6etvtzgvlcrl3jdy6rx7zodwmxhvvb4phizd732l4", + "skill/valory/market_manager_abci/0.1.0": "bafybeigmea7hrb42fj5v6pwjzww3vibvoov5qd7raiv5didzvrikxs242i", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiabhwbvcmheimoyhrn5i5nhvmdzsnvq43hf47gjkjkwrdashkgnsm", + "skill/valory/trader_abci/0.1.0": "bafybeidwyqluh2nc2mdje4qqburkpj7ys27mpy7gstrgji65xdyozruliq", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeih5klltrhdnktkfrux2qfm5fss4ff5zugktawqaizd3wa2ujl7gei", "skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54", - "agent/valory/trader/0.1.0": "bafybeifwqory3yuyhi6sxkoy3ihyzdbus444pkehyoxiibjqo5mjcawbhe", - "service/valory/trader/0.1.0": "bafybeiezli7klgpvdlvdkh7wxmulyosp7f3xzmkmdtzrgtcloqdng5qcea", - "service/valory/trader_pearl/0.1.0": "bafybeic52jtgilmipang6wcr3ogbfyskwzb7iaat3lur5pe7fjkpkqc7da" + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeig5da7v62ysxh2vwpdpk4fuyi7674l66ieevv7yz6twc4wjc4fcyu", + "agent/valory/trader/0.1.0": "bafybeie7sfxwpvd5xd5xziqrg4bunqg5wwwxaqg6mhqzf267sl45ox73om", + "service/valory/trader/0.1.0": "bafybeibfbiru2pqpynvwm5mqqaiqnevrvfyxxwl2sywwz6lglexkxvoqj4", + "service/valory/trader_pearl/0.1.0": "bafybeiexn2x6vztx7knv4sh43hqothp5rfdgejylfsq2jjbwpazb2vkqy4" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 9b19512a1..9efa134b2 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -45,12 +45,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibx63ico4nlp6etvtzgvlcrl3jdy6rx7zodwmxhvvb4phizd732l4 -- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa -- valory/decision_maker_abci:0.1.0:bafybeig3sqaeqedobqdg7gynrxnbq2kgzh4gp5pe5gxo5kw4hczfjmj6e4 -- valory/trader_abci:0.1.0:bafybeigm2oqol7yvbspdapdrq3hxugybwmaazom773ncsyz6mlgps7y3pi +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeih5klltrhdnktkfrux2qfm5fss4ff5zugktawqaizd3wa2ujl7gei +- valory/market_manager_abci:0.1.0:bafybeigmea7hrb42fj5v6pwjzww3vibvoov5qd7raiv5didzvrikxs242i +- valory/decision_maker_abci:0.1.0:bafybeiabhwbvcmheimoyhrn5i5nhvmdzsnvq43hf47gjkjkwrdashkgnsm +- valory/trader_abci:0.1.0:bafybeidwyqluh2nc2mdje4qqburkpj7ys27mpy7gstrgji65xdyozruliq - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne -- valory/check_stop_trading_abci:0.1.0:bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54 +- valory/check_stop_trading_abci:0.1.0:bafybeig5da7v62ysxh2vwpdpk4fuyi7674l66ieevv7yz6twc4wjc4fcyu - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index a1ea6c517..5c0408783 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:bafybeifwqory3yuyhi6sxkoy3ihyzdbus444pkehyoxiibjqo5mjcawbhe +agent: valory/trader:0.1.0:bafybeie7sfxwpvd5xd5xziqrg4bunqg5wwwxaqg6mhqzf267sl45ox73om number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 90e1c3d6f..bb7142bd7 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifwqory3yuyhi6sxkoy3ihyzdbus444pkehyoxiibjqo5mjcawbhe +agent: valory/trader:0.1.0:bafybeie7sfxwpvd5xd5xziqrg4bunqg5wwwxaqg6mhqzf267sl45ox73om number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 45c3db5eb..66acc1d77 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -8,13 +8,13 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeif2pq7fg5upl6vmfgfzpiwsh4nbk4zaeyz6upyucqi5tasrxgq4ee __init__.py: bafybeifc23rlw2hzhplp3wfceixnmwq5ztnixhh7jp4dd5av3crwp3x22a - behaviours.py: bafybeifdfqkczchnbfzzb4q2gwe3qqrn5ci2tk4mq65bunivjkw4scuzse + behaviours.py: bafybeibu25ofv2vgiul2jbc3naq7zssmjtk7sgytj2bnysc2reqvqnuhs4 dialogues.py: bafybeictrrnwcijiejczy23dfvbx5kujgef3dulzqhs3etl2juvz5spm2e fsm_specification.yaml: bafybeihhau35a5xclncjpxh5lg7qiw34xs4d5qlez7dnjpkf45d3gc57ai handlers.py: bafybeiard64fwxib3rtyp67ymhf222uongcyqhfhdyttpsyqkmyh5ajipu models.py: bafybeigwdhgianx5rizlb7ebmm6pdtkixh4uehbvu5c24ysvyvojs74dfq - payloads.py: bafybeidh5bqywun4chrbsci2xbcrnnzuys5sswxwbxq3yl2ksawi3xsi5q - rounds.py: bafybeift7b2afck4e5so2cpgyoywa76t6el6d4qwfoitvfdjw6kgf4fwie + payloads.py: bafybeigyuhfflh45oovhlwij3zgay4xjrrj2mt2pbhtxtughlimzn2jvgq + rounds.py: bafybeif3e23wbnb3niz6czhjo2xxat6mpqw3zt32dee7qnzwwsnhx43yue tests/__init__.py: bafybeihv2cjk4va5bc5ncqtppqg2xmmxcro34bma36trtvk32gtmhdycxu tests/test_dialogues.py: bafybeia5ac27w7ijx2nyx5dqyrnv4troo4572gjq7nrcxdncexoxucnqti tests/test_handlers.py: bafybeigpmtx2hyunzn6nxk2x4bvvybek7jvuhbk34fqlj7fgfsszcoqhxy diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 6353e8a03..68260a254 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,11 +9,12 @@ description: This skill is responsible for the decision making and placing the b license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: + .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky behaviours/base.py: bafybeifjgxzhwzxiky3okgtv4ojumm7fj7bom6qe3ysdvs3cpu32w446g4 - behaviours/bet_placement.py: bafybeia4listbfzsk4n4wkc4ycaftxgywjnl3mmpcqhuo3nwwia4n3oufu + behaviours/bet_placement.py: bafybeiho37vosp6eq7ezpufsiqjchmqdkt6f42qzq3uplu27gdwkfivz3e behaviours/blacklisting.py: bafybeifitqx2omj5qdwokizhqjkxvybtsyxo22dxkucbtxaocafzgbseku behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e @@ -29,17 +30,17 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeibf42562x3d5i66yf5p3vi6a2oolhwwxr32pjqtuxz5w4gmg3r4oa + handlers.py: bafybeibgmy5efawveds7t65ktrb4t6pn4agndg5riygkhoxqk57pf7zhhq io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm - payloads.py: bafybeif3d4qgj635rbnp6a5lgwhgbyilta6mtytjcej2jccorckxbuaev4 + payloads.py: bafybeihymeadb45ok6fyyt3xr24tds725vtj5p32vmbek4ap4awfamwwue policy.py: bafybeihlzs4o5e7yfmfzcvvrzkf4bhxfsg5gxnzsrpepwgfugh45gafye4 redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm rounds.py: bafybeiazjcsukgefair52aw37hhvxzlopnzqqmi4ntqrinakljlcm4kt4a states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeifkip6bw3oacpnyhko7fi3i72nv2fc33ld6bkr2myaay4qa2ybcie - states/bet_placement.py: bafybeih5eopyxubczys5u5t3bdxbxpc7mmfdyqrpqsbm2uha5jc2phza4i + states/base.py: bafybeifmvkedliabzlkbkydyzvaqomekbzwwcxwff2h6cnn5tc5qwmuavi + states/bet_placement.py: bafybeiaxfj6ni5pgw65c7zq74eekkfwnq3b2d27ifqf6alepy5zezsuhze states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni states/claim_subscription.py: bafybeiampifhdoztggwj6gthl2hfzecmjcwnm6nic2o47q4je7j4x3ujne @@ -101,7 +102,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa +- valory/market_manager_abci:0.1.0:bafybeigmea7hrb42fj5v6pwjzww3vibvoov5qd7raiv5didzvrikxs242i - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 44e6f05ad..114979617 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -6,6 +6,7 @@ description: This skill implements the MarketManager for an AEA. license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: + .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e behaviours.py: bafybeifzt6vykvvgr5rtzmzdbo7bfsxi765xsljdfrktrq35ogf6cdhmna diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 2a005c7d4..39eca5926 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,11 +26,11 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa -- valory/decision_maker_abci:0.1.0:bafybeig3sqaeqedobqdg7gynrxnbq2kgzh4gp5pe5gxo5kw4hczfjmj6e4 -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibx63ico4nlp6etvtzgvlcrl3jdy6rx7zodwmxhvvb4phizd732l4 +- valory/market_manager_abci:0.1.0:bafybeigmea7hrb42fj5v6pwjzww3vibvoov5qd7raiv5didzvrikxs242i +- valory/decision_maker_abci:0.1.0:bafybeiabhwbvcmheimoyhrn5i5nhvmdzsnvq43hf47gjkjkwrdashkgnsm +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeih5klltrhdnktkfrux2qfm5fss4ff5zugktawqaizd3wa2ujl7gei - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne -- valory/check_stop_trading_abci:0.1.0:bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54 +- valory/check_stop_trading_abci:0.1.0:bafybeig5da7v62ysxh2vwpdpk4fuyi7674l66ieevv7yz6twc4wjc4fcyu - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 3f2dfba78..7eff2b2cd 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeig3sqaeqedobqdg7gynrxnbq2kgzh4gp5pe5gxo5kw4hczfjmj6e4 +- valory/decision_maker_abci:0.1.0:bafybeiabhwbvcmheimoyhrn5i5nhvmdzsnvq43hf47gjkjkwrdashkgnsm - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 829bdd4a7d0808d62e0d960bc3248cd6539204e4 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 16 Dec 2024 14:59:48 +0000 Subject: [PATCH 04/32] chore: generators --- packages/packages.json | 6 +++--- packages/valory/agents/trader/aea-config.yaml | 1 + packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index eb7610925..baf9bf9fc 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -21,9 +21,9 @@ "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeih5klltrhdnktkfrux2qfm5fss4ff5zugktawqaizd3wa2ujl7gei", "skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeig5da7v62ysxh2vwpdpk4fuyi7674l66ieevv7yz6twc4wjc4fcyu", - "agent/valory/trader/0.1.0": "bafybeie7sfxwpvd5xd5xziqrg4bunqg5wwwxaqg6mhqzf267sl45ox73om", - "service/valory/trader/0.1.0": "bafybeibfbiru2pqpynvwm5mqqaiqnevrvfyxxwl2sywwz6lglexkxvoqj4", - "service/valory/trader_pearl/0.1.0": "bafybeiexn2x6vztx7knv4sh43hqothp5rfdgejylfsq2jjbwpazb2vkqy4" + "agent/valory/trader/0.1.0": "bafybeibz23lg4dlrefhny5qqg3vzc67jlxwez7svlslip7lq2lxwcpltdm", + "service/valory/trader/0.1.0": "bafybeihiyrkhx7soxt5v6abumih24hulqruef3nop55ejyovwzjwbr3lcy", + "service/valory/trader_pearl/0.1.0": "bafybeiera4x3omlzvw53nemulpl2twm7mlolg2xnfixall5hrw2ioizuhm" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 9efa134b2..adbb9739e 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -29,6 +29,7 @@ contracts: - valory/service_staking_token:0.1.0:bafybeihhcs3ewwzhy7yto4y36uqmice3pdvyl54fvxxv6jsxonesie4dxu - valory/transfer_nft_condition:0.1.0:bafybeid6z2tf7nc4rhwggktxk5f62bowxdczykrxc3y76sbt2ttlw5hmtq - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi +- valory/relayer:0.1.0:bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4 protocols: - open_aea/signing:1.0.0:bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi - valory/abci:0.1.0:bafybeiaqmp7kocbfdboksayeqhkbrynvlfzsx4uy4x6nohywnmaig4an7u diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 5c0408783..ba84ceebb 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:bafybeie7sfxwpvd5xd5xziqrg4bunqg5wwwxaqg6mhqzf267sl45ox73om +agent: valory/trader:0.1.0:bafybeibz23lg4dlrefhny5qqg3vzc67jlxwez7svlslip7lq2lxwcpltdm number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index bb7142bd7..1fa70b4c0 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeie7sfxwpvd5xd5xziqrg4bunqg5wwwxaqg6mhqzf267sl45ox73om +agent: valory/trader:0.1.0:bafybeibz23lg4dlrefhny5qqg3vzc67jlxwez7svlslip7lq2lxwcpltdm number_of_agents: 1 deployment: agent: From aa31df2859d846fabe27f378bc467167c3e6ca76 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 16 Dec 2024 15:03:36 +0000 Subject: [PATCH 05/32] chore: generators --- packages/packages.json | 16 ++++++++-------- packages/valory/agents/trader/aea-config.yaml | 10 +++++----- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 6 +++--- .../valory/skills/decision_maker_abci/skill.yaml | 13 +++++++------ packages/valory/skills/trader_abci/skill.yaml | 8 ++++---- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index cb67b674d..a23979068 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi", - "skill/valory/decision_maker_abci/0.1.0": "bafybeiddnmcquiuznts67ridhpnaqw2y3rrt4nfau5kjm74zhk5lhjxi2q", - "skill/valory/trader_abci/0.1.0": "bafybeiemjz3ca7la7jkeqdr7hxo7fa77xe2fkfadzb53gdkji7abpl2eiu", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeietwknem7iiood6pwkfup322ywwjmdrmdapllrcms6jpeev5w2qfe", + "skill/valory/market_manager_abci/0.1.0": "bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4", + "skill/valory/trader_abci/0.1.0": "bafybeiecarxwf3clvnfnpwyspaxcw4iqyuol4nctripb6g6kvbgetesj4a", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidchhmoaxcyhnohl5rwywicqyr234kf5ojc46mdsbw6dulr4l2zsu", "skill/valory/staking_abci/0.1.0": "bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeieduekpd4zbvjztyxyooppqnmjvup6jfp74uo6hhupvtvzzscdzkq", - "agent/valory/trader/0.1.0": "bafybeihq257kwjybsvrpzhjx4wbretrsurodpckjqdhv3idlnbu4mqvfnq", - "service/valory/trader/0.1.0": "bafybeihr6m4lec5r6kuf2zikusgyqilqwhwlpyehufyndjuziylr73dlqe", - "service/valory/trader_pearl/0.1.0": "bafybeibfqhsrtekx6nvwpz2nbbjyobljcahe6wz6jikyebt7opzxlal45u" + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy", + "agent/valory/trader/0.1.0": "bafybeicu5kvhhtgstsw2im355l4qjptlcjdkblk5xkszdqmiibvzqrapde", + "service/valory/trader/0.1.0": "bafybeigr6c4qaeze6iqpxbe2yatwnfqydqclf65z5wrrqxnpuhvevlq6uy", + "service/valory/trader_pearl/0.1.0": "bafybeib52clx2k4xhvhgj53lxsy4jbbfm4j6wjx5oqa73gjr4myvgrnjzy" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 6c5dcd494..794269fc1 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,12 +46,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeietwknem7iiood6pwkfup322ywwjmdrmdapllrcms6jpeev5w2qfe -- valory/market_manager_abci:0.1.0:bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi -- valory/decision_maker_abci:0.1.0:bafybeiddnmcquiuznts67ridhpnaqw2y3rrt4nfau5kjm74zhk5lhjxi2q -- valory/trader_abci:0.1.0:bafybeiemjz3ca7la7jkeqdr7hxo7fa77xe2fkfadzb53gdkji7abpl2eiu +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidchhmoaxcyhnohl5rwywicqyr234kf5ojc46mdsbw6dulr4l2zsu +- valory/market_manager_abci:0.1.0:bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq +- valory/decision_maker_abci:0.1.0:bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4 +- valory/trader_abci:0.1.0:bafybeiecarxwf3clvnfnpwyspaxcw4iqyuol4nctripb6g6kvbgetesj4a - valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeieduekpd4zbvjztyxyooppqnmjvup6jfp74uo6hhupvtvzzscdzkq +- valory/check_stop_trading_abci:0.1.0:bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 3f33c0a3c..9ce262efe 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:bafybeihq257kwjybsvrpzhjx4wbretrsurodpckjqdhv3idlnbu4mqvfnq +agent: valory/trader:0.1.0:bafybeicu5kvhhtgstsw2im355l4qjptlcjdkblk5xkszdqmiibvzqrapde number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 88e6cefea..76d78eb9c 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeihq257kwjybsvrpzhjx4wbretrsurodpckjqdhv3idlnbu4mqvfnq +agent: valory/trader:0.1.0:bafybeicu5kvhhtgstsw2im355l4qjptlcjdkblk5xkszdqmiibvzqrapde number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index d37ff0def..e147e3ea2 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -8,13 +8,13 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeif2pq7fg5upl6vmfgfzpiwsh4nbk4zaeyz6upyucqi5tasrxgq4ee __init__.py: bafybeifc23rlw2hzhplp3wfceixnmwq5ztnixhh7jp4dd5av3crwp3x22a - behaviours.py: bafybeie5mkpxsd6z3vjsoacvswin6zz4q4um5gqp6jhwtn65fepx2kma3m + behaviours.py: bafybeibj2sckgorqe4zugak6typbqwev6ot6e6thwelebrzm44gpqxi54i dialogues.py: bafybeictrrnwcijiejczy23dfvbx5kujgef3dulzqhs3etl2juvz5spm2e fsm_specification.yaml: bafybeihhau35a5xclncjpxh5lg7qiw34xs4d5qlez7dnjpkf45d3gc57ai handlers.py: bafybeiard64fwxib3rtyp67ymhf222uongcyqhfhdyttpsyqkmyh5ajipu models.py: bafybeigwdhgianx5rizlb7ebmm6pdtkixh4uehbvu5c24ysvyvojs74dfq - payloads.py: bafybeidh5bqywun4chrbsci2xbcrnnzuys5sswxwbxq3yl2ksawi3xsi5q - rounds.py: bafybeift7b2afck4e5so2cpgyoywa76t6el6d4qwfoitvfdjw6kgf4fwie + payloads.py: bafybeigyuhfflh45oovhlwij3zgay4xjrrj2mt2pbhtxtughlimzn2jvgq + rounds.py: bafybeif3e23wbnb3niz6czhjo2xxat6mpqw3zt32dee7qnzwwsnhx43yue tests/__init__.py: bafybeihv2cjk4va5bc5ncqtppqg2xmmxcro34bma36trtvk32gtmhdycxu tests/test_dialogues.py: bafybeia5ac27w7ijx2nyx5dqyrnv4troo4572gjq7nrcxdncexoxucnqti tests/test_handlers.py: bafybeigpmtx2hyunzn6nxk2x4bvvybek7jvuhbk34fqlj7fgfsszcoqhxy diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index cf113fe63..0cbd6c46e 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,11 +9,12 @@ description: This skill is responsible for the decision making and placing the b license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: + .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky behaviours/base.py: bafybeieqvxpzjnwjgq4ffhjojle2q7onif44nefrlza6pxriewisqcm324 - behaviours/bet_placement.py: bafybeia4listbfzsk4n4wkc4ycaftxgywjnl3mmpcqhuo3nwwia4n3oufu + behaviours/bet_placement.py: bafybeiho37vosp6eq7ezpufsiqjchmqdkt6f42qzq3uplu27gdwkfivz3e behaviours/blacklisting.py: bafybeicah7vcruhbakrhpsxdmw3ftq72o5e3plfhhqsnvhk3vk6iud6og4 behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e @@ -29,17 +30,17 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeibf42562x3d5i66yf5p3vi6a2oolhwwxr32pjqtuxz5w4gmg3r4oa + handlers.py: bafybeibgmy5efawveds7t65ktrb4t6pn4agndg5riygkhoxqk57pf7zhhq io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm - payloads.py: bafybeif3d4qgj635rbnp6a5lgwhgbyilta6mtytjcej2jccorckxbuaev4 + payloads.py: bafybeihymeadb45ok6fyyt3xr24tds725vtj5p32vmbek4ap4awfamwwue policy.py: bafybeihlzs4o5e7yfmfzcvvrzkf4bhxfsg5gxnzsrpepwgfugh45gafye4 redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm rounds.py: bafybeiazjcsukgefair52aw37hhvxzlopnzqqmi4ntqrinakljlcm4kt4a states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeiatr6cqa3juxkhm6p4h7dhol7tfmxh2fo6nr2gtc6wuwyrtu3k3xm - states/bet_placement.py: bafybeih5eopyxubczys5u5t3bdxbxpc7mmfdyqrpqsbm2uha5jc2phza4i + states/base.py: bafybeiay2ow7sybt3ihajuogqgbtndi3zkoxycq5vdlq7qg7muh5y2vckm + states/bet_placement.py: bafybeiaxfj6ni5pgw65c7zq74eekkfwnq3b2d27ifqf6alepy5zezsuhze states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni states/claim_subscription.py: bafybeiampifhdoztggwj6gthl2hfzecmjcwnm6nic2o47q4je7j4x3ujne @@ -101,7 +102,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi +- valory/market_manager_abci:0.1.0:bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 96451c908..c3a43194b 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,11 +26,11 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi -- valory/decision_maker_abci:0.1.0:bafybeiddnmcquiuznts67ridhpnaqw2y3rrt4nfau5kjm74zhk5lhjxi2q -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeietwknem7iiood6pwkfup322ywwjmdrmdapllrcms6jpeev5w2qfe +- valory/market_manager_abci:0.1.0:bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq +- valory/decision_maker_abci:0.1.0:bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidchhmoaxcyhnohl5rwywicqyr234kf5ojc46mdsbw6dulr4l2zsu - valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeieduekpd4zbvjztyxyooppqnmjvup6jfp74uo6hhupvtvzzscdzkq +- valory/check_stop_trading_abci:0.1.0:bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 367792b9d..6b50295c0 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeiddnmcquiuznts67ridhpnaqw2y3rrt4nfau5kjm74zhk5lhjxi2q +- valory/decision_maker_abci:0.1.0:bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4 - valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From a4fdacdb1b4d8c5a331dd3a1d6ec394cf1f3dff9 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Tue, 17 Dec 2024 17:21:35 +0000 Subject: [PATCH 06/32] refactor: move wallet balance to market manager --- .../decision_maker_abci/behaviours/base.py | 82 ++++++++--------- .../skills/decision_maker_abci/handlers.py | 16 ++-- .../skills/decision_maker_abci/payloads.py | 3 +- .../skills/decision_maker_abci/skill.yaml | 1 + .../skills/decision_maker_abci/states/base.py | 16 ++-- .../decision_maker_abci/states/sampling.py | 2 +- .../skills/market_manager_abci/behaviours.py | 89 ++++++++++++++++++- .../skills/market_manager_abci/payloads.py | 2 + .../skills/market_manager_abci/rounds.py | 46 +++++++++- .../skills/market_manager_abci/skill.yaml | 4 +- 10 files changed, 200 insertions(+), 61 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/base.py b/packages/valory/skills/decision_maker_abci/behaviours/base.py index 805518b7b..6e55d49ec 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/base.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/base.py @@ -109,8 +109,8 @@ class DecisionMakerBaseBehaviour(BetsManagerBehaviour, ABC): def __init__(self, **kwargs: Any) -> None: """Initialize the bet placement behaviour.""" super().__init__(**kwargs) - self.token_balance = 0 - self.wallet_balance = 0 + # self.token_balance = 0 + # self.wallet_balance = 0 self.multisend_batches: List[MultisendBatch] = [] self.multisend_data = b"" self._safe_tx_hash = "" @@ -265,22 +265,22 @@ def is_first_period(self) -> bool: or self.shared_state.mock_data is None ) - @property - def sampled_bet(self) -> Bet: - """Get the sampled bet and reset the bets list.""" - self.read_bets() - bet_index = self.synchronized_data.sampled_bet_index - return self.bets[bet_index] - - @property - def collateral_token(self) -> str: - """Get the contract address of the token that the market maker supports.""" - return self.sampled_bet.collateralToken - - @property - def is_wxdai(self) -> bool: - """Get whether the collateral address is wxDAI.""" - return self.collateral_token.lower() == WXDAI.lower() + # @property + # def sampled_bet(self) -> Bet: + # """Get the sampled bet and reset the bets list.""" + # self.read_bets() + # bet_index = self.synchronized_data.sampled_bet_index + # return self.bets[bet_index] + + # @property + # def collateral_token(self) -> str: + # """Get the contract address of the token that the market maker supports.""" + # return self.sampled_bet.collateralToken + # + # @property + # def is_wxdai(self) -> bool: + # """Get whether the collateral address is wxDAI.""" + # return self.collateral_token.lower() == WXDAI.lower() @staticmethod def wei_to_native(wei: int) -> float: @@ -325,29 +325,31 @@ def check_balance(self) -> WaitableConditionType: self._mock_balance_check() return True - response_msg = yield from self.get_contract_api_response( - performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore - contract_address=self.collateral_token, - contract_id=str(ERC20.contract_id), - contract_callable="check_balance", - account=self.synchronized_data.safe_contract_address, - ) - if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION: - self.context.logger.error( - f"Could not calculate the balance of the safe: {response_msg}" - ) - return False - - token = response_msg.raw_transaction.body.get("token", None) - wallet = response_msg.raw_transaction.body.get("wallet", None) - if token is None or wallet is None: - self.context.logger.error( - f"Something went wrong while trying to get the balance of the safe: {response_msg}" - ) - return False + # response_msg = yield from self.get_contract_api_response( + # performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore + # contract_address=self.collateral_token, + # contract_id=str(ERC20.contract_id), + # contract_callable="check_balance", + # account=self.synchronized_data.safe_contract_address, + # ) + # if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION: + # self.context.logger.error( + # f"Could not calculate the balance of the safe: {response_msg}" + # ) + # return False + # + # token = response_msg.raw_transaction.body.get("token", None) + # wallet = response_msg.raw_transaction.body.get("wallet", None) + # if token is None or wallet is None: + # self.context.logger.error( + # f"Something went wrong while trying to get the balance of the safe: {response_msg}" + # ) + # return False + # + # self.token_balance = int(token) + # self.wallet_balance = int(wallet) + yield from self.wait_for_condition_with_sleep(self.get_balance) - self.token_balance = int(token) - self.wallet_balance = int(wallet) self._report_balance() return True diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index 4e925bf4f..bb4ebb1c7 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -58,6 +58,7 @@ from packages.valory.skills.abstract_round_abci.handlers import ( TendermintHandler as BaseTendermintHandler, ) +from packages.valory.skills.decision_maker_abci.behaviours.base import DecisionMakerBaseBehaviour from packages.valory.skills.decision_maker_abci.dialogues import ( HttpDialogue, HttpDialogues, @@ -400,25 +401,26 @@ def set_metrics(self): safe_address = self.synchronized_data.safe_contract_address service_id = self.context.params.on_chain_service_id - native_balance = self.synchronized_data.wallet_balance + native_balance = DecisionMakerBaseBehaviour.wei_to_native(self.synchronized_data.wallet_balance) wxdai_balance = self.synchronized_data.token_balance # staking_contract_available_slots = self.get_available_staking_slots(LEDGER_API_ADDRESS) staking_state = self.synchronized_data.service_staking_state.value time_since_last_successful_mech_tx = self.synchronized_data.decision_receive_timestamp - n_total_mech_requests = len(self.synchronized_data.mech_requests) - # n_successful_mech_requests = len(self.synchronized_data.mech_responses) - # n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests + n_total_mech_requests = self.synchronized_data.n_mech_requests + n_successful_mech_requests = len(self.synchronized_data.mech_responses) + n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( native_balance) + # OLAS_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(1) WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(wxdai_balance) # STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.set(staking_contract_available_slots) STAKING_STATE_GAUGE.labels(agent_address, safe_address, service_id).set(staking_state) TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels(agent_address, safe_address, service_id).set( - time_since_last_successful_mech_tx) + time_since_last_successful_mech_tx) TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_total_mech_requests) - # TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) - # TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) + TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) + TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) NATIVE_BALANCE_GAUGE = Gauge("olas_agent_native_balance", diff --git a/packages/valory/skills/decision_maker_abci/payloads.py b/packages/valory/skills/decision_maker_abci/payloads.py index 1ad6096ac..3859fdf8a 100644 --- a/packages/valory/skills/decision_maker_abci/payloads.py +++ b/packages/valory/skills/decision_maker_abci/payloads.py @@ -39,9 +39,10 @@ class DecisionReceivePayload(UpdateBetsPayload): @dataclass(frozen=True) -class SamplingPayload(UpdateBetsPayload): +class SamplingPayload(BaseTxPayload): """Represents a transaction payload for the sampling of a bet.""" + bets_hash: Optional[str] index: Optional[int] benchmarking_finished: Optional[bool] day_increased: Optional[bool] diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 0cbd6c46e..e7fce9ffe 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -106,6 +106,7 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq +- valory/check_stop_trading_abci:0.1.0:bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy behaviours: main: args: {} diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 5cbdf4f7a..c89f93371 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -246,14 +246,14 @@ def mech_responses(self) -> List[MechInteractionResponse]: serialized = "[]" responses = json.loads(serialized) return [MechInteractionResponse(**response_item) for response_item in responses] - - @property - def wallet_balance(self) -> int: - """Get the balance of the wallet.""" - wallet_balance = self.db.get("wallet_balance", 0) - if wallet_balance is None: - return 0 - return int(wallet_balance) + # + # @property + # def wallet_balance(self) -> int: + # """Get the balance of the wallet.""" + # wallet_balance = self.db.get("wallet_balance", 0) + # if wallet_balance is None: + # return 0 + # return int(wallet_balance) @property def decision_receive_timestamp(self) -> int: diff --git a/packages/valory/skills/decision_maker_abci/states/sampling.py b/packages/valory/skills/decision_maker_abci/states/sampling.py index dbbf08461..675db9e8b 100644 --- a/packages/valory/skills/decision_maker_abci/states/sampling.py +++ b/packages/valory/skills/decision_maker_abci/states/sampling.py @@ -43,7 +43,7 @@ class SamplingRound(UpdateBetsRound): none_event = Event.NONE no_majority_event = Event.NO_MAJORITY selection_key: Any = ( - UpdateBetsRound.selection_key, + get_name(SynchronizedData.bets_hash), get_name(SynchronizedData.sampled_bet_index), get_name(SynchronizedData.benchmarking_finished), get_name(SynchronizedData.simulated_day), diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 999523130..734180ac4 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -27,6 +27,9 @@ from aea.helpers.ipfs.base import IPFSHashOnly +from packages.valory.contracts.erc20.contract import ERC20 +from packages.valory.contracts.staking_token.contract import StakingTokenContract +from packages.valory.protocols.contract_api import ContractApiMessage from packages.valory.skills.abstract_round_abci.behaviour_utils import BaseBehaviour from packages.valory.skills.abstract_round_abci.behaviours import AbstractRoundBehaviour from packages.valory.skills.market_manager_abci.bets import ( @@ -42,14 +45,17 @@ from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import ( MarketManagerAbciApp, - UpdateBetsRound, + UpdateBetsRound, SynchronizedData, ) +WaitableConditionType = Generator[None, None, bool] + BETS_FILENAME = "bets.json" MULTI_BETS_FILENAME = "multi_bets.json" READ_MODE = "r" WRITE_MODE = "w" +WXDAI = "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" class BetsManagerBehaviour(BaseBehaviour, ABC): @@ -61,6 +67,36 @@ def __init__(self, **kwargs: Any) -> None: self.bets: List[Bet] = [] self.multi_bets_filepath: str = self.params.store_path / MULTI_BETS_FILENAME self.bets_filepath: str = self.params.store_path / BETS_FILENAME + self.token_balance = 0 + self.wallet_balance = 0 + self.native_balance = 0 + + @property + def synchronized_data(self) -> SynchronizedData: + """Return the synchronized data.""" + return SynchronizedData(super().synchronized_data.db) + + @property + def sampled_bet(self) -> Bet: + """Get the sampled bet and reset the bets list.""" + self.read_bets() + bet_index = self.synchronized_data.sampled_bet_index + return self.bets[bet_index] + + @property + def collateral_token(self) -> str: + """Get the contract address of the token that the market maker supports.""" + return self.sampled_bet.collateralToken + + @property + def is_wxdai(self) -> bool: + """Get whether the collateral address is wxDAI.""" + return self.collateral_token.lower() == WXDAI.lower() + + # @staticmethod + # def wei_to_native(wei: int) -> float: + # """Convert WEI to native token.""" + # return wei / 10**18 def store_bets(self) -> None: """Store the bets to the agent's data dir as JSON.""" @@ -113,6 +149,48 @@ def hash_stored_bets(self) -> str: """Get the hash of the stored bets' file.""" return IPFSHashOnly.hash_file(self.multi_bets_filepath) + def get_balance(self) -> WaitableConditionType: + """Get the safe's balance.""" + + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore + contract_address=self.collateral_token, + contract_id=str(ERC20.contract_id), + contract_callable="check_balance", + account=self.synchronized_data.safe_contract_address, + ) + if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION: + self.context.logger.error( + f"Could not calculate the balance of the safe: {response_msg}" + ) + return False + + token = response_msg.raw_transaction.body.get("token", None) + wallet = response_msg.raw_transaction.body.get("wallet", None) + if token is None or wallet is None: + self.context.logger.error( + f"Something went wrong while trying to get the balance of the safe: {response_msg}" + ) + return False + + self.token_balance = int(token) + self.wallet_balance = int(wallet) + return True + + def get_olas_balance(self) -> WaitableConditionType: + """Get the safe's olas balance.""" + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore + contract_address="0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f", + contract_id=str(StakingTokenContract.contract_id), + contract_callable="check_balance", + account=self.synchronized_data.safe_contract_address, + ) + if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION: + self.context.logger.error( + f"Could not calculate the balance of the safe: {response_msg}" + ) + return False class UpdateBetsBehaviour(BetsManagerBehaviour, QueryingBehaviour): """Behaviour that fetches and updates the bets.""" @@ -217,8 +295,15 @@ def async_act(self) -> Generator: # Store the bets to the agent's data dir as JSON self.store_bets() + # set the balances + self.get_balance() + wallet_balance = self.wallet_balance + token_balance = self.token_balance + + print(f"WALLET BALANCE: {wallet_balance}") + bets_hash = self.hash_stored_bets() if self.bets else None - payload = UpdateBetsPayload(self.context.agent_address, bets_hash) + payload = UpdateBetsPayload(self.context.agent_address, bets_hash, wallet_balance, token_balance) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): yield from self.send_a2a_transaction(payload) diff --git a/packages/valory/skills/market_manager_abci/payloads.py b/packages/valory/skills/market_manager_abci/payloads.py index d7247c415..3a7145233 100644 --- a/packages/valory/skills/market_manager_abci/payloads.py +++ b/packages/valory/skills/market_manager_abci/payloads.py @@ -30,3 +30,5 @@ class UpdateBetsPayload(BaseTxPayload): """A transaction payload for the updated bets.""" bets_hash: Optional[str] + wallet_balance: Optional[int] + token_balance: Optional[int] diff --git a/packages/valory/skills/market_manager_abci/rounds.py b/packages/valory/skills/market_manager_abci/rounds.py index 1ac5dc8be..e1644df09 100644 --- a/packages/valory/skills/market_manager_abci/rounds.py +++ b/packages/valory/skills/market_manager_abci/rounds.py @@ -73,6 +73,46 @@ def is_checkpoint_reached(self) -> bool: """Check if the checkpoint is reached.""" return bool(self.db.get("is_checkpoint_reached", False)) + @property + def wallet_balance(self) -> int: + """Get the wallet balance.""" + wallet_balance = self.db.get("wallet_balance", 0) + if wallet_balance is None: + return 0 + return int(wallet_balance) + + @property + def token_balance(self) -> int: + """Get the wallet balance.""" + token_balance = self.db.get("token_balance", 0) + if token_balance is None: + return 0 + return int(token_balance) + + @property + def sampled_bet_index(self) -> int: + """Get the sampled bet.""" + sampled_bet_index = self.db.get("sampled_bet_index", 0) + if sampled_bet_index is None: + return 0 + return int(sampled_bet_index) + + # @property + # def native_balance(self) -> int: + # """Get the native balance.""" + # native_balance = self.db.get("native_balance", 0) + # if native_balance is None: + # return 0 + # return int(native_balance) + # + # @property + # def wxdai_balance(self) -> int: + # """Get the xdai balance.""" + # wxdai_balance = self.db.get("wxdai_balance", 0) + # if wxdai_balance is None: + # return 0 + # return int(wxdai_balance) + class MarketManagerAbstractRound(AbstractRound[Event], ABC): """Abstract round for the MarketManager skill.""" @@ -98,7 +138,11 @@ class UpdateBetsRound(CollectSameUntilThresholdRound, MarketManagerAbstractRound done_event: Enum = Event.DONE none_event: Enum = Event.FETCH_ERROR no_majority_event: Enum = Event.NO_MAJORITY - selection_key = get_name(SynchronizedData.bets_hash) + selection_key = ( + get_name(SynchronizedData.bets_hash), + get_name(SynchronizedData.wallet_balance), + get_name(SynchronizedData.token_balance) + ) collection_key = get_name(SynchronizedData.participant_to_bets_hash) synchronized_data_class = SynchronizedData diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index ef1e97cc5..87c6b0377 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -33,9 +33,11 @@ fingerprint: tests/test_rounds.py: bafybeidahkavof43y3o4omnihh6yxdx7gqofio7kzukdydymxbebylempu fingerprint_ignore_patterns: [] connections: [] -contracts: [] +contracts: +- valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae +- valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u behaviours: From 47caf37f491b8ddaf552badbab35ad17c23110c1 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Wed, 18 Dec 2024 16:46:39 +0000 Subject: [PATCH 07/32] enhance: add staking contract slots to metrics endpoint --- .../behaviours/decision_request.py | 4 +- .../skills/decision_maker_abci/handlers.py | 68 ++++++++++++++++--- .../skills/decision_maker_abci/payloads.py | 10 +-- .../skills/decision_maker_abci/skill.yaml | 1 - .../skills/decision_maker_abci/states/base.py | 27 +++++--- .../states/blacklisting.py | 6 +- .../states/decision_receive.py | 2 +- .../states/decision_request.py | 1 + .../decision_maker_abci/states/sampling.py | 4 +- .../tests/states/test_decision_receive.py | 6 +- .../tests/states/test_sampling.py | 2 +- .../skills/market_manager_abci/behaviours.py | 1 + .../skills/market_manager_abci/payloads.py | 8 ++- .../skills/market_manager_abci/rounds.py | 18 +---- .../skills/market_manager_abci/skill.yaml | 1 + .../tests/test_payloads.py | 6 +- .../market_manager_abci/tests/test_rounds.py | 4 +- .../valory/skills/staking_abci/behaviours.py | 49 ++++++++++++- .../valory/skills/staking_abci/payloads.py | 1 + packages/valory/skills/staking_abci/rounds.py | 11 +++ 20 files changed, 168 insertions(+), 62 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py b/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py index b887fb660..c8fa90128 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py @@ -93,9 +93,11 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).local(): payload_content = None mocking_mode: Optional[bool] = self.benchmarking_mode.enabled + decision_request_timestamp = None if self._metadata and self.n_slots_supported: mech_requests = [self.metadata] payload_content = json.dumps(mech_requests, sort_keys=True) + decision_request_timestamp = self.synced_timestamp if not self.n_slots_supported: mocking_mode = None @@ -106,5 +108,5 @@ def async_act(self) -> Generator: self.shared_state.bet_id_row_manager = bets_mapping agent = self.context.agent_address - payload = DecisionRequestPayload(agent, payload_content, mocking_mode) + payload = DecisionRequestPayload(agent, payload_content, mocking_mode, decision_request_timestamp) yield from self.finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index bb4ebb1c7..a83fd9e44 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -24,7 +24,7 @@ import re from datetime import datetime from enum import Enum -from typing import Callable, Dict, Optional, Tuple, cast +from typing import Callable, Dict, Optional, Tuple, cast, Any from urllib.parse import urlparse import requests @@ -118,11 +118,26 @@ class HttpMethod(Enum): POST = "post" -class HttpHandler(BaseHttpHandler): +class HttpHandler(BaseHttpHandler,): """This implements the echo handler.""" SUPPORTED_PROTOCOL = HttpMessage.protocol_id + def __init__(self, **kwargs: Any) -> None: + """Initialize the behaviour.""" + super().__init__(**kwargs) + self._time_since_last_successful_mech_tx: int = 0 + + @property + def time_since_last_successful_mech_tx(self) -> int: + """Get the time since the last successful mech response in seconds.""" + return self._time_since_last_successful_mech_tx + + @time_since_last_successful_mech_tx.setter + def time_since_last_successful_mech_tx(self, time_since_last_successful_mech_tx: int) -> None: + """Set the time since the last successful mech response in seconds.""" + self._time_since_last_successful_mech_tx = time_since_last_successful_mech_tx + def setup(self) -> None: """Implement the setup.""" config_uri_base_hostname = urlparse( @@ -136,16 +151,16 @@ def setup(self) -> None: local_ip_regex = r"192\.168(\.\d{1,3}){2}" # Route regexes - hostname_regex = rf".*({config_uri_base_hostname}|{propel_uri_base_hostname}|{local_ip_regex}|localhost|127.0.0.1|0.0.0.0)(:\d+)?" - self.handler_url_regex = rf"{hostname_regex}\/.*" - health_url_regex = rf"{hostname_regex}\/healthcheck" - metrics_url_regex = rf"{hostname_regex}\/metrics" + self.hostname_regex = rf".*({config_uri_base_hostname}|{propel_uri_base_hostname}|{local_ip_regex}|localhost|127.0.0.1|0.0.0.0)(:\d+)?" + self.handler_url_regex = rf"{self.hostname_regex}\/.*" + health_url_regex = rf"{self.hostname_regex}\/healthcheck" + metrics_url_regex = rf"{self.hostname_regex}\/metrics" # Routes self.routes = { (HttpMethod.GET.value, HttpMethod.HEAD.value): [ (health_url_regex, self._handle_get_health), - (metrics_url_regex, self._handle_get_metrics) + (metrics_url_regex, self._handle_get_metrics), ], } @@ -403,9 +418,10 @@ def set_metrics(self): native_balance = DecisionMakerBaseBehaviour.wei_to_native(self.synchronized_data.wallet_balance) wxdai_balance = self.synchronized_data.token_balance - # staking_contract_available_slots = self.get_available_staking_slots(LEDGER_API_ADDRESS) + staking_contract_available_slots = self.synchronized_data.available_staking_slots staking_state = self.synchronized_data.service_staking_state.value - time_since_last_successful_mech_tx = self.synchronized_data.decision_receive_timestamp + time_since_last_successful_mech_tx = self.calculate_time_since_last_successful_mech_tx() + time_since_last_mech_tx_attempt = self.calculate_time_since_last_mech_tx_attempt() n_total_mech_requests = self.synchronized_data.n_mech_requests n_successful_mech_requests = len(self.synchronized_data.mech_responses) n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests @@ -414,14 +430,44 @@ def set_metrics(self): native_balance) # OLAS_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(1) WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(wxdai_balance) - # STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.set(staking_contract_available_slots) + STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.labels(agent_address, safe_address, service_id).set(staking_contract_available_slots) STAKING_STATE_GAUGE.labels(agent_address, safe_address, service_id).set(staking_state) TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels(agent_address, safe_address, service_id).set( time_since_last_successful_mech_tx) + TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE.labels(agent_address, safe_address, service_id).set(time_since_last_mech_tx_attempt) TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_total_mech_requests) TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) + def calculate_time_since_last_successful_mech_tx(self) -> int: + """Calculate the time since the last successful mech transaction (mech response).""" + + previous_time_since_last_successful_mech_tx = self.time_since_last_successful_mech_tx + mech_tx_ts = self.synchronized_data.decision_receive_timestamp + now = int(datetime.now().timestamp()) + seconds_since_last_successful_mech_tx = 0 + + if mech_tx_ts is not 0: + seconds_since_last_successful_mech_tx = now - mech_tx_ts + self.time_since_last_successful_mech_tx = seconds_since_last_successful_mech_tx + + elif previous_time_since_last_successful_mech_tx is not 0: + seconds_since_last_successful_mech_tx = now - previous_time_since_last_successful_mech_tx + + return seconds_since_last_successful_mech_tx + + def calculate_time_since_last_mech_tx_attempt(self) -> int: + """Calculate the time since the last attempted mech transaction (mech request).""" + + mech_tx_attempt_ts = self.synchronized_data.decision_request_timestamp + now = int(datetime.now().timestamp()) + + if mech_tx_attempt_ts is 0: + return 0 + + seconds_since_last_mech_tx_attempt = now - mech_tx_attempt_ts + return seconds_since_last_mech_tx_attempt + NATIVE_BALANCE_GAUGE = Gauge("olas_agent_native_balance", "Native token balance in xDai", @@ -448,7 +494,7 @@ def set_metrics(self): "Time in seconds since last successful mech transaction", ['agent_address', 'safe_address', 'service_id'] ) -TIME_SINCE_LAST_MECH_TX_ATTEMPT = Gauge("olas_agent_time_since_last_tx_attempt", +TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE = Gauge("olas_agent_time_since_last_mech_tx_attempt", "Time in seconds since last transaction attempt (successful or not)", ['agent_address', 'safe_address', 'service_id'] ) diff --git a/packages/valory/skills/decision_maker_abci/payloads.py b/packages/valory/skills/decision_maker_abci/payloads.py index 3859fdf8a..b82e9f007 100644 --- a/packages/valory/skills/decision_maker_abci/payloads.py +++ b/packages/valory/skills/decision_maker_abci/payloads.py @@ -23,11 +23,11 @@ from typing import Optional from packages.valory.skills.abstract_round_abci.base import BaseTxPayload -from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload @dataclass(frozen=True) -class DecisionReceivePayload(UpdateBetsPayload): +class DecisionReceivePayload(BaseUpdateBetsPayload): """Represents a transaction payload for the decision-making.""" is_profitable: Optional[bool] @@ -39,10 +39,9 @@ class DecisionReceivePayload(UpdateBetsPayload): @dataclass(frozen=True) -class SamplingPayload(BaseTxPayload): +class SamplingPayload(BaseUpdateBetsPayload): """Represents a transaction payload for the sampling of a bet.""" - bets_hash: Optional[str] index: Optional[int] benchmarking_finished: Optional[bool] day_increased: Optional[bool] @@ -74,6 +73,7 @@ class DecisionRequestPayload(BaseTxPayload): mech_requests: Optional[str] = None mocking_mode: Optional[bool] = None + decision_request_timestamp: Optional[int] = None @dataclass(frozen=True) @@ -99,7 +99,7 @@ class VotingPayload(BaseTxPayload): @dataclass(frozen=True) -class BlacklistingPayload(UpdateBetsPayload): +class BlacklistingPayload(BaseUpdateBetsPayload): """Represents a transaction payload for blacklisting.""" policy: str diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index e7fce9ffe..0cbd6c46e 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -106,7 +106,6 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy behaviours: main: args: {} diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index c89f93371..96299ff45 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -38,7 +38,10 @@ MechInteractionResponse, MechMetadata, ) -from packages.valory.skills.staking_abci.rounds import StakingState +from packages.valory.skills.staking_abci.rounds import ( + StakingState, + SynchronizedData as StakingSyncedData, +) from packages.valory.skills.transaction_settlement_abci.rounds import ( SynchronizedData as TxSettlementSyncedData, ) @@ -70,7 +73,7 @@ class Event(Enum): NEW_SIMULATED_RESAMPLE = "new_simulated_resample" -class SynchronizedData(MarketManagerSyncedData, TxSettlementSyncedData): +class SynchronizedData(MarketManagerSyncedData, StakingSyncedData): """Class to represent the synchronized data. This data is replicated by the tendermint application. @@ -244,16 +247,12 @@ def mech_responses(self) -> List[MechInteractionResponse]: serialized = self.db.get("mech_responses", "[]") if serialized is None: serialized = "[]" + + if isinstance(serialized, list): + serialized = json.dumps(serialized) + responses = json.loads(serialized) return [MechInteractionResponse(**response_item) for response_item in responses] - # - # @property - # def wallet_balance(self) -> int: - # """Get the balance of the wallet.""" - # wallet_balance = self.db.get("wallet_balance", 0) - # if wallet_balance is None: - # return 0 - # return int(wallet_balance) @property def decision_receive_timestamp(self) -> int: @@ -263,6 +262,14 @@ def decision_receive_timestamp(self) -> int: return 0 return int(decision_receive_timestamp) + @property + def decision_request_timestamp(self) -> int: + """Get the timestamp of the mech request.""" + decision_request_timestamp = self.db.get("decision_request_timestamp", 0) + if decision_request_timestamp is None: + return 0 + return int(decision_request_timestamp) + @property def is_staking_kpi_met(self) -> bool: """Get the status of the staking kpi.""" diff --git a/packages/valory/skills/decision_maker_abci/states/blacklisting.py b/packages/valory/skills/decision_maker_abci/states/blacklisting.py index d2a714583..929706557 100644 --- a/packages/valory/skills/decision_maker_abci/states/blacklisting.py +++ b/packages/valory/skills/decision_maker_abci/states/blacklisting.py @@ -31,19 +31,19 @@ Event, SynchronizedData, ) -from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound class BlacklistingRound(UpdateBetsRound): """A round for updating the bets after blacklisting the sampled one.""" - payload_class: Type[UpdateBetsPayload] = BlacklistingPayload + payload_class: Type[BaseUpdateBetsPayload] = BlacklistingPayload done_event = Event.DONE none_event = Event.NONE no_majority_event = Event.NO_MAJORITY selection_key: Any = ( - UpdateBetsRound.selection_key, + get_name(SynchronizedData.bets_hash), get_name(SynchronizedData.policy), ) diff --git a/packages/valory/skills/decision_maker_abci/states/decision_receive.py b/packages/valory/skills/decision_maker_abci/states/decision_receive.py index 678b6b2df..5b25bd66c 100644 --- a/packages/valory/skills/decision_maker_abci/states/decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/states/decision_receive.py @@ -43,7 +43,7 @@ class DecisionReceiveRound(CollectSameUntilThresholdRound): none_event = Event.MECH_RESPONSE_ERROR no_majority_event = Event.NO_MAJORITY selection_key: Any = ( - UpdateBetsRound.selection_key, + get_name(SynchronizedData.bets_hash), get_name(SynchronizedData.is_profitable), get_name(SynchronizedData.vote), get_name(SynchronizedData.confidence), diff --git a/packages/valory/skills/decision_maker_abci/states/decision_request.py b/packages/valory/skills/decision_maker_abci/states/decision_request.py index 5c4df3e9b..678995853 100644 --- a/packages/valory/skills/decision_maker_abci/states/decision_request.py +++ b/packages/valory/skills/decision_maker_abci/states/decision_request.py @@ -45,6 +45,7 @@ class DecisionRequestRound(CollectSameUntilThresholdRound): selection_key = ( get_name(SynchronizedData.mech_requests), get_name(SynchronizedData.mocking_mode), + get_name(SynchronizedData.decision_request_timestamp), ) none_event = Event.SLOTS_UNSUPPORTED_ERROR diff --git a/packages/valory/skills/decision_maker_abci/states/sampling.py b/packages/valory/skills/decision_maker_abci/states/sampling.py index 675db9e8b..ad49e48ab 100644 --- a/packages/valory/skills/decision_maker_abci/states/sampling.py +++ b/packages/valory/skills/decision_maker_abci/states/sampling.py @@ -31,14 +31,14 @@ Event, SynchronizedData, ) -from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound class SamplingRound(UpdateBetsRound): """A round for sampling a bet.""" - payload_class: Type[UpdateBetsPayload] = SamplingPayload + payload_class: Type[BaseUpdateBetsPayload] = SamplingPayload done_event = Event.DONE none_event = Event.NONE no_majority_event = Event.NO_MAJORITY diff --git a/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py b/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py index 064c891ad..d00b55277 100644 --- a/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py @@ -37,7 +37,7 @@ from packages.valory.skills.decision_maker_abci.states.decision_receive import ( DecisionReceiveRound, ) -from packages.valory.skills.market_manager_abci.rounds import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.rounds import BaseUpdateBetsPayload DUMMY_DECISION_HASH = "dummy_decision_hash" @@ -63,7 +63,7 @@ def get_payloads( next_mock_data_row: Optional[int], is_profitable: Optional[bool], bets_hash: str, -) -> Mapping[str, UpdateBetsPayload]: +) -> Mapping[str, BaseUpdateBetsPayload]: """Get payloads.""" return { participant: DecisionReceivePayload( @@ -86,7 +86,7 @@ class RoundTestCase: name: str initial_data: Dict[str, Hashable] - payloads: Mapping[str, UpdateBetsPayload] + payloads: Mapping[str, BaseUpdateBetsPayload] final_data: Dict[str, Hashable] event: Event most_voted_payload: Any diff --git a/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py b/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py index 50594d9bd..d420f7b5d 100644 --- a/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py +++ b/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py @@ -100,7 +100,7 @@ def test_sampling_round_selection_key( """Test the selection key property of SamplingRound.""" sampling_round = setup_sampling_round expected_selection_key = ( - UpdateBetsRound.selection_key, + get_name(SynchronizedData.bets_hash), get_name(SynchronizedData.sampled_bet_index), get_name(SynchronizedData.benchmarking_finished), get_name(SynchronizedData.simulated_day), diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 734180ac4..55e8d7014 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -192,6 +192,7 @@ def get_olas_balance(self) -> WaitableConditionType: ) return False + class UpdateBetsBehaviour(BetsManagerBehaviour, QueryingBehaviour): """Behaviour that fetches and updates the bets.""" diff --git a/packages/valory/skills/market_manager_abci/payloads.py b/packages/valory/skills/market_manager_abci/payloads.py index 3a7145233..9a0824577 100644 --- a/packages/valory/skills/market_manager_abci/payloads.py +++ b/packages/valory/skills/market_manager_abci/payloads.py @@ -26,9 +26,15 @@ @dataclass(frozen=True) -class UpdateBetsPayload(BaseTxPayload): +class BaseUpdateBetsPayload(BaseTxPayload): """A transaction payload for the updated bets.""" bets_hash: Optional[str] + + +@dataclass(frozen=True) +class UpdateBetsPayload(BaseUpdateBetsPayload): + """A transaction payload for the updated bets.""" + wallet_balance: Optional[int] token_balance: Optional[int] diff --git a/packages/valory/skills/market_manager_abci/rounds.py b/packages/valory/skills/market_manager_abci/rounds.py index e1644df09..0ddf80fb2 100644 --- a/packages/valory/skills/market_manager_abci/rounds.py +++ b/packages/valory/skills/market_manager_abci/rounds.py @@ -35,7 +35,7 @@ DeserializedCollection, get_name, ) -from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload, UpdateBetsPayload class Event(Enum): @@ -97,22 +97,6 @@ def sampled_bet_index(self) -> int: return 0 return int(sampled_bet_index) - # @property - # def native_balance(self) -> int: - # """Get the native balance.""" - # native_balance = self.db.get("native_balance", 0) - # if native_balance is None: - # return 0 - # return int(native_balance) - # - # @property - # def wxdai_balance(self) -> int: - # """Get the xdai balance.""" - # wxdai_balance = self.db.get("wxdai_balance", 0) - # if wxdai_balance is None: - # return 0 - # return int(wxdai_balance) - class MarketManagerAbstractRound(AbstractRound[Event], ABC): """Abstract round for the MarketManager skill.""" diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 87c6b0377..d52ff3f4b 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -35,6 +35,7 @@ fingerprint_ignore_patterns: [] connections: [] contracts: - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi +- valory/staking_token:0.1.0:bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae - valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i diff --git a/packages/valory/skills/market_manager_abci/tests/test_payloads.py b/packages/valory/skills/market_manager_abci/tests/test_payloads.py index 898c80b48..84e78681d 100644 --- a/packages/valory/skills/market_manager_abci/tests/test_payloads.py +++ b/packages/valory/skills/market_manager_abci/tests/test_payloads.py @@ -18,13 +18,13 @@ # ------------------------------------------------------------------------------ """This module contains the transaction payloads for the market manager abci.""" -from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload def test_update_bets_payload() -> None: """Test `UpdateBetsPayload`.""" - payload = UpdateBetsPayload(sender="sender", bets_hash="dummy bets hash") + payload = BaseUpdateBetsPayload(sender="sender", bets_hash="dummy bets hash") assert payload.bets_hash == "dummy bets hash" - assert UpdateBetsPayload.from_json(payload.json) == payload + assert BaseUpdateBetsPayload.from_json(payload.json) == payload diff --git a/packages/valory/skills/market_manager_abci/tests/test_rounds.py b/packages/valory/skills/market_manager_abci/tests/test_rounds.py index 33b184c69..342ddd311 100644 --- a/packages/valory/skills/market_manager_abci/tests/test_rounds.py +++ b/packages/valory/skills/market_manager_abci/tests/test_rounds.py @@ -45,7 +45,7 @@ from packages.valory.skills.abstract_round_abci.test_tools.rounds import ( BaseCollectSameUntilThresholdRoundTest, ) -from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import ( Event, FailedMarketManagerRound, @@ -90,7 +90,7 @@ def get_payloads( ) -> Mapping[str, BaseTxPayload]: """Get payloads.""" return { - participant: UpdateBetsPayload(participant, data) + participant: BaseUpdateBetsPayload(participant, data) for participant in get_participants() } diff --git a/packages/valory/skills/staking_abci/behaviours.py b/packages/valory/skills/staking_abci/behaviours.py index 74df6e501..e9bdc9d4d 100644 --- a/packages/valory/skills/staking_abci/behaviours.py +++ b/packages/valory/skills/staking_abci/behaviours.py @@ -22,7 +22,7 @@ from abc import ABC from datetime import datetime, timedelta from pathlib import Path -from typing import Any, Callable, Generator, Optional, Set, Tuple, Type, Union, cast +from typing import Any, Callable, Generator, Optional, Set, Tuple, Type, Union, cast, List from aea.configurations.data_types import PublicId from aea.contracts.base import Contract @@ -76,6 +76,8 @@ class StakingInteractBaseBehaviour(BaseBehaviour, ABC): def __init__(self, **kwargs: Any) -> None: """Initialize the behaviour.""" super().__init__(**kwargs) + self._service_ids = None + self._max_num_services = None self._service_staking_state: StakingState = StakingState.UNSTAKED self._checkpoint_ts = 0 @@ -171,6 +173,33 @@ def service_info(self, service_info: Tuple[Any, Any, Tuple[Any, Any]]) -> None: """Set the service info.""" self._service_info = service_info + @property + def max_num_services(self) -> int: + """Get the max number of services.""" + return self._max_num_services + + @max_num_services.setter + def max_num_services(self, max_num_services: int) -> None: + """set the max number of services.""" + self._max_num_services = max_num_services + + @property + def service_ids(self) -> List[str]: + """Get the service ids staked on the contract.""" + return self._service_ids + + @service_ids.setter + def service_ids(self, service_ids: List[str]) -> None: + """set the service ids staked on the contract.""" + self._service_ids = service_ids + + @property + def available_staking_slots(self) -> int: + """Get the number of available staking slots""" + if self._service_ids is None or self._max_num_services is None: + return 0 + return self.max_num_services - len(self._service_ids) + def wait_for_condition_with_sleep( self, condition_gen: Callable[[], WaitableConditionType], @@ -354,6 +383,22 @@ def _get_service_info(self) -> WaitableConditionType: ) return status + def _get_max_num_services(self) -> WaitableConditionType: + """Get the max_num_services.""" + status = yield from self._staking_contract_interact( + contract_callable="max_num_services", + placeholder=get_name(CallCheckpointBehaviour.max_num_services), + ) + return status + + def _get_service_ids(self) -> WaitableConditionType: + """Get the staked service ids.""" + status = yield from self._staking_contract_interact( + contract_callable="get_service_ids", + placeholder=get_name(CallCheckpointBehaviour.service_ids), + ) + return status + class CallCheckpointBehaviour( StakingInteractBaseBehaviour @@ -528,6 +573,7 @@ def async_act(self) -> Generator: tx_submitter = self.matching_round.auto_round_id() is_checkpoint_reached = yield from self.check_new_epoch() + available_slot_count = self.available_staking_slots payload = CallCheckpointPayload( self.context.agent_address, tx_submitter, @@ -535,6 +581,7 @@ def async_act(self) -> Generator: self.service_staking_state.value, self.ts_checkpoint, is_checkpoint_reached, + available_slot_count ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): diff --git a/packages/valory/skills/staking_abci/payloads.py b/packages/valory/skills/staking_abci/payloads.py index 4b1f47e2c..1a11e848d 100644 --- a/packages/valory/skills/staking_abci/payloads.py +++ b/packages/valory/skills/staking_abci/payloads.py @@ -40,3 +40,4 @@ class CallCheckpointPayload(MultisigTxPayload): service_staking_state: int ts_checkpoint: int is_checkpoint_reached: bool + available_slot_count: int diff --git a/packages/valory/skills/staking_abci/rounds.py b/packages/valory/skills/staking_abci/rounds.py index c6de99b2a..f879cc16f 100644 --- a/packages/valory/skills/staking_abci/rounds.py +++ b/packages/valory/skills/staking_abci/rounds.py @@ -99,6 +99,14 @@ def is_checkpoint_reached(self) -> bool: """Check if the checkpoint is reached.""" return bool(self.db.get("is_checkpoint_reached", False)) + @property + def available_staking_slots(self) -> int: + """Get the number of available staking slots for the contract.""" + available_staking_slots = self.db.get("available_staking_slots", None) + if available_staking_slots is None: + return 0 + return int(available_staking_slots) + class CallCheckpointRound(CollectSameUntilThresholdRound): """A round for the checkpoint call preparation.""" @@ -112,6 +120,7 @@ class CallCheckpointRound(CollectSameUntilThresholdRound): get_name(SynchronizedData.service_staking_state), get_name(SynchronizedData.previous_checkpoint), get_name(SynchronizedData.is_checkpoint_reached), + get_name(SynchronizedData.available_staking_slots) ) collection_key = get_name(SynchronizedData.participant_to_checkpoint) synchronized_data_class = SynchronizedData @@ -198,6 +207,7 @@ class StakingAbciApp(AbciApp[Event]): # pylint: disable=too-few-public-methods get_name(SynchronizedData.service_staking_state), get_name(SynchronizedData.previous_checkpoint), get_name(SynchronizedData.is_checkpoint_reached), + get_name(SynchronizedData.available_staking_slots) } ) final_states: Set[AppState] = { @@ -216,6 +226,7 @@ class StakingAbciApp(AbciApp[Event]): # pylint: disable=too-few-public-methods get_name(SynchronizedData.service_staking_state), get_name(SynchronizedData.previous_checkpoint), get_name(SynchronizedData.is_checkpoint_reached), + get_name(SynchronizedData.available_staking_slots), }, FinishedStakingRound: { get_name(SynchronizedData.service_staking_state), From 9fdab40d8593cd07fc631d83ae8bf9dd55995de3 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 09:39:43 +0000 Subject: [PATCH 08/32] fix: changes after code checks --- .../check_stop_trading_abci/behaviours.py | 4 +- .../skills/check_stop_trading_abci/rounds.py | 8 +- .../tests/test_payloads.py | 3 +- .../tests/test_rounds.py | 9 +- .../decision_maker_abci/behaviours/base.py | 43 ---- .../behaviours/bet_placement.py | 2 +- .../behaviours/decision_request.py | 4 +- .../skills/decision_maker_abci/handlers.py | 216 +++++++++++------- .../skills/decision_maker_abci/states/base.py | 10 +- .../states/bet_placement.py | 5 +- .../states/blacklisting.py | 4 +- .../states/decision_receive.py | 1 - .../decision_maker_abci/states/sampling.py | 4 +- .../tests/states/test_decision_receive.py | 5 +- .../skills/market_manager_abci/behaviours.py | 14 +- .../skills/market_manager_abci/rounds.py | 29 ++- .../valory/skills/staking_abci/behaviours.py | 23 +- packages/valory/skills/staking_abci/rounds.py | 4 +- 18 files changed, 218 insertions(+), 170 deletions(-) diff --git a/packages/valory/skills/check_stop_trading_abci/behaviours.py b/packages/valory/skills/check_stop_trading_abci/behaviours.py index 9f39994f8..42b503c66 100644 --- a/packages/valory/skills/check_stop_trading_abci/behaviours.py +++ b/packages/valory/skills/check_stop_trading_abci/behaviours.py @@ -169,7 +169,9 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).local(): stop_trading = yield from self._compute_stop_trading() self.context.logger.info(f"Computed {stop_trading=}") - payload = CheckStopTradingPayload(self.context.agent_address, stop_trading, self.mech_request_count) + payload = CheckStopTradingPayload( + self.context.agent_address, stop_trading, self.mech_request_count + ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): yield from self.send_a2a_transaction(payload) diff --git a/packages/valory/skills/check_stop_trading_abci/rounds.py b/packages/valory/skills/check_stop_trading_abci/rounds.py index b3936317c..68d59107d 100644 --- a/packages/valory/skills/check_stop_trading_abci/rounds.py +++ b/packages/valory/skills/check_stop_trading_abci/rounds.py @@ -69,7 +69,10 @@ def is_staking_kpi_met(self) -> bool: @property def n_mech_requests(self) -> int: """Get the number of mech requests.""" - return int(self.db.get("n_mech_requests", 0)) + n_mech_requests = self.db.get("n_mech_requests", 0) + if n_mech_requests is None: + return 0 + return n_mech_requests class CheckStopTradingRound(VotingRound): @@ -103,8 +106,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: n_mech_requests = self.mech_request_count self.synchronized_data.update( - is_staking_kpi_met=is_staking_kpi_met, - n_mech_requests=n_mech_requests + is_staking_kpi_met=is_staking_kpi_met, n_mech_requests=n_mech_requests ) return res diff --git a/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py b/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py index de53b3995..a27d2a448 100644 --- a/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py +++ b/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py @@ -26,8 +26,9 @@ def test_check_stop_trading_payload() -> None: """Test `CheckStopTradingPayload`.""" - payload = CheckStopTradingPayload(sender="sender", vote=True) + payload = CheckStopTradingPayload(sender="sender", vote=True, mech_request_count=1) assert payload.vote assert payload.data == {"vote": True} + assert payload.mech_request_count == 1 assert CheckStopTradingPayload.from_json(payload.json) == payload diff --git a/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py b/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py index 8967831fa..8abeaa9af 100644 --- a/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py +++ b/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py @@ -84,7 +84,9 @@ def get_participant_to_votes( """participant_to_votes""" return { - participant: CheckStopTradingPayload(sender=participant, vote=vote) + participant: CheckStopTradingPayload( + sender=participant, vote=vote, mech_request_count=1 + ) for participant in participants } @@ -102,10 +104,11 @@ def get_participant_to_votes_serialized( def get_payloads( payload_cls: Type[CheckStopTradingPayload], data: Optional[str], + mech_request_count: int, ) -> Mapping[str, CheckStopTradingPayload]: """Get payloads.""" return { - participant: payload_cls(participant, data is not None) + participant: payload_cls(participant, data is not None, mech_request_count) for participant in get_participants() } @@ -198,6 +201,7 @@ class TestCheckStopTradingRound(BaseCheckStopTradingRoundTest): payloads=get_payloads( payload_cls=CheckStopTradingPayload, data=get_dummy_check_stop_trading_payload_serialized(), + mech_request_count=1, ), final_data={}, event=Event.SKIP_TRADING, @@ -217,6 +221,7 @@ class TestCheckStopTradingRound(BaseCheckStopTradingRoundTest): payloads=get_payloads( payload_cls=CheckStopTradingPayload, data=get_dummy_check_stop_trading_payload_serialized(), + mech_request_count=1, ), final_data={}, event=Event.NO_MAJORITY, diff --git a/packages/valory/skills/decision_maker_abci/behaviours/base.py b/packages/valory/skills/decision_maker_abci/behaviours/base.py index 6e55d49ec..837daf246 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/base.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/base.py @@ -30,7 +30,6 @@ from aea.protocols.base import Message from aea.protocols.dialogue.base import Dialogue -from packages.valory.contracts.erc20.contract import ERC20 from packages.valory.contracts.gnosis_safe.contract import ( GnosisSafeContract, SafeOperation, @@ -109,8 +108,6 @@ class DecisionMakerBaseBehaviour(BetsManagerBehaviour, ABC): def __init__(self, **kwargs: Any) -> None: """Initialize the bet placement behaviour.""" super().__init__(**kwargs) - # self.token_balance = 0 - # self.wallet_balance = 0 self.multisend_batches: List[MultisendBatch] = [] self.multisend_data = b"" self._safe_tx_hash = "" @@ -265,23 +262,6 @@ def is_first_period(self) -> bool: or self.shared_state.mock_data is None ) - # @property - # def sampled_bet(self) -> Bet: - # """Get the sampled bet and reset the bets list.""" - # self.read_bets() - # bet_index = self.synchronized_data.sampled_bet_index - # return self.bets[bet_index] - - # @property - # def collateral_token(self) -> str: - # """Get the contract address of the token that the market maker supports.""" - # return self.sampled_bet.collateralToken - # - # @property - # def is_wxdai(self) -> bool: - # """Get whether the collateral address is wxDAI.""" - # return self.collateral_token.lower() == WXDAI.lower() - @staticmethod def wei_to_native(wei: int) -> float: """Convert WEI to native token.""" @@ -325,29 +305,6 @@ def check_balance(self) -> WaitableConditionType: self._mock_balance_check() return True - # response_msg = yield from self.get_contract_api_response( - # performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore - # contract_address=self.collateral_token, - # contract_id=str(ERC20.contract_id), - # contract_callable="check_balance", - # account=self.synchronized_data.safe_contract_address, - # ) - # if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION: - # self.context.logger.error( - # f"Could not calculate the balance of the safe: {response_msg}" - # ) - # return False - # - # token = response_msg.raw_transaction.body.get("token", None) - # wallet = response_msg.raw_transaction.body.get("wallet", None) - # if token is None or wallet is None: - # self.context.logger.error( - # f"Something went wrong while trying to get the balance of the safe: {response_msg}" - # ) - # return False - # - # self.token_balance = int(token) - # self.wallet_balance = int(wallet) yield from self.wait_for_condition_with_sleep(self.get_balance) self._report_balance() diff --git a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py index b94075304..cb21fb06c 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py @@ -238,7 +238,7 @@ def async_act(self) -> Generator: betting_tx_hex, mocking_mode, wallet_balance, - token_balance + token_balance, ) yield from self.finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py b/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py index c8fa90128..1d0e3271b 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/decision_request.py @@ -108,5 +108,7 @@ def async_act(self) -> Generator: self.shared_state.bet_id_row_manager = bets_mapping agent = self.context.agent_address - payload = DecisionRequestPayload(agent, payload_content, mocking_mode, decision_request_timestamp) + payload = DecisionRequestPayload( + agent, payload_content, mocking_mode, decision_request_timestamp + ) yield from self.finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index a83fd9e44..f8ad57c1d 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -20,25 +20,21 @@ """This module contains the handler for the 'decision_maker_abci' skill.""" import json -import prometheus_client import re from datetime import datetime from enum import Enum -from typing import Callable, Dict, Optional, Tuple, cast, Any +from typing import Any, Callable, Dict, Optional, Tuple, cast from urllib.parse import urlparse -import requests - +import prometheus_client # type: ignore from aea.protocols.base import Message -from aea_ledger_ethereum import EthereumApi -from prometheus_client import MetricsHandler, Gauge, generate_latest +from prometheus_client import Gauge, generate_latest from packages.valory.connections.http_server.connection import ( PUBLIC_ID as HTTP_SERVER_PUBLIC_ID, ) from packages.valory.protocols.http.message import HttpMessage from packages.valory.protocols.ipfs import IpfsMessage -from packages.valory.skills.abstract_round_abci.base import LEDGER_API_ADDRESS from packages.valory.skills.abstract_round_abci.handlers import ( ABCIRoundHandler as BaseABCIRoundHandler, ) @@ -58,7 +54,9 @@ from packages.valory.skills.abstract_round_abci.handlers import ( TendermintHandler as BaseTendermintHandler, ) -from packages.valory.skills.decision_maker_abci.behaviours.base import DecisionMakerBaseBehaviour +from packages.valory.skills.decision_maker_abci.behaviours.base import ( + DecisionMakerBaseBehaviour, +) from packages.valory.skills.decision_maker_abci.dialogues import ( HttpDialogue, HttpDialogues, @@ -66,6 +64,7 @@ from packages.valory.skills.decision_maker_abci.models import SharedState from packages.valory.skills.decision_maker_abci.rounds import SynchronizedData + ABCIHandler = BaseABCIRoundHandler SigningHandler = BaseSigningHandler LedgerApiHandler = BaseLedgerApiHandler @@ -118,7 +117,9 @@ class HttpMethod(Enum): POST = "post" -class HttpHandler(BaseHttpHandler,): +class HttpHandler( + BaseHttpHandler, +): """This implements the echo handler.""" SUPPORTED_PROTOCOL = HttpMessage.protocol_id @@ -134,7 +135,9 @@ def time_since_last_successful_mech_tx(self) -> int: return self._time_since_last_successful_mech_tx @time_since_last_successful_mech_tx.setter - def time_since_last_successful_mech_tx(self, time_since_last_successful_mech_tx: int) -> None: + def time_since_last_successful_mech_tx( + self, time_since_last_successful_mech_tx: int + ) -> None: """Set the time since the last successful mech response in seconds.""" self._time_since_last_successful_mech_tx = time_since_last_successful_mech_tx @@ -217,8 +220,8 @@ def handle(self, message: Message) -> None: # Check if this is a request sent from the http_server skill if ( - http_msg.performative != HttpMessage.Performative.REQUEST - or message.sender != str(HTTP_SERVER_PUBLIC_ID.without_hash()) + http_msg.performative != HttpMessage.Performative.REQUEST + or message.sender != str(HTTP_SERVER_PUBLIC_ID.without_hash()) ): super().handle(message) return @@ -253,7 +256,7 @@ def handle(self, message: Message) -> None: handler(http_msg, http_dialogue, **kwargs) def _handle_bad_request( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue + self, http_msg: HttpMessage, http_dialogue: HttpDialogue ) -> None: """ Handle a Http bad request. @@ -276,7 +279,7 @@ def _handle_bad_request( self.context.outbox.put_message(message=http_response) def _handle_get_health( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue + self, http_msg: HttpMessage, http_dialogue: HttpDialogue ) -> None: """ Handle a Http request of verb GET. @@ -307,9 +310,9 @@ def _handle_get_health( ) is_transitioning_fast = ( - not is_tm_unhealthy - and seconds_since_last_transition - < 2 * self.context.params.reset_pause_duration + not is_tm_unhealthy + and seconds_since_last_transition + < 2 * self.context.params.reset_pause_duration ) if round_sequence._abci_app: @@ -337,7 +340,7 @@ def _handle_get_health( self._send_ok_response(http_msg, http_dialogue, data) def _send_ok_response( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue, data: Dict + self, http_msg: HttpMessage, http_dialogue: HttpDialogue, data: Dict ) -> None: """Send an OK response with the provided data""" http_response = http_dialogue.reply( @@ -355,7 +358,7 @@ def _send_ok_response( self.context.outbox.put_message(message=http_response) def _send_not_found_response( - self, http_msg: HttpMessage, http_dialogue: HttpDialogue + self, http_msg: HttpMessage, http_dialogue: HttpDialogue ) -> None: """Send an not found response""" http_response = http_dialogue.reply( @@ -374,8 +377,8 @@ def _send_not_found_response( def _check_required_funds(self) -> bool: """Check the agent has enough funds.""" return ( - self.synchronized_data.wallet_balance - > self.context.params.agent_balance_threshold + self.synchronized_data.wallet_balance + > self.context.params.agent_balance_threshold ) def _check_is_receiving_mech_responses(self) -> bool: @@ -383,15 +386,16 @@ def _check_is_receiving_mech_responses(self) -> bool: # Checks the most recent decision receive timestamp, which can only be returned after making a mech call # (an on chain transaction) return ( - self.synchronized_data.decision_receive_timestamp - < int(datetime.utcnow().timestamp()) - - self.context.params.expected_mech_response_time + self.synchronized_data.decision_receive_timestamp + < int(datetime.utcnow().timestamp()) + - self.context.params.expected_mech_response_time ) - def _handle_get_metrics(self, http_msg, http_dialogue): - """ - Handle the /metrics endpoint. - """ + def _handle_get_metrics( + self, http_msg: HttpMessage, http_dialogue: HttpDialogue + ) -> None: + """Handle the /metrics endpoint.""" + self.set_metrics() # Generate the metrics data metrics_data = generate_latest() @@ -411,48 +415,79 @@ def _handle_get_metrics(self, http_msg, http_dialogue): self.context.logger.info("Responding with metrics data") self.context.outbox.put_message(message=http_response) - def set_metrics(self): + def set_metrics(self) -> None: + """Set the metrics.""" + agent_address = self.context.agent_address safe_address = self.synchronized_data.safe_contract_address service_id = self.context.params.on_chain_service_id - native_balance = DecisionMakerBaseBehaviour.wei_to_native(self.synchronized_data.wallet_balance) + native_balance = DecisionMakerBaseBehaviour.wei_to_native( + self.synchronized_data.wallet_balance + ) wxdai_balance = self.synchronized_data.token_balance - staking_contract_available_slots = self.synchronized_data.available_staking_slots + staking_contract_available_slots = ( + self.synchronized_data.available_staking_slots + ) staking_state = self.synchronized_data.service_staking_state.value - time_since_last_successful_mech_tx = self.calculate_time_since_last_successful_mech_tx() - time_since_last_mech_tx_attempt = self.calculate_time_since_last_mech_tx_attempt() + time_since_last_successful_mech_tx = ( + self.calculate_time_since_last_successful_mech_tx() + ) + time_since_last_mech_tx_attempt = ( + self.calculate_time_since_last_mech_tx_attempt() + ) n_total_mech_requests = self.synchronized_data.n_mech_requests n_successful_mech_requests = len(self.synchronized_data.mech_responses) n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( - native_balance) - # OLAS_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(1) - WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set(wxdai_balance) - STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.labels(agent_address, safe_address, service_id).set(staking_contract_available_slots) - STAKING_STATE_GAUGE.labels(agent_address, safe_address, service_id).set(staking_state) - TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels(agent_address, safe_address, service_id).set( - time_since_last_successful_mech_tx) - TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE.labels(agent_address, safe_address, service_id).set(time_since_last_mech_tx_attempt) - TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_total_mech_requests) - TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_successful_mech_requests) - TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set(n_failed_mech_requests) + native_balance + ) + WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( + wxdai_balance + ) + STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.labels( + agent_address, safe_address, service_id + ).set(staking_contract_available_slots) + STAKING_STATE_GAUGE.labels(agent_address, safe_address, service_id).set( + staking_state + ) + TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels( + agent_address, safe_address, service_id + ).set(time_since_last_successful_mech_tx) + TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE.labels( + agent_address, safe_address, service_id + ).set(time_since_last_mech_tx_attempt) + TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set( + n_total_mech_requests + ) + TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set( + n_successful_mech_requests + ) + TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set( + n_failed_mech_requests + ) def calculate_time_since_last_successful_mech_tx(self) -> int: """Calculate the time since the last successful mech transaction (mech response).""" - previous_time_since_last_successful_mech_tx = self.time_since_last_successful_mech_tx + previous_time_since_last_successful_mech_tx = ( + self.time_since_last_successful_mech_tx + ) mech_tx_ts = self.synchronized_data.decision_receive_timestamp now = int(datetime.now().timestamp()) seconds_since_last_successful_mech_tx = 0 - if mech_tx_ts is not 0: + if mech_tx_ts != 0: seconds_since_last_successful_mech_tx = now - mech_tx_ts - self.time_since_last_successful_mech_tx = seconds_since_last_successful_mech_tx + self.time_since_last_successful_mech_tx = ( + seconds_since_last_successful_mech_tx + ) - elif previous_time_since_last_successful_mech_tx is not 0: - seconds_since_last_successful_mech_tx = now - previous_time_since_last_successful_mech_tx + elif previous_time_since_last_successful_mech_tx != 0: + seconds_since_last_successful_mech_tx = ( + now - previous_time_since_last_successful_mech_tx + ) return seconds_since_last_successful_mech_tx @@ -462,50 +497,69 @@ def calculate_time_since_last_mech_tx_attempt(self) -> int: mech_tx_attempt_ts = self.synchronized_data.decision_request_timestamp now = int(datetime.now().timestamp()) - if mech_tx_attempt_ts is 0: + if mech_tx_attempt_ts == 0: return 0 seconds_since_last_mech_tx_attempt = now - mech_tx_attempt_ts return seconds_since_last_mech_tx_attempt -NATIVE_BALANCE_GAUGE = Gauge("olas_agent_native_balance", - "Native token balance in xDai", - ['agent_address', 'safe_address', 'service_id'] - ) +NATIVE_BALANCE_GAUGE = Gauge( + "olas_agent_native_balance", + "Native token balance in xDai", + ["agent_address", "safe_address", "service_id"], +) -OLAS_BALANCE_GAUGE = Gauge("olas_agent_olas_balance", - "OLAS token balance", ['agent_address', 'safe_address', 'service_id'] - ) +OLAS_BALANCE_GAUGE = Gauge( + "olas_agent_olas_balance", + "OLAS token balance", + ["agent_address", "safe_address", "service_id"], +) -WXDAI_BALANCE_GAUGE = Gauge("olas_agent_wxdai_balance", - "WXDAI token balance", ['agent_address', 'safe_address', 'service_id'] - ) +WXDAI_BALANCE_GAUGE = Gauge( + "olas_agent_wxdai_balance", + "WXDAI token balance", + ["agent_address", "safe_address", "service_id"], +) -STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE = Gauge("olas_staking_contract_available_slots", - "Number of available slots in the staking contract", ['agent_address', 'safe_address', 'service_id'] - ) +STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE = Gauge( + "olas_staking_contract_available_slots", + "Number of available slots in the staking contract", + ["agent_address", "safe_address", "service_id"], +) -STAKING_STATE_GAUGE = Gauge("olas_agent_staked", - "Indicates if an agent is staked (1), not staked (0) or eviceted (2)", ['agent_address', 'safe_address', 'service_id'] - ) +STAKING_STATE_GAUGE = Gauge( + "olas_agent_staked", + "Indicates if an agent is staked (1), not staked (0) or eviceted (2)", + ["agent_address", "safe_address", "service_id"], +) -TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE = Gauge("olas_agent_time_since_last_successful_tx", - "Time in seconds since last successful mech transaction", ['agent_address', 'safe_address', 'service_id'] - ) +TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE = Gauge( + "olas_agent_time_since_last_successful_tx", + "Time in seconds since last successful mech transaction", + ["agent_address", "safe_address", "service_id"], +) -TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE = Gauge("olas_agent_time_since_last_mech_tx_attempt", - "Time in seconds since last transaction attempt (successful or not)", ['agent_address', 'safe_address', 'service_id'] - ) +TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE = Gauge( + "olas_agent_time_since_last_mech_tx_attempt", + "Time in seconds since last transaction attempt (successful or not)", + ["agent_address", "safe_address", "service_id"], +) -TOTAL_MECH_TXS = Gauge("olas_agent_txs", - "Total number of transactions", ['agent_address', 'safe_address', 'service_id'] - ) +TOTAL_MECH_TXS = Gauge( + "olas_agent_txs", + "Total number of transactions", + ["agent_address", "safe_address", "service_id"], +) -TOTAL_SUCCESSFUL_MECH_TXS = Gauge("olas_successful_agent_txs", - "Total successful number of transactions", ['agent_address', 'safe_address', 'service_id'] - ) +TOTAL_SUCCESSFUL_MECH_TXS = Gauge( + "olas_successful_agent_txs", + "Total successful number of transactions", + ["agent_address", "safe_address", "service_id"], +) -TOTAL_FAILED_MECH_TXS = Gauge("olas_failed_agent_txs", - "Total failed number of transaction", ['agent_address', 'safe_address', 'service_id'] - ) +TOTAL_FAILED_MECH_TXS = Gauge( + "olas_failed_agent_txs", + "Total failed number of transaction", + ["agent_address", "safe_address", "service_id"], +) diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 96299ff45..c3e52a74d 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -38,13 +38,10 @@ MechInteractionResponse, MechMetadata, ) +from packages.valory.skills.staking_abci.rounds import StakingState from packages.valory.skills.staking_abci.rounds import ( - StakingState, SynchronizedData as StakingSyncedData, ) -from packages.valory.skills.transaction_settlement_abci.rounds import ( - SynchronizedData as TxSettlementSyncedData, -) class Event(Enum): @@ -283,7 +280,10 @@ def service_staking_state(self) -> StakingState: @property def n_mech_requests(self) -> int: """Get the number of mech requests.""" - return int(self.db.get("n_mech_requests", 0)) + n_mech_requests = self.db.get("n_mech_requests", 0) + if n_mech_requests is None: + return 0 + return n_mech_requests @property def token_balance(self) -> int: diff --git a/packages/valory/skills/decision_maker_abci/states/bet_placement.py b/packages/valory/skills/decision_maker_abci/states/bet_placement.py index 79976c754..1bdcd8b7b 100644 --- a/packages/valory/skills/decision_maker_abci/states/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/states/bet_placement.py @@ -48,6 +48,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: sync_data, event = update wallet_balance = self.most_voted_payload_values[-2] token_balance = self.most_voted_payload_values[-1] - sync_data = sync_data.update(wallet_balance=wallet_balance, - token_balance=token_balance) + sync_data = sync_data.update( + wallet_balance=wallet_balance, token_balance=token_balance + ) return sync_data, event diff --git a/packages/valory/skills/decision_maker_abci/states/blacklisting.py b/packages/valory/skills/decision_maker_abci/states/blacklisting.py index 929706557..034671934 100644 --- a/packages/valory/skills/decision_maker_abci/states/blacklisting.py +++ b/packages/valory/skills/decision_maker_abci/states/blacklisting.py @@ -32,10 +32,10 @@ SynchronizedData, ) from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload -from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound +from packages.valory.skills.market_manager_abci.rounds import BaseUpdateBetsRound -class BlacklistingRound(UpdateBetsRound): +class BlacklistingRound(BaseUpdateBetsRound): """A round for updating the bets after blacklisting the sampled one.""" payload_class: Type[BaseUpdateBetsPayload] = BlacklistingPayload diff --git a/packages/valory/skills/decision_maker_abci/states/decision_receive.py b/packages/valory/skills/decision_maker_abci/states/decision_receive.py index 5b25bd66c..362b5a7b0 100644 --- a/packages/valory/skills/decision_maker_abci/states/decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/states/decision_receive.py @@ -31,7 +31,6 @@ Event, SynchronizedData, ) -from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound class DecisionReceiveRound(CollectSameUntilThresholdRound): diff --git a/packages/valory/skills/decision_maker_abci/states/sampling.py b/packages/valory/skills/decision_maker_abci/states/sampling.py index ad49e48ab..3aeba03f0 100644 --- a/packages/valory/skills/decision_maker_abci/states/sampling.py +++ b/packages/valory/skills/decision_maker_abci/states/sampling.py @@ -32,10 +32,10 @@ SynchronizedData, ) from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload -from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound +from packages.valory.skills.market_manager_abci.rounds import BaseUpdateBetsRound -class SamplingRound(UpdateBetsRound): +class SamplingRound(BaseUpdateBetsRound): """A round for sampling a bet.""" payload_class: Type[BaseUpdateBetsPayload] = SamplingPayload diff --git a/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py b/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py index d00b55277..b3d1d88fa 100644 --- a/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/tests/states/test_decision_receive.py @@ -37,7 +37,6 @@ from packages.valory.skills.decision_maker_abci.states.decision_receive import ( DecisionReceiveRound, ) -from packages.valory.skills.market_manager_abci.rounds import BaseUpdateBetsPayload DUMMY_DECISION_HASH = "dummy_decision_hash" @@ -63,7 +62,7 @@ def get_payloads( next_mock_data_row: Optional[int], is_profitable: Optional[bool], bets_hash: str, -) -> Mapping[str, BaseUpdateBetsPayload]: +) -> Mapping[str, DecisionReceivePayload]: """Get payloads.""" return { participant: DecisionReceivePayload( @@ -86,7 +85,7 @@ class RoundTestCase: name: str initial_data: Dict[str, Hashable] - payloads: Mapping[str, BaseUpdateBetsPayload] + payloads: Mapping[str, DecisionReceivePayload] final_data: Dict[str, Hashable] event: Event most_voted_payload: Any diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 55e8d7014..10b70f3c2 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -45,9 +45,11 @@ from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import ( MarketManagerAbciApp, - UpdateBetsRound, SynchronizedData, + SynchronizedData, + UpdateBetsRound, ) + WaitableConditionType = Generator[None, None, bool] @@ -93,11 +95,6 @@ def is_wxdai(self) -> bool: """Get whether the collateral address is wxDAI.""" return self.collateral_token.lower() == WXDAI.lower() - # @staticmethod - # def wei_to_native(wei: int) -> float: - # """Convert WEI to native token.""" - # return wei / 10**18 - def store_bets(self) -> None: """Store the bets to the agent's data dir as JSON.""" serialized = serialize_bets(self.bets) @@ -191,6 +188,7 @@ def get_olas_balance(self) -> WaitableConditionType: f"Could not calculate the balance of the safe: {response_msg}" ) return False + return True class UpdateBetsBehaviour(BetsManagerBehaviour, QueryingBehaviour): @@ -304,7 +302,9 @@ def async_act(self) -> Generator: print(f"WALLET BALANCE: {wallet_balance}") bets_hash = self.hash_stored_bets() if self.bets else None - payload = UpdateBetsPayload(self.context.agent_address, bets_hash, wallet_balance, token_balance) + payload = UpdateBetsPayload( + self.context.agent_address, bets_hash, wallet_balance, token_balance + ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): yield from self.send_a2a_transaction(payload) diff --git a/packages/valory/skills/market_manager_abci/rounds.py b/packages/valory/skills/market_manager_abci/rounds.py index 0ddf80fb2..319d2a830 100644 --- a/packages/valory/skills/market_manager_abci/rounds.py +++ b/packages/valory/skills/market_manager_abci/rounds.py @@ -21,7 +21,7 @@ from abc import ABC from enum import Enum -from typing import Dict, Set, Tuple, Type, cast +from typing import Any, Dict, Set, Tuple, Type, cast from packages.valory.skills.abstract_round_abci.base import ( AbciApp, @@ -35,7 +35,10 @@ DeserializedCollection, get_name, ) -from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload, UpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import ( + BaseUpdateBetsPayload, + UpdateBetsPayload, +) class Event(Enum): @@ -115,17 +118,29 @@ def _return_no_majority_event(self) -> Tuple[SynchronizedData, Event]: return self.synchronized_data, Event.NO_MAJORITY -class UpdateBetsRound(CollectSameUntilThresholdRound, MarketManagerAbstractRound): +class BaseUpdateBetsRound(CollectSameUntilThresholdRound, MarketManagerAbstractRound): + """A round for the bets fetching & updating.""" + + payload_class = BaseUpdateBetsPayload + done_event: Enum = Event.DONE + none_event: Enum = Event.FETCH_ERROR + no_majority_event: Enum = Event.NO_MAJORITY + selection_key = (get_name(SynchronizedData.bets_hash),) + collection_key = get_name(SynchronizedData.participant_to_bets_hash) + synchronized_data_class = SynchronizedData + + +class UpdateBetsRound(BaseUpdateBetsRound): """A round for the bets fetching & updating.""" - payload_class = UpdateBetsPayload + payload_class: Type[UpdateBetsPayload] = UpdateBetsPayload done_event: Enum = Event.DONE none_event: Enum = Event.FETCH_ERROR no_majority_event: Enum = Event.NO_MAJORITY - selection_key = ( - get_name(SynchronizedData.bets_hash), + selection_key: Any = ( + BaseUpdateBetsRound.selection_key, get_name(SynchronizedData.wallet_balance), - get_name(SynchronizedData.token_balance) + get_name(SynchronizedData.token_balance), ) collection_key = get_name(SynchronizedData.participant_to_bets_hash) synchronized_data_class = SynchronizedData diff --git a/packages/valory/skills/staking_abci/behaviours.py b/packages/valory/skills/staking_abci/behaviours.py index e9bdc9d4d..c99812aa7 100644 --- a/packages/valory/skills/staking_abci/behaviours.py +++ b/packages/valory/skills/staking_abci/behaviours.py @@ -22,7 +22,18 @@ from abc import ABC from datetime import datetime, timedelta from pathlib import Path -from typing import Any, Callable, Generator, Optional, Set, Tuple, Type, Union, cast, List +from typing import ( + Any, + Callable, + Generator, + List, + Optional, + Set, + Tuple, + Type, + Union, + cast, +) from aea.configurations.data_types import PublicId from aea.contracts.base import Contract @@ -76,8 +87,8 @@ class StakingInteractBaseBehaviour(BaseBehaviour, ABC): def __init__(self, **kwargs: Any) -> None: """Initialize the behaviour.""" super().__init__(**kwargs) - self._service_ids = None - self._max_num_services = None + self._service_ids: List[str] = [] + self._max_num_services: int = 0 self._service_staking_state: StakingState = StakingState.UNSTAKED self._checkpoint_ts = 0 @@ -180,7 +191,7 @@ def max_num_services(self) -> int: @max_num_services.setter def max_num_services(self, max_num_services: int) -> None: - """set the max number of services.""" + """Set the max number of services.""" self._max_num_services = max_num_services @property @@ -190,7 +201,7 @@ def service_ids(self) -> List[str]: @service_ids.setter def service_ids(self, service_ids: List[str]) -> None: - """set the service ids staked on the contract.""" + """Set the service ids staked on the contract.""" self._service_ids = service_ids @property @@ -581,7 +592,7 @@ def async_act(self) -> Generator: self.service_staking_state.value, self.ts_checkpoint, is_checkpoint_reached, - available_slot_count + available_slot_count, ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): diff --git a/packages/valory/skills/staking_abci/rounds.py b/packages/valory/skills/staking_abci/rounds.py index f879cc16f..d5bb972d3 100644 --- a/packages/valory/skills/staking_abci/rounds.py +++ b/packages/valory/skills/staking_abci/rounds.py @@ -120,7 +120,7 @@ class CallCheckpointRound(CollectSameUntilThresholdRound): get_name(SynchronizedData.service_staking_state), get_name(SynchronizedData.previous_checkpoint), get_name(SynchronizedData.is_checkpoint_reached), - get_name(SynchronizedData.available_staking_slots) + get_name(SynchronizedData.available_staking_slots), ) collection_key = get_name(SynchronizedData.participant_to_checkpoint) synchronized_data_class = SynchronizedData @@ -207,7 +207,7 @@ class StakingAbciApp(AbciApp[Event]): # pylint: disable=too-few-public-methods get_name(SynchronizedData.service_staking_state), get_name(SynchronizedData.previous_checkpoint), get_name(SynchronizedData.is_checkpoint_reached), - get_name(SynchronizedData.available_staking_slots) + get_name(SynchronizedData.available_staking_slots), } ) final_states: Set[AppState] = { From 662e48f640a1810ffcece526efe83d68ae9264f3 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 09:40:35 +0000 Subject: [PATCH 09/32] chore: generators --- packages/packages.json | 18 +++++------ packages/valory/agents/trader/aea-config.yaml | 12 ++++---- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 10 +++---- .../skills/decision_maker_abci/skill.yaml | 30 +++++++++---------- .../skills/market_manager_abci/skill.yaml | 10 +++---- .../valory/skills/staking_abci/skill.yaml | 6 ++-- packages/valory/skills/trader_abci/skill.yaml | 10 +++---- .../tx_settlement_multiplexer_abci/skill.yaml | 4 +-- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index a23979068..bc57345f8 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq", - "skill/valory/decision_maker_abci/0.1.0": "bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4", - "skill/valory/trader_abci/0.1.0": "bafybeiecarxwf3clvnfnpwyspaxcw4iqyuol4nctripb6g6kvbgetesj4a", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidchhmoaxcyhnohl5rwywicqyr234kf5ojc46mdsbw6dulr4l2zsu", - "skill/valory/staking_abci/0.1.0": "bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy", - "agent/valory/trader/0.1.0": "bafybeicu5kvhhtgstsw2im355l4qjptlcjdkblk5xkszdqmiibvzqrapde", - "service/valory/trader/0.1.0": "bafybeigr6c4qaeze6iqpxbe2yatwnfqydqclf65z5wrrqxnpuhvevlq6uy", - "service/valory/trader_pearl/0.1.0": "bafybeib52clx2k4xhvhgj53lxsy4jbbfm4j6wjx5oqa73gjr4myvgrnjzy" + "skill/valory/market_manager_abci/0.1.0": "bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa", + "skill/valory/decision_maker_abci/0.1.0": "bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a", + "skill/valory/trader_abci/0.1.0": "bafybeifqef3na7drr5xql2awtyxto7auk236fvxleamptuubwawhy2mnm4", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi", + "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", + "agent/valory/trader/0.1.0": "bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu", + "service/valory/trader/0.1.0": "bafybeidr6ocacecehlhzjr3zkjvazb52yrxgzvhljav3bs64z2yji2pr5m", + "service/valory/trader_pearl/0.1.0": "bafybeihahxb3m67k6z5b3j74d5gf3llz5d7ekfiukcz7teqyawici6gr3e" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 794269fc1..e016facff 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,12 +46,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidchhmoaxcyhnohl5rwywicqyr234kf5ojc46mdsbw6dulr4l2zsu -- valory/market_manager_abci:0.1.0:bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq -- valory/decision_maker_abci:0.1.0:bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4 -- valory/trader_abci:0.1.0:bafybeiecarxwf3clvnfnpwyspaxcw4iqyuol4nctripb6g6kvbgetesj4a -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi +- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa +- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a +- valory/trader_abci:0.1.0:bafybeifqef3na7drr5xql2awtyxto7auk236fvxleamptuubwawhy2mnm4 +- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 +- valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 9ce262efe..e2a4f7e72 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:bafybeicu5kvhhtgstsw2im355l4qjptlcjdkblk5xkszdqmiibvzqrapde +agent: valory/trader:0.1.0:bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 76d78eb9c..0f6eeadd4 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeicu5kvhhtgstsw2im355l4qjptlcjdkblk5xkszdqmiibvzqrapde +agent: valory/trader:0.1.0:bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index e147e3ea2..4cd027b99 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -8,18 +8,18 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeif2pq7fg5upl6vmfgfzpiwsh4nbk4zaeyz6upyucqi5tasrxgq4ee __init__.py: bafybeifc23rlw2hzhplp3wfceixnmwq5ztnixhh7jp4dd5av3crwp3x22a - behaviours.py: bafybeibj2sckgorqe4zugak6typbqwev6ot6e6thwelebrzm44gpqxi54i + behaviours.py: bafybeibbjo73ntwkwnc2ozbx27b2min6hgwrayrql5ozn6ttjb4z6jxp3m dialogues.py: bafybeictrrnwcijiejczy23dfvbx5kujgef3dulzqhs3etl2juvz5spm2e fsm_specification.yaml: bafybeihhau35a5xclncjpxh5lg7qiw34xs4d5qlez7dnjpkf45d3gc57ai handlers.py: bafybeiard64fwxib3rtyp67ymhf222uongcyqhfhdyttpsyqkmyh5ajipu models.py: bafybeigwdhgianx5rizlb7ebmm6pdtkixh4uehbvu5c24ysvyvojs74dfq payloads.py: bafybeigyuhfflh45oovhlwij3zgay4xjrrj2mt2pbhtxtughlimzn2jvgq - rounds.py: bafybeif3e23wbnb3niz6czhjo2xxat6mpqw3zt32dee7qnzwwsnhx43yue + rounds.py: bafybeigjx533enl364yfbylno5psehrlj6l74v2sukg2pioawbcz7ermzm tests/__init__.py: bafybeihv2cjk4va5bc5ncqtppqg2xmmxcro34bma36trtvk32gtmhdycxu tests/test_dialogues.py: bafybeia5ac27w7ijx2nyx5dqyrnv4troo4572gjq7nrcxdncexoxucnqti tests/test_handlers.py: bafybeigpmtx2hyunzn6nxk2x4bvvybek7jvuhbk34fqlj7fgfsszcoqhxy - tests/test_payloads.py: bafybeih7q7kdfxsf4ejxxqwjumwglfwwcrbqcjnuy42mkhnfwccxuhiviy - tests/test_rounds.py: bafybeidgbc7mi7r2fpk7ak6xceohuoq2zkpkberkokcb3sb2uzwkxoluae + tests/test_payloads.py: bafybeibygk4xox7itkxwypolxp6yak2hpbtvhtpdaqey2zj6qxqnzo4uqm + tests/test_rounds.py: bafybeigxv27wqlpf4si2xcpe7bgn6k6ubr5nt37w7sskiapbuht5miz3wq fingerprint_ignore_patterns: [] connections: [] contracts: @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq +- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 behaviours: main: args: {} diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 0cbd6c46e..e793730cc 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -13,13 +13,13 @@ fingerprint: README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky - behaviours/base.py: bafybeieqvxpzjnwjgq4ffhjojle2q7onif44nefrlza6pxriewisqcm324 - behaviours/bet_placement.py: bafybeiho37vosp6eq7ezpufsiqjchmqdkt6f42qzq3uplu27gdwkfivz3e + behaviours/base.py: bafybeihym4ws7sprnqrqcpuaua5gwyyvwgfoxxw7ozker3r26mq755chz4 + behaviours/bet_placement.py: bafybeignqylvy5mownwsngtbmjsuanyu7ep26tmmdfiz5hhzuetfp2h2li behaviours/blacklisting.py: bafybeicah7vcruhbakrhpsxdmw3ftq72o5e3plfhhqsnvhk3vk6iud6og4 behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e behaviours/decision_receive.py: bafybeifrsnxref7yyl4hq4nmh4xa4rden4wygv5y5ugvqb5ji7zgj7mv5m - behaviours/decision_request.py: bafybeia22omb7tvocyfe3z2ucn5au5mcas7dg37ha42u7znefzrewjpk7y + behaviours/decision_request.py: bafybeigf7nihxq525oukz5wb2zoks3j7mzbi37w3vpp7dux47on6g3lybq behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm behaviours/order_subscription.py: bafybeib3maqohhx35wzryy4otdcjp5thkr4sbp27ksvwidy3pwm444itra behaviours/randomness.py: bafybeiaoj3awyyg2onhpsdsn3dyczs23gr4smuzqcbw3e5ocljwxswjkce @@ -30,28 +30,28 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeibgmy5efawveds7t65ktrb4t6pn4agndg5riygkhoxqk57pf7zhhq + handlers.py: bafybeihg2ts4fb6pq6zzmibqbijv7pwcpqann6gtmak6zr4fdgoto23464 io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm - payloads.py: bafybeihymeadb45ok6fyyt3xr24tds725vtj5p32vmbek4ap4awfamwwue + payloads.py: bafybeicgpilyalsnnlygecbooxjpxywcwscyf7saj42m6qr5cuvl4elkji policy.py: bafybeihlzs4o5e7yfmfzcvvrzkf4bhxfsg5gxnzsrpepwgfugh45gafye4 redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm rounds.py: bafybeiazjcsukgefair52aw37hhvxzlopnzqqmi4ntqrinakljlcm4kt4a states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeiay2ow7sybt3ihajuogqgbtndi3zkoxycq5vdlq7qg7muh5y2vckm - states/bet_placement.py: bafybeiaxfj6ni5pgw65c7zq74eekkfwnq3b2d27ifqf6alepy5zezsuhze - states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi + states/base.py: bafybeifjbh4hy5pv74gworu4qke6lp7b5x3hofnitlbuutrz7ev7wth4ra + states/bet_placement.py: bafybeid6ffwooqeb2uj3f5t2iy7ffoeltoyc76jqzn6x4yjezgvofnsasm + states/blacklisting.py: bafybeidqi356wrxmvj2hqs22hw3kaszh4fg4rs3fo5axk2biosxt6kfbiy states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni states/claim_subscription.py: bafybeiampifhdoztggwj6gthl2hfzecmjcwnm6nic2o47q4je7j4x3ujne - states/decision_receive.py: bafybeib3eahaehvmcrdojnlrz34q2crdb3ao6qun2wohokdf3t3ywwfa4y - states/decision_request.py: bafybeiarv3r5j7cfvxmudki2llbdl2pvf24p5mvsva6bdgrylnwdyag5xy + states/decision_receive.py: bafybeidig5gzwb6ncxkdyahpuqxvj3jhvtspq2ystcbwpnfi3b6ahmqtfq + states/decision_request.py: bafybeig6l3l6ulv7alhwfxjlzz53i6g5gw3l5vumivadqstnmqoupwmaea states/final_states.py: bafybeicjrrojo3gmfaxzicwloyorlnqgzl6a2avevo4nvhoh424zwzmbti states/handle_failed_tx.py: bafybeihewm2vernvhktuorljdupjqcg2p5vs6wvsira2d62wkoyo5xlzjm states/order_subscription.py: bafybeihl3pwrbccaitiukbigygd5u3weyih34pvzql3c6n5k7gjj47f2be states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe - states/sampling.py: bafybeif2yuwl5swelp7oh5nfuupdf3vg2ijjzapk2xqht7e6i6ggcsl2zy + states/sampling.py: bafybeicrmisa2tze4bhxhi2sxzrlzji2rucyh7qdtoncfk5icbs4sm2pbq states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -65,14 +65,14 @@ fingerprint: tests/states/test_blacklising.py: bafybeihm2ex6l7fhorgi3mjj2epztu2r7bqbg56unpgpzfzymghshchqzy tests/states/test_check_benchmarking.py: bafybeifwpi5f4fhreqptfxdsnyv3nptkqytkwbukfuqkrjo4eww7cv3sxy tests/states/test_claim_subscription.py: bafybeiclkxjhceb3ehgmg6klt4uywew5drk5b3w6no7mwxetpubxqrejfy - tests/states/test_decision_receive.py: bafybeiddj42tdkghvga574qxvixh7nmf6bpdjitlk3eliimnq2r4n6qlrm + tests/states/test_decision_receive.py: bafybeicrf3avaikxrxf5c2fxjckcpckpz66y23emdscf6fbbe36x7nbphm tests/states/test_decision_request.py: bafybeigqbakm2olkwvcngertjplhnmu6on6tp6hxn7lxygi2gf5a5eurbe tests/states/test_final_states.py: bafybeiftfd3ovaqpfe7t5ry7maiziavk74wl66d6zo6ikhgodznormd2nm tests/states/test_handle_failed_tx.py: bafybeibuepj6fko7ba3bef6nybzetilni2iwgkxd5xeazqskadbad3l2zq tests/states/test_order_subscription.py: bafybeidx2tzivsxhpr5xx5e5h2xmpjyewfogt2mujv4sq3hbaeksmcbvhy tests/states/test_randomness.py: bafybeib3eqjv6mhlprzda7d4viddn5alrfqteq6juyg3ccejseoywcsbey tests/states/test_redeem.py: bafybeiezdnfrxukb2xpwffrr357g2anmdkwy7wo3nphvlggipq5xrdzr7a - tests/states/test_sampling.py: bafybeifvbzikke6wtex2p5j7fsnpdbj4qqxl5vh2lm2m2apgvuqdonoyzm + tests/states/test_sampling.py: bafybeid7vsednazdnos4nnveymwjc3qpcg6e2r5ubkzcgiqfy3tji6nx5m tests/states/test_tool_selection.py: bafybeib7js3dj7647t33o5ybfqftwytxktwrvhbri5yuyymg6znj6y7xxa tests/test_dialogues.py: bafybeibulo64tgfrq4e5qbcqnmifrlehkqciwuavublints353zaj2mlpa tests/test_handlers.py: bafybeihpkgtjjm3uegpup6zkznpoaxqpu6kmp3ujiggrzbe73p5fzlq7im @@ -102,10 +102,10 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq +- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq +- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 behaviours: main: args: {} diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index d52ff3f4b..a07fe1560 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -9,7 +9,7 @@ fingerprint: .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeicfoszavcyrzahe6qaydlaf27mpbwui7a6wgdbstydbzxmdisxhju + behaviours.py: bafybeig5akdvjjl2jviph5x76jvdeydk6ykasfkv5em3x7xflm6w3ylmwm bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q @@ -24,13 +24,13 @@ fingerprint: graph_tooling/utils.py: bafybeig5hxhnqgyfn5ym3poc5nziqwpeozqbd6wa4s6c2hjn6iyedg3t3y handlers.py: bafybeihot2i2yvfkz2gcowvt66wdu6tkjbmv7hsmc4jzt4reqeaiuphbtu models.py: bafybeibjttnga54y4auz6f33ecfrngyw53b2xzpompm72drjsr4xoytmiy - payloads.py: bafybeicfymvvtdpkcgmkvthfzmb7dqakepkzslqrz6rcs7nxkz7qq3mrzy - rounds.py: bafybeibqqq3vjotaasc67olhlqthka6e6refodguntkmpksgdbqlzme73a + payloads.py: bafybeigaoni6raoz4ebdghe5jhvmjkuldkocwg2qbxj2cr62454ed2voae + rounds.py: bafybeigzbssdfjwtia7xa2okip4yx33ilyqnhdrilittrm3ezb7jac2q5a tests/__init__.py: bafybeigaewntxawezvygss345kytjijo56bfwddjtfm6egzxfajsgojam4 tests/test_dialogues.py: bafybeiet646su5nsjmvruahuwg6un4uvwzyj2lnn2jvkye6cxooz22f3ja tests/test_handlers.py: bafybeiaz3idwevvlplcyieaqo5oeikuthlte6e2gi4ajw452ylvimwgiki - tests/test_payloads.py: bafybeidvld43p5c4wpwi7m6rfzontkheqqgxdchjnme5b54wmldojc5dmm - tests/test_rounds.py: bafybeidahkavof43y3o4omnihh6yxdx7gqofio7kzukdydymxbebylempu + tests/test_payloads.py: bafybeia3qstr7ieu2nenznqtmuvipmnequkcp5vwefl7buinckwttx674m + tests/test_rounds.py: bafybeiappkwes6ausj63quzg7hapdmubltiks4x54b54i6il6vrdpsnu2m fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index 9d866d5c2..e17e2403d 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -8,13 +8,13 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeifrpl36fddmgvniwvghqtxdzc44ry6l2zvqy37vu3y2xvwyd23ugy __init__.py: bafybeiageyes36ujnvvodqd5vlnihgz44rupysrk2ebbhskjkueetj6dai - behaviours.py: bafybeiels3us2s5sf2lrloekjky46o2owlo3awsocuxt67h76ap2k5qaqy + behaviours.py: bafybeibn4obtqrg6g3sl4hufdiqsmcyjn4cv22q4sxmkipsbmmupdezenm dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeicuoejmaks3ndwhbflp64kkfdkrdyn74a2fplarg4l3gxlonfmeoq handlers.py: bafybeichsi2y5zvzffupj2vhgagocwvnm7cbzr6jmavp656mfrzsdvkfnu models.py: bafybeibhzoi25wqpgxwn7ibgz3juax2aeqep7qdl6q7u3abdnb6jahc264 - payloads.py: bafybeib7hxsibtabb5vt6gjtco2x2s2yodhs24ojqecgrcexqsiv3pvmuy - rounds.py: bafybeiezsn42e2qqdpwgtkvrlgjzfwtg7fldfqglf5ofc36g7uyaobvuhq + payloads.py: bafybeifbt7z6dnoh46ffy7rlx4qovypzifsubmvcpqtpesg3653wtnheqi + rounds.py: bafybeidyvsypqsyokp3pwhzsas337y2teymw2iq6zv5ofj6b4o5wgqw4cq tests/__init__.py: bafybeid7m6ynosqeb4mvsss2hqg75aly5o2d47r7yfg2xtgwzkkilv2d2m tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index c3a43194b..d644bc87b 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,11 +26,11 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeigi2pohxoh4nv2ku6wlhizipfsj2ijvl4pbwx223qdnel264zqrhq -- valory/decision_maker_abci:0.1.0:bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4 -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidchhmoaxcyhnohl5rwywicqyr234kf5ojc46mdsbw6dulr4l2zsu -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeidnt3irw5lrbi2n567acdksm4tfdz4gswfcicyja664qiktdobrwy +- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa +- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi +- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 +- valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 6b50295c0..c829efa76 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,8 +23,8 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeiemevk3urrvzf5jvr33pncyhiuo2gqiuescg6vgan4yvhhomdkkm4 -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq +- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a +- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: From 9fec4ef5288167952a849b3fd75e09a123a3e8bc Mon Sep 17 00:00:00 2001 From: Adamantios Date: Thu, 19 Dec 2024 12:26:31 +0200 Subject: [PATCH 10/32] fix: add missing dependency to the skill --- packages/valory/skills/decision_maker_abci/skill.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index e793730cc..83764458c 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -436,4 +436,6 @@ dependencies: version: ==4.0.0 pyyaml: version: <=6.0.1,>=3.10 + prometheus_client: + version: ==0.21.1 is_abstract: true From 79bb146fd2ca7254a9b7452ded0ceefb3e8474e8 Mon Sep 17 00:00:00 2001 From: Adamantios Date: Thu, 19 Dec 2024 12:27:00 +0200 Subject: [PATCH 11/32] chore: run tox -e check-dependencies --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index e2f88bd15..2f84979c6 100644 --- a/tox.ini +++ b/tox.ini @@ -75,6 +75,7 @@ deps = {[deps-base]deps} [extra-deps] deps = attrs + prometheus_client==0.21.1 pyinstaller==6.8.0 pyyaml<=6.0.1,>=3.10 werkzeug From 20962c85f3f714864d93cf5e15bf1c0cd48b4c39 Mon Sep 17 00:00:00 2001 From: Adamantios Date: Thu, 19 Dec 2024 12:30:49 +0200 Subject: [PATCH 12/32] chore: ignore missing prometheus client imports --- packages/valory/skills/decision_maker_abci/handlers.py | 2 +- tox.ini | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index f8ad57c1d..409e39e95 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -26,7 +26,7 @@ from typing import Any, Callable, Dict, Optional, Tuple, cast from urllib.parse import urlparse -import prometheus_client # type: ignore +import prometheus_client from aea.protocols.base import Message from prometheus_client import Gauge, generate_latest diff --git a/tox.ini b/tox.ini index 2f84979c6..a42a4321b 100644 --- a/tox.ini +++ b/tox.ini @@ -408,6 +408,9 @@ ignore_missing_imports = True [mypy-packages.open_aea.*] ignore_errors=True +[mypy-prometheus_client] +ignore_missing_imports = True + [mypy-toml.*] ignore_missing_imports = True From 48874d5187828a940ac898ac852b99e263c97008 Mon Sep 17 00:00:00 2001 From: Adamantios Date: Thu, 19 Dec 2024 12:35:49 +0200 Subject: [PATCH 13/32] chore: run generators --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 5 ++--- .../valory/skills/market_manager_abci/skill.yaml | 1 - packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 19 insertions(+), 21 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index bc57345f8..5011e5459 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa", - "skill/valory/decision_maker_abci/0.1.0": "bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a", - "skill/valory/trader_abci/0.1.0": "bafybeifqef3na7drr5xql2awtyxto7auk236fvxleamptuubwawhy2mnm4", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi", + "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea", + "skill/valory/trader_abci/0.1.0": "bafybeic3dcbkbiidlkmskhb2yiuj6xglkngfujej6hfsu5rkrsq73aqbyq", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeic6zhms3pt53btzxjyc7ce6aalfpbtghhpanjiczoq2mfb3uyv34u", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu", - "service/valory/trader/0.1.0": "bafybeidr6ocacecehlhzjr3zkjvazb52yrxgzvhljav3bs64z2yji2pr5m", - "service/valory/trader_pearl/0.1.0": "bafybeihahxb3m67k6z5b3j74d5gf3llz5d7ekfiukcz7teqyawici6gr3e" + "agent/valory/trader/0.1.0": "bafybeiav5hkpnbfbxrd4vtjbbpmkirxt6fknf3dadeavy4ocva72hm3yy4", + "service/valory/trader/0.1.0": "bafybeieyg3xl3ynqd2l327mffbmq3ximqshh6simg2xbor4hx52pohphmu", + "service/valory/trader_pearl/0.1.0": "bafybeihjxr2avfblnl4auknzfoo2oesbnntejnu6off7ihc62rrpbhwvea" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index e016facff..522b41d67 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi -- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa -- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a -- valory/trader_abci:0.1.0:bafybeifqef3na7drr5xql2awtyxto7auk236fvxleamptuubwawhy2mnm4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic6zhms3pt53btzxjyc7ce6aalfpbtghhpanjiczoq2mfb3uyv34u +- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq +- valory/decision_maker_abci:0.1.0:bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea +- valory/trader_abci:0.1.0:bafybeic3dcbkbiidlkmskhb2yiuj6xglkngfujej6hfsu5rkrsq73aqbyq - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index e2a4f7e72..a66f2b85c 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:bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu +agent: valory/trader:0.1.0:bafybeiav5hkpnbfbxrd4vtjbbpmkirxt6fknf3dadeavy4ocva72hm3yy4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 0f6eeadd4..e67f0afbd 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu +agent: valory/trader:0.1.0:bafybeiav5hkpnbfbxrd4vtjbbpmkirxt6fknf3dadeavy4ocva72hm3yy4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 83764458c..bebf2353b 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,7 +9,6 @@ description: This skill is responsible for the decision making and placing the b license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: - .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky @@ -30,7 +29,7 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeihg2ts4fb6pq6zzmibqbijv7pwcpqann6gtmak6zr4fdgoto23464 + handlers.py: bafybeih763sihxtcfh7yc24vc2uvpsn6rgbvvhh4fvhos43uw7aree2foq io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm @@ -102,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa +- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index a07fe1560..4fadb771c 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -6,7 +6,6 @@ description: This skill implements the MarketManager for an AEA. license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: - .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e behaviours.py: bafybeig5akdvjjl2jviph5x76jvdeydk6ykasfkv5em3x7xflm6w3ylmwm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index d644bc87b..bbb26b411 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa -- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi +- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq +- valory/decision_maker_abci:0.1.0:bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic6zhms3pt53btzxjyc7ce6aalfpbtghhpanjiczoq2mfb3uyv34u - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index c829efa76..e0ab35204 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a +- valory/decision_maker_abci:0.1.0:bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 0902d3599565ce00b819b36e51d36beb6c9383f3 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 11:02:05 +0000 Subject: [PATCH 14/32] fix: registry duplicated timeseries error --- packages/packages.json | 12 ++++++------ packages/valory/agents/trader/aea-config.yaml | 6 +++--- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/decision_maker_abci/handlers.py | 16 ++++++++++++++-- .../valory/skills/decision_maker_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 29 insertions(+), 17 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index bc57345f8..c72b08110 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -16,14 +16,14 @@ "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa", - "skill/valory/decision_maker_abci/0.1.0": "bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a", - "skill/valory/trader_abci/0.1.0": "bafybeifqef3na7drr5xql2awtyxto7auk236fvxleamptuubwawhy2mnm4", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi", + "skill/valory/decision_maker_abci/0.1.0": "bafybeidbnagu3r35ykdgzolgshjpygsccgvyhq75nt4x2x2j5ib5gruwgq", + "skill/valory/trader_abci/0.1.0": "bafybeifdts75tjnea2boi7bhz5q7wu5saf6urtieuezqyq5dygktkc6xyu", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidjqazm3n6s4thjlmqshxml7ssu77qp5uz4xr23vp3ei3zraw3fti", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu", - "service/valory/trader/0.1.0": "bafybeidr6ocacecehlhzjr3zkjvazb52yrxgzvhljav3bs64z2yji2pr5m", - "service/valory/trader_pearl/0.1.0": "bafybeihahxb3m67k6z5b3j74d5gf3llz5d7ekfiukcz7teqyawici6gr3e" + "agent/valory/trader/0.1.0": "bafybeifdrw6igkudsfplwaxy73yqlvtbbmseam54sihgdndq3lednhq36q", + "service/valory/trader/0.1.0": "bafybeigtipyix2v3vuh47fatefc7mflcqzfubda2tpvbmjlux7taqin5r4", + "service/valory/trader_pearl/0.1.0": "bafybeifklh43lpmzqpfqslwhpiwt6dwag6oitutch4nhgv3a3f4oswub5q" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index e016facff..891210f9d 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidjqazm3n6s4thjlmqshxml7ssu77qp5uz4xr23vp3ei3zraw3fti - valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa -- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a -- valory/trader_abci:0.1.0:bafybeifqef3na7drr5xql2awtyxto7auk236fvxleamptuubwawhy2mnm4 +- valory/decision_maker_abci:0.1.0:bafybeidbnagu3r35ykdgzolgshjpygsccgvyhq75nt4x2x2j5ib5gruwgq +- valory/trader_abci:0.1.0:bafybeifdts75tjnea2boi7bhz5q7wu5saf6urtieuezqyq5dygktkc6xyu - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index e2a4f7e72..a14447d8d 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:bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu +agent: valory/trader:0.1.0:bafybeifdrw6igkudsfplwaxy73yqlvtbbmseam54sihgdndq3lednhq36q number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 0f6eeadd4..0438c27b7 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiec2owl6dtsvv3wdp3h2avhnpl3n4oboo2z762izvbrr4vycy4nsu +agent: valory/trader:0.1.0:bafybeifdrw6igkudsfplwaxy73yqlvtbbmseam54sihgdndq3lednhq36q number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index f8ad57c1d..595271ab8 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -28,7 +28,7 @@ import prometheus_client # type: ignore from aea.protocols.base import Message -from prometheus_client import Gauge, generate_latest +from prometheus_client import CollectorRegistry, Gauge, generate_latest from packages.valory.connections.http_server.connection import ( PUBLIC_ID as HTTP_SERVER_PUBLIC_ID, @@ -398,7 +398,7 @@ def _handle_get_metrics( self.set_metrics() # Generate the metrics data - metrics_data = generate_latest() + metrics_data = generate_latest(REGISTRY) # Create a response with the metrics data http_response = http_dialogue.reply( @@ -504,62 +504,74 @@ def calculate_time_since_last_mech_tx_attempt(self) -> int: return seconds_since_last_mech_tx_attempt +REGISTRY = CollectorRegistry() + NATIVE_BALANCE_GAUGE = Gauge( "olas_agent_native_balance", "Native token balance in xDai", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) OLAS_BALANCE_GAUGE = Gauge( "olas_agent_olas_balance", "OLAS token balance", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) WXDAI_BALANCE_GAUGE = Gauge( "olas_agent_wxdai_balance", "WXDAI token balance", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE = Gauge( "olas_staking_contract_available_slots", "Number of available slots in the staking contract", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) STAKING_STATE_GAUGE = Gauge( "olas_agent_staked", "Indicates if an agent is staked (1), not staked (0) or eviceted (2)", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE = Gauge( "olas_agent_time_since_last_successful_tx", "Time in seconds since last successful mech transaction", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE = Gauge( "olas_agent_time_since_last_mech_tx_attempt", "Time in seconds since last transaction attempt (successful or not)", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) TOTAL_MECH_TXS = Gauge( "olas_agent_txs", "Total number of transactions", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) TOTAL_SUCCESSFUL_MECH_TXS = Gauge( "olas_successful_agent_txs", "Total successful number of transactions", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) TOTAL_FAILED_MECH_TXS = Gauge( "olas_failed_agent_txs", "Total failed number of transaction", ["agent_address", "safe_address", "service_id"], + registry=REGISTRY, ) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index e793730cc..4eaa6e9f6 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -30,7 +30,7 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeihg2ts4fb6pq6zzmibqbijv7pwcpqann6gtmak6zr4fdgoto23464 + handlers.py: bafybeibsd67mgjtnxxrikksjjakmvr4kwagvi7ejpd73aylsmocp23lepq io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index d644bc87b..b30407ac9 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -27,8 +27,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa -- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh3sybzf7yk7m2ird7s6upzrfzlvzzitcbwtmsmu4gtfxhit2gyi +- valory/decision_maker_abci:0.1.0:bafybeidbnagu3r35ykdgzolgshjpygsccgvyhq75nt4x2x2j5ib5gruwgq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidjqazm3n6s4thjlmqshxml7ssu77qp5uz4xr23vp3ei3zraw3fti - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index c829efa76..fc1602f64 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeielbqkj54wn6tlj7viyhunrbdfej2m3u5cyxz4zbwivvfy6fb443a +- valory/decision_maker_abci:0.1.0:bafybeidbnagu3r35ykdgzolgshjpygsccgvyhq75nt4x2x2j5ib5gruwgq - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From abba52bd10983eeabc473ce3daa00373d5a446ca Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 11:03:20 +0000 Subject: [PATCH 15/32] chore: generators --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 5 +++-- .../valory/skills/market_manager_abci/skill.yaml | 1 + packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 5011e5459..24a2ba774 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", - "skill/valory/decision_maker_abci/0.1.0": "bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea", - "skill/valory/trader_abci/0.1.0": "bafybeic3dcbkbiidlkmskhb2yiuj6xglkngfujej6hfsu5rkrsq73aqbyq", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeic6zhms3pt53btzxjyc7ce6aalfpbtghhpanjiczoq2mfb3uyv34u", + "skill/valory/market_manager_abci/0.1.0": "bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa", + "skill/valory/decision_maker_abci/0.1.0": "bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu", + "skill/valory/trader_abci/0.1.0": "bafybeigicr3xxcjqxvfuhebw5pkxfsf4qqpggdtyfte5pg6kzwwlygop2q", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeib67oxviltdoc3kvbct4e4xtqbiuumszw4kn7v5pzmvf7ihp7dnc4", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeiav5hkpnbfbxrd4vtjbbpmkirxt6fknf3dadeavy4ocva72hm3yy4", - "service/valory/trader/0.1.0": "bafybeieyg3xl3ynqd2l327mffbmq3ximqshh6simg2xbor4hx52pohphmu", - "service/valory/trader_pearl/0.1.0": "bafybeihjxr2avfblnl4auknzfoo2oesbnntejnu6off7ihc62rrpbhwvea" + "agent/valory/trader/0.1.0": "bafybeiayrzetoc4ulguyv2kt6pf7fcjnvwk35jnw5le3a5oj7ktyc7xe2a", + "service/valory/trader/0.1.0": "bafybeifa6q4guogtlo2rshptf5xdzyxojhfesvagiucyl2ht4vepwuudku", + "service/valory/trader_pearl/0.1.0": "bafybeid6rze7eua5g2s2e3n2ywhdsvard5lejnvxwkvr3utt3jkgre2zry" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 522b41d67..261b9f7e6 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic6zhms3pt53btzxjyc7ce6aalfpbtghhpanjiczoq2mfb3uyv34u -- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea -- valory/trader_abci:0.1.0:bafybeic3dcbkbiidlkmskhb2yiuj6xglkngfujej6hfsu5rkrsq73aqbyq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib67oxviltdoc3kvbct4e4xtqbiuumszw4kn7v5pzmvf7ihp7dnc4 +- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa +- valory/decision_maker_abci:0.1.0:bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu +- valory/trader_abci:0.1.0:bafybeigicr3xxcjqxvfuhebw5pkxfsf4qqpggdtyfte5pg6kzwwlygop2q - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index a66f2b85c..d59393035 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:bafybeiav5hkpnbfbxrd4vtjbbpmkirxt6fknf3dadeavy4ocva72hm3yy4 +agent: valory/trader:0.1.0:bafybeiayrzetoc4ulguyv2kt6pf7fcjnvwk35jnw5le3a5oj7ktyc7xe2a number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index e67f0afbd..482a0e0ab 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiav5hkpnbfbxrd4vtjbbpmkirxt6fknf3dadeavy4ocva72hm3yy4 +agent: valory/trader:0.1.0:bafybeiayrzetoc4ulguyv2kt6pf7fcjnvwk35jnw5le3a5oj7ktyc7xe2a number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index bebf2353b..13a3f076c 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,6 +9,7 @@ description: This skill is responsible for the decision making and placing the b license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: + .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky @@ -29,7 +30,7 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeih763sihxtcfh7yc24vc2uvpsn6rgbvvhh4fvhos43uw7aree2foq + handlers.py: bafybeie35jlzzy3kf3kayw5wokywkv35c2vv5q2ikxniuxlnsmvs6uwubu io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm @@ -101,7 +102,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq +- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 4fadb771c..a07fe1560 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -6,6 +6,7 @@ description: This skill implements the MarketManager for an AEA. license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: + .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e behaviours.py: bafybeig5akdvjjl2jviph5x76jvdeydk6ykasfkv5em3x7xflm6w3ylmwm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index bbb26b411..133d6ac24 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic6zhms3pt53btzxjyc7ce6aalfpbtghhpanjiczoq2mfb3uyv34u +- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa +- valory/decision_maker_abci:0.1.0:bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib67oxviltdoc3kvbct4e4xtqbiuumszw4kn7v5pzmvf7ihp7dnc4 - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index e0ab35204..7983a92ab 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeiee5njul4owt3cfk2ktyd36wqro73a4utnt4zq24btkzcrxkszqea +- valory/decision_maker_abci:0.1.0:bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 1e9d3a033ee2563b9a5b33478309523ae5d57574 Mon Sep 17 00:00:00 2001 From: Anna Sambrook <83281726+annasambrook@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:27:33 +0000 Subject: [PATCH 16/32] Update packages/valory/skills/decision_maker_abci/skill.yaml Co-authored-by: Adamantios Zaras --- packages/valory/skills/decision_maker_abci/skill.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 13a3f076c..e41288648 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,7 +9,6 @@ description: This skill is responsible for the decision making and placing the b license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: - .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky From 447619719adbd5f2e1558bd9b0a046448b9b1323 Mon Sep 17 00:00:00 2001 From: Anna Sambrook <83281726+annasambrook@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:27:40 +0000 Subject: [PATCH 17/32] Update packages/valory/skills/market_manager_abci/skill.yaml Co-authored-by: Adamantios Zaras --- packages/valory/skills/market_manager_abci/skill.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index a07fe1560..4fadb771c 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -6,7 +6,6 @@ description: This skill implements the MarketManager for an AEA. license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: - .coverage: bafybeiamyhdetx6urx43npwxxsid2o26dt5akzyvtyvyeb33v4h4rhrqii README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e behaviours.py: bafybeig5akdvjjl2jviph5x76jvdeydk6ykasfkv5em3x7xflm6w3ylmwm From cce8e0f8e05ab55c8cdbee37b33b067ae53ba033 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 11:32:53 +0000 Subject: [PATCH 18/32] chore: autonomy packages lock --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 24a2ba774..5e48438d5 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa", - "skill/valory/decision_maker_abci/0.1.0": "bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu", - "skill/valory/trader_abci/0.1.0": "bafybeigicr3xxcjqxvfuhebw5pkxfsf4qqpggdtyfte5pg6kzwwlygop2q", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeib67oxviltdoc3kvbct4e4xtqbiuumszw4kn7v5pzmvf7ihp7dnc4", + "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", + "skill/valory/decision_maker_abci/0.1.0": "bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq", + "skill/valory/trader_abci/0.1.0": "bafybeigopbkks7bdcz37d6u47xwy45efxsms2k2c7466ugltjcobllmoby", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeif27ay3c3f35up46epc3fmgf4qg6qrp3gfrho5xeu2aeyqt5encke", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeiayrzetoc4ulguyv2kt6pf7fcjnvwk35jnw5le3a5oj7ktyc7xe2a", - "service/valory/trader/0.1.0": "bafybeifa6q4guogtlo2rshptf5xdzyxojhfesvagiucyl2ht4vepwuudku", - "service/valory/trader_pearl/0.1.0": "bafybeid6rze7eua5g2s2e3n2ywhdsvard5lejnvxwkvr3utt3jkgre2zry" + "agent/valory/trader/0.1.0": "bafybeifqpr2n24r72envxc7vvv7qi2zjf734ehutgacgrrh66vq3vinaba", + "service/valory/trader/0.1.0": "bafybeic4tzlqlxz6d5f27tuszadmi3ci4unb53bkutmss7pfrrywjoq7ru", + "service/valory/trader_pearl/0.1.0": "bafybeick3rljpj5jyp5m6zoxem2ftkq2qigjw6fm4tjfhnszpen763a6kq" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 261b9f7e6..289daab1f 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib67oxviltdoc3kvbct4e4xtqbiuumszw4kn7v5pzmvf7ihp7dnc4 -- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa -- valory/decision_maker_abci:0.1.0:bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu -- valory/trader_abci:0.1.0:bafybeigicr3xxcjqxvfuhebw5pkxfsf4qqpggdtyfte5pg6kzwwlygop2q +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif27ay3c3f35up46epc3fmgf4qg6qrp3gfrho5xeu2aeyqt5encke +- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq +- valory/decision_maker_abci:0.1.0:bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq +- valory/trader_abci:0.1.0:bafybeigopbkks7bdcz37d6u47xwy45efxsms2k2c7466ugltjcobllmoby - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index d59393035..65cecdc6a 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:bafybeiayrzetoc4ulguyv2kt6pf7fcjnvwk35jnw5le3a5oj7ktyc7xe2a +agent: valory/trader:0.1.0:bafybeifqpr2n24r72envxc7vvv7qi2zjf734ehutgacgrrh66vq3vinaba number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 482a0e0ab..f290c9335 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiayrzetoc4ulguyv2kt6pf7fcjnvwk35jnw5le3a5oj7ktyc7xe2a +agent: valory/trader:0.1.0:bafybeifqpr2n24r72envxc7vvv7qi2zjf734ehutgacgrrh66vq3vinaba number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index e41288648..55168dc5e 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa +- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 133d6ac24..7d3eb741d 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeiflv6n2t5ptofgvy4clds5vdrheefvp4uycvwcwznxcbvthjvylxa -- valory/decision_maker_abci:0.1.0:bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib67oxviltdoc3kvbct4e4xtqbiuumszw4kn7v5pzmvf7ihp7dnc4 +- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq +- valory/decision_maker_abci:0.1.0:bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif27ay3c3f35up46epc3fmgf4qg6qrp3gfrho5xeu2aeyqt5encke - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 7983a92ab..bc159d6c0 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeihhpknnnyr5jryegqk5nxmoyt43bjzykabvv7dw22h77zsbe3ebiu +- valory/decision_maker_abci:0.1.0:bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From ae56e814f61fa4cf6ca197f4f94e186db7273bad Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 11:51:11 +0000 Subject: [PATCH 19/32] fix: tests --- packages/packages.json | 12 ++++++------ packages/valory/agents/trader/aea-config.yaml | 6 +++--- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 6 +++--- .../tests/states/test_blacklising.py | 8 ++++---- .../tests/states/test_sampling.py | 6 +++--- .../decision_maker_abci/tests/test_handlers.py | 7 ++++++- packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../skills/tx_settlement_multiplexer_abci/skill.yaml | 2 +- 10 files changed, 30 insertions(+), 25 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 5e48438d5..a45ffd7fb 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -16,14 +16,14 @@ "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", - "skill/valory/decision_maker_abci/0.1.0": "bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq", - "skill/valory/trader_abci/0.1.0": "bafybeigopbkks7bdcz37d6u47xwy45efxsms2k2c7466ugltjcobllmoby", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeif27ay3c3f35up46epc3fmgf4qg6qrp3gfrho5xeu2aeyqt5encke", + "skill/valory/decision_maker_abci/0.1.0": "bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4", + "skill/valory/trader_abci/0.1.0": "bafybeigk4ysr7o45uvhk3e7dbhgtzfioxjzyv7zerhyn5eafgogsh7fxve", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeideqcmytcot5whyddmvfa7zeokjvcc3ob7dmwb4ys4e6vgjeqc5hm", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeifqpr2n24r72envxc7vvv7qi2zjf734ehutgacgrrh66vq3vinaba", - "service/valory/trader/0.1.0": "bafybeic4tzlqlxz6d5f27tuszadmi3ci4unb53bkutmss7pfrrywjoq7ru", - "service/valory/trader_pearl/0.1.0": "bafybeick3rljpj5jyp5m6zoxem2ftkq2qigjw6fm4tjfhnszpen763a6kq" + "agent/valory/trader/0.1.0": "bafybeiaoilde4bmzgqubx7bc5jd7lgdx3rsba5yrpwo6fjooy2diydhnsa", + "service/valory/trader/0.1.0": "bafybeifi7j6esuofmwgouh5pm5vyx7gfsbh7d4w4vqytflejkqyh5bxlea", + "service/valory/trader_pearl/0.1.0": "bafybeiczgjodch7df3btqq7hcd3rvd64jqtx4louccrbjlmq7ptnydpp5q" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 289daab1f..c4fd94bd5 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif27ay3c3f35up46epc3fmgf4qg6qrp3gfrho5xeu2aeyqt5encke +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeideqcmytcot5whyddmvfa7zeokjvcc3ob7dmwb4ys4e6vgjeqc5hm - valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq -- valory/trader_abci:0.1.0:bafybeigopbkks7bdcz37d6u47xwy45efxsms2k2c7466ugltjcobllmoby +- valory/decision_maker_abci:0.1.0:bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4 +- valory/trader_abci:0.1.0:bafybeigk4ysr7o45uvhk3e7dbhgtzfioxjzyv7zerhyn5eafgogsh7fxve - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 65cecdc6a..ea27060ab 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:bafybeifqpr2n24r72envxc7vvv7qi2zjf734ehutgacgrrh66vq3vinaba +agent: valory/trader:0.1.0:bafybeiaoilde4bmzgqubx7bc5jd7lgdx3rsba5yrpwo6fjooy2diydhnsa number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index f290c9335..16ee2fa73 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifqpr2n24r72envxc7vvv7qi2zjf734ehutgacgrrh66vq3vinaba +agent: valory/trader:0.1.0:bafybeiaoilde4bmzgqubx7bc5jd7lgdx3rsba5yrpwo6fjooy2diydhnsa number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 55168dc5e..cf8410003 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -61,7 +61,7 @@ fingerprint: tests/conftest.py: bafybeidy5hw56kw5mxudnfbhvogofn6k4rqb4ux2bd45baedrrhmgyrude tests/states/test_base.py: bafybeigiuctxda3npkbvx7nsq4jvqpckvbzgqlj76hdpk2ntc52ppc4vnm tests/states/test_bet_placement.py: bafybeibvc37n2cluep4tasvgmvwxwne2deais6ptirducpogk67v4gj4ga - tests/states/test_blacklising.py: bafybeihm2ex6l7fhorgi3mjj2epztu2r7bqbg56unpgpzfzymghshchqzy + tests/states/test_blacklising.py: bafybeifcsv7v34qi75vx5kw6w72wdjfxyq7vjcfm2oejqgpxitlnk7athy tests/states/test_check_benchmarking.py: bafybeifwpi5f4fhreqptfxdsnyv3nptkqytkwbukfuqkrjo4eww7cv3sxy tests/states/test_claim_subscription.py: bafybeiclkxjhceb3ehgmg6klt4uywew5drk5b3w6no7mwxetpubxqrejfy tests/states/test_decision_receive.py: bafybeicrf3avaikxrxf5c2fxjckcpckpz66y23emdscf6fbbe36x7nbphm @@ -71,10 +71,10 @@ fingerprint: tests/states/test_order_subscription.py: bafybeidx2tzivsxhpr5xx5e5h2xmpjyewfogt2mujv4sq3hbaeksmcbvhy tests/states/test_randomness.py: bafybeib3eqjv6mhlprzda7d4viddn5alrfqteq6juyg3ccejseoywcsbey tests/states/test_redeem.py: bafybeiezdnfrxukb2xpwffrr357g2anmdkwy7wo3nphvlggipq5xrdzr7a - tests/states/test_sampling.py: bafybeid7vsednazdnos4nnveymwjc3qpcg6e2r5ubkzcgiqfy3tji6nx5m + tests/states/test_sampling.py: bafybeigefevj5ncbey2ynoctifqsmw6fa6ybhojoo4ah3derfgcwjqpwoy tests/states/test_tool_selection.py: bafybeib7js3dj7647t33o5ybfqftwytxktwrvhbri5yuyymg6znj6y7xxa tests/test_dialogues.py: bafybeibulo64tgfrq4e5qbcqnmifrlehkqciwuavublints353zaj2mlpa - tests/test_handlers.py: bafybeihpkgtjjm3uegpup6zkznpoaxqpu6kmp3ujiggrzbe73p5fzlq7im + tests/test_handlers.py: bafybeibpmso4geiw6n72lteqiqwjnkaux7rlkh7z3i2teuo2x4ajt3izye tests/test_payloads.py: bafybeic6h4jxlb6rxyx4fde753xvfdo5lszfcl2j6wlb266v3cxjrluqgi tests/test_rounds.py: bafybeigifftusd4ew42tyvyrr55o2uehhcik2gdq3atkpjwwlqdeskedty utils/__init__.py: bafybeiazrfg3kwfdl5q45azwz6b6mobqxngxpf4hazmrnkhinpk4qhbbf4 diff --git a/packages/valory/skills/decision_maker_abci/tests/states/test_blacklising.py b/packages/valory/skills/decision_maker_abci/tests/states/test_blacklising.py index 02b7dba0f..835684890 100644 --- a/packages/valory/skills/decision_maker_abci/tests/states/test_blacklising.py +++ b/packages/valory/skills/decision_maker_abci/tests/states/test_blacklising.py @@ -30,7 +30,7 @@ from packages.valory.skills.decision_maker_abci.states.blacklisting import ( BlacklistingRound, ) -from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound +from packages.valory.skills.market_manager_abci.rounds import BaseUpdateBetsRound @pytest.fixture @@ -76,7 +76,7 @@ def test_blacklisting_round_end_block_done_event_no_benchmarking( # Mock the superclass end_block to return DONE event synced_data = MagicMock(spec=SynchronizedData) with patch.object( - UpdateBetsRound, "end_block", return_value=(synced_data, Event.DONE) + BaseUpdateBetsRound, "end_block", return_value=(synced_data, Event.DONE) ) as mock_super_end_block: result = blacklisting_round.end_block() @@ -95,7 +95,7 @@ def test_blacklisting_round_end_block_done_event_with_benchmarking( # Mock the superclass end_block to return DONE event synced_data = MagicMock(spec=SynchronizedData) with patch.object( - UpdateBetsRound, "end_block", return_value=(synced_data, Event.DONE) + BaseUpdateBetsRound, "end_block", return_value=(synced_data, Event.DONE) ) as mock_super_end_block: result = blacklisting_round.end_block() @@ -113,7 +113,7 @@ def test_blacklisting_round_end_block_none_event( """Test end_block when the superclass returns None.""" # Mock the superclass end_block to return None with patch.object( - UpdateBetsRound, "end_block", return_value=None + BaseUpdateBetsRound, "end_block", return_value=None ) as mock_super_end_block: result = blacklisting_round.end_block() diff --git a/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py b/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py index d420f7b5d..ce1ccbf54 100644 --- a/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py +++ b/packages/valory/skills/decision_maker_abci/tests/states/test_sampling.py @@ -28,7 +28,7 @@ Event, SynchronizedData, ) -from packages.valory.skills.market_manager_abci.rounds import UpdateBetsRound +from packages.valory.skills.market_manager_abci.rounds import BaseUpdateBetsRound # Mock classes to simulate required attributes @@ -90,9 +90,9 @@ def test_sampling_payload_initialization(self) -> None: assert payload.bets_hash == "mock_bets_hash" assert payload.index == 0 # Check that the index is correctly initialized - def test_sampling_round_inherits_update_bets_round(self) -> None: + def test_sampling_round_inherits_base_update_bets_round(self) -> None: """Test that SamplingRound inherits from UpdateBetsRound.""" - assert issubclass(SamplingRound, UpdateBetsRound) + assert issubclass(SamplingRound, BaseUpdateBetsRound) def test_sampling_round_selection_key( self, setup_sampling_round: SamplingRound diff --git a/packages/valory/skills/decision_maker_abci/tests/test_handlers.py b/packages/valory/skills/decision_maker_abci/tests/test_handlers.py index f934bbbe4..96871a2f0 100644 --- a/packages/valory/skills/decision_maker_abci/tests/test_handlers.py +++ b/packages/valory/skills/decision_maker_abci/tests/test_handlers.py @@ -159,10 +159,15 @@ def test_setup(self) -> None: local_ip_regex = r"192\.168(\.\d{1,3}){2}" hostname_regex = rf".*({config_uri_base_hostname}|{propel_uri_base_hostname}|{local_ip_regex}|localhost|127.0.0.1|0.0.0.0)(:\d+)?" health_url_regex = rf"{hostname_regex}\/healthcheck" + metrics_url_regex = rf"{hostname_regex}\/metrics" assert self.handler.handler_url_regex == rf"{hostname_regex}\/.*" assert self.handler.routes == { (HttpMethod.GET.value, HttpMethod.HEAD.value): [ - (health_url_regex, self.handler._handle_get_health), + ( + health_url_regex, + self.handler._handle_get_health, + ), + (metrics_url_regex, self.handler._handle_get_metrics), ], } assert self.handler.json_content_header == "Content-Type: application/json\n" diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 7d3eb741d..7c455e8f0 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -27,8 +27,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif27ay3c3f35up46epc3fmgf4qg6qrp3gfrho5xeu2aeyqt5encke +- valory/decision_maker_abci:0.1.0:bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeideqcmytcot5whyddmvfa7zeokjvcc3ob7dmwb4ys4e6vgjeqc5hm - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index bc159d6c0..16a6f5300 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeie26kcji2v72s334sa3jpwjrsyor5efdvt4kfu76jfnqlqgdmlqsq +- valory/decision_maker_abci:0.1.0:bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4 - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 572ce4bcb307ffa2ced29df488af7ab73c06f693 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 12:01:42 +0000 Subject: [PATCH 20/32] fix: test decision request payload --- .../valory/skills/decision_maker_abci/tests/test_payloads.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/valory/skills/decision_maker_abci/tests/test_payloads.py b/packages/valory/skills/decision_maker_abci/tests/test_payloads.py index a81974001..7019db757 100644 --- a/packages/valory/skills/decision_maker_abci/tests/test_payloads.py +++ b/packages/valory/skills/decision_maker_abci/tests/test_payloads.py @@ -88,6 +88,7 @@ { "mech_requests": "dummy mech requests", "mocking_mode": True, + "decision_request_timestamp": int(datetime.utcnow().timestamp()), }, ), ( From eddd0fa62e3d1c07f8ef97c5ce8bfaa0c76284ad Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 12:02:12 +0000 Subject: [PATCH 21/32] chore: generators --- packages/packages.json | 12 ++++++------ packages/valory/agents/trader/aea-config.yaml | 6 +++--- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../skills/tx_settlement_multiplexer_abci/skill.yaml | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index a45ffd7fb..e1d55afa8 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -16,14 +16,14 @@ "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", - "skill/valory/decision_maker_abci/0.1.0": "bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4", - "skill/valory/trader_abci/0.1.0": "bafybeigk4ysr7o45uvhk3e7dbhgtzfioxjzyv7zerhyn5eafgogsh7fxve", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeideqcmytcot5whyddmvfa7zeokjvcc3ob7dmwb4ys4e6vgjeqc5hm", + "skill/valory/decision_maker_abci/0.1.0": "bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q", + "skill/valory/trader_abci/0.1.0": "bafybeib32d3jg3wymbuhu27iocasrrmwmb2cwbcn7tbfph4j2r6ovxqa3i", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeiaoilde4bmzgqubx7bc5jd7lgdx3rsba5yrpwo6fjooy2diydhnsa", - "service/valory/trader/0.1.0": "bafybeifi7j6esuofmwgouh5pm5vyx7gfsbh7d4w4vqytflejkqyh5bxlea", - "service/valory/trader_pearl/0.1.0": "bafybeiczgjodch7df3btqq7hcd3rvd64jqtx4louccrbjlmq7ptnydpp5q" + "agent/valory/trader/0.1.0": "bafybeie6dxxvszzrkcqv44fzdektifeuadoekwflxllepxocyuuot3tbpu", + "service/valory/trader/0.1.0": "bafybeiclcbbpbkmx62w4emtdwfbxzg7jvk2up47g4d3j734tbpobc7g7jm", + "service/valory/trader_pearl/0.1.0": "bafybeig2mwuisvaa5ddcxio65twqp5rezucv3e4tmkv3ssltizx62adbuy" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index c4fd94bd5..dd45b61da 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeideqcmytcot5whyddmvfa7zeokjvcc3ob7dmwb4ys4e6vgjeqc5hm +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym - valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4 -- valory/trader_abci:0.1.0:bafybeigk4ysr7o45uvhk3e7dbhgtzfioxjzyv7zerhyn5eafgogsh7fxve +- valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q +- valory/trader_abci:0.1.0:bafybeib32d3jg3wymbuhu27iocasrrmwmb2cwbcn7tbfph4j2r6ovxqa3i - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index ea27060ab..c21e5ef66 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:bafybeiaoilde4bmzgqubx7bc5jd7lgdx3rsba5yrpwo6fjooy2diydhnsa +agent: valory/trader:0.1.0:bafybeie6dxxvszzrkcqv44fzdektifeuadoekwflxllepxocyuuot3tbpu number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 16ee2fa73..e2df8eb9c 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiaoilde4bmzgqubx7bc5jd7lgdx3rsba5yrpwo6fjooy2diydhnsa +agent: valory/trader:0.1.0:bafybeie6dxxvszzrkcqv44fzdektifeuadoekwflxllepxocyuuot3tbpu number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index cf8410003..1bf5e31de 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -75,7 +75,7 @@ fingerprint: tests/states/test_tool_selection.py: bafybeib7js3dj7647t33o5ybfqftwytxktwrvhbri5yuyymg6znj6y7xxa tests/test_dialogues.py: bafybeibulo64tgfrq4e5qbcqnmifrlehkqciwuavublints353zaj2mlpa tests/test_handlers.py: bafybeibpmso4geiw6n72lteqiqwjnkaux7rlkh7z3i2teuo2x4ajt3izye - tests/test_payloads.py: bafybeic6h4jxlb6rxyx4fde753xvfdo5lszfcl2j6wlb266v3cxjrluqgi + tests/test_payloads.py: bafybeihsddwzadctsieu5r75oykgu34zvjxsxx7fdsg3ucuruxajzqw5om tests/test_rounds.py: bafybeigifftusd4ew42tyvyrr55o2uehhcik2gdq3atkpjwwlqdeskedty utils/__init__.py: bafybeiazrfg3kwfdl5q45azwz6b6mobqxngxpf4hazmrnkhinpk4qhbbf4 utils/nevermined.py: bafybeigallaqxhqopznhjhefr6bukh4ojkz5vdtqyzod5dksshrf24fjgi diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 7c455e8f0..59dc4fd8b 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -27,8 +27,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4 -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeideqcmytcot5whyddmvfa7zeokjvcc3ob7dmwb4ys4e6vgjeqc5hm +- valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 16a6f5300..98c7db48a 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeifdm6dwvii72km3v66vkdkzpqyltxi6nrqqhq2keozokp6qid7yy4 +- valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 7132eb2cb63a1d86ffd147a37a46542768a3e35a Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 12:13:21 +0000 Subject: [PATCH 22/32] fix: check stop trading payload test --- packages/packages.json | 10 +++++----- packages/valory/agents/trader/aea-config.yaml | 4 ++-- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/check_stop_trading_abci/skill.yaml | 2 +- .../check_stop_trading_abci/tests/test_payloads.py | 4 ++-- packages/valory/skills/trader_abci/skill.yaml | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index e1d55afa8..82fea2f10 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", "skill/valory/decision_maker_abci/0.1.0": "bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q", - "skill/valory/trader_abci/0.1.0": "bafybeib32d3jg3wymbuhu27iocasrrmwmb2cwbcn7tbfph4j2r6ovxqa3i", + "skill/valory/trader_abci/0.1.0": "bafybeifrwvcbjb5l4aeidod3liqpjki7unvxj2muntsjgk3bklfpnuq6e4", "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym", "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254", - "agent/valory/trader/0.1.0": "bafybeie6dxxvszzrkcqv44fzdektifeuadoekwflxllepxocyuuot3tbpu", - "service/valory/trader/0.1.0": "bafybeiclcbbpbkmx62w4emtdwfbxzg7jvk2up47g4d3j734tbpobc7g7jm", - "service/valory/trader_pearl/0.1.0": "bafybeig2mwuisvaa5ddcxio65twqp5rezucv3e4tmkv3ssltizx62adbuy" + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeia5uldu4na4qtrli7sbahrsdc56egagltvtrrvaiivvsceljd5uje", + "agent/valory/trader/0.1.0": "bafybeibokakryadwpryl6byoet2u7rhz2danebgf5mxx3rh6ybyoqbdouq", + "service/valory/trader/0.1.0": "bafybeibxojlj4pviipsgqttkmpt5k4izjsug554pn5yy4lses3ppxlgtxi", + "service/valory/trader_pearl/0.1.0": "bafybeiggxhsjbcpmz26kju7ifujr4st2z2k2qry62zs3zoyoyrdzq7jvau" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index dd45b61da..a5633b2d7 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -49,9 +49,9 @@ skills: - valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym - valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq - valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q -- valory/trader_abci:0.1.0:bafybeib32d3jg3wymbuhu27iocasrrmwmb2cwbcn7tbfph4j2r6ovxqa3i +- valory/trader_abci:0.1.0:bafybeifrwvcbjb5l4aeidod3liqpjki7unvxj2muntsjgk3bklfpnuq6e4 - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 -- valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 +- valory/check_stop_trading_abci:0.1.0:bafybeia5uldu4na4qtrli7sbahrsdc56egagltvtrrvaiivvsceljd5uje - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index c21e5ef66..22877972b 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:bafybeie6dxxvszzrkcqv44fzdektifeuadoekwflxllepxocyuuot3tbpu +agent: valory/trader:0.1.0:bafybeibokakryadwpryl6byoet2u7rhz2danebgf5mxx3rh6ybyoqbdouq number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index e2df8eb9c..37ee42b31 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeie6dxxvszzrkcqv44fzdektifeuadoekwflxllepxocyuuot3tbpu +agent: valory/trader:0.1.0:bafybeibokakryadwpryl6byoet2u7rhz2danebgf5mxx3rh6ybyoqbdouq number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 4cd027b99..88d86ca1e 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -18,7 +18,7 @@ fingerprint: tests/__init__.py: bafybeihv2cjk4va5bc5ncqtppqg2xmmxcro34bma36trtvk32gtmhdycxu tests/test_dialogues.py: bafybeia5ac27w7ijx2nyx5dqyrnv4troo4572gjq7nrcxdncexoxucnqti tests/test_handlers.py: bafybeigpmtx2hyunzn6nxk2x4bvvybek7jvuhbk34fqlj7fgfsszcoqhxy - tests/test_payloads.py: bafybeibygk4xox7itkxwypolxp6yak2hpbtvhtpdaqey2zj6qxqnzo4uqm + tests/test_payloads.py: bafybeic3sbhm7maqyrxkr7pshtzi3tt2prnyb5nvaywj36ttkd5nw7sate tests/test_rounds.py: bafybeigxv27wqlpf4si2xcpe7bgn6k6ubr5nt37w7sskiapbuht5miz3wq fingerprint_ignore_patterns: [] connections: [] diff --git a/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py b/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py index a27d2a448..a6c6bf0bc 100644 --- a/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py +++ b/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py @@ -29,6 +29,6 @@ def test_check_stop_trading_payload() -> None: payload = CheckStopTradingPayload(sender="sender", vote=True, mech_request_count=1) assert payload.vote - assert payload.data == {"vote": True} - assert payload.mech_request_count == 1 + assert payload.mech_request_count + assert payload.data == {"vote": True, "mech_request_count": 1} assert CheckStopTradingPayload.from_json(payload.json) == payload diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 59dc4fd8b..d26d43db0 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -30,7 +30,7 @@ skills: - valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q - valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym - valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 -- valory/check_stop_trading_abci:0.1.0:bafybeiggs243oehh736f3j4lwuahgperjfnkv6clxdmqdqjbt62g46q254 +- valory/check_stop_trading_abci:0.1.0:bafybeia5uldu4na4qtrli7sbahrsdc56egagltvtrrvaiivvsceljd5uje - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: From c37cdd2d148be2edebb0dd52bdf07851486e7a20 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 19 Dec 2024 13:15:49 +0000 Subject: [PATCH 23/32] fix: tests --- packages/packages.json | 18 +++---- packages/valory/agents/trader/aea-config.yaml | 12 ++--- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 2 +- .../skills/decision_maker_abci/skill.yaml | 4 +- .../skills/market_manager_abci/skill.yaml | 2 +- .../market_manager_abci/tests/test_rounds.py | 53 +++++++++++-------- .../valory/skills/staking_abci/skill.yaml | 4 +- .../staking_abci/tests/test_payloads.py | 1 + .../skills/staking_abci/tests/test_rounds.py | 6 +++ packages/valory/skills/trader_abci/skill.yaml | 10 ++-- .../tx_settlement_multiplexer_abci/skill.yaml | 4 +- 13 files changed, 68 insertions(+), 52 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 82fea2f10..b4558c8d3 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq", - "skill/valory/decision_maker_abci/0.1.0": "bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q", - "skill/valory/trader_abci/0.1.0": "bafybeifrwvcbjb5l4aeidod3liqpjki7unvxj2muntsjgk3bklfpnuq6e4", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym", - "skill/valory/staking_abci/0.1.0": "bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeia5uldu4na4qtrli7sbahrsdc56egagltvtrrvaiivvsceljd5uje", - "agent/valory/trader/0.1.0": "bafybeibokakryadwpryl6byoet2u7rhz2danebgf5mxx3rh6ybyoqbdouq", - "service/valory/trader/0.1.0": "bafybeibxojlj4pviipsgqttkmpt5k4izjsug554pn5yy4lses3ppxlgtxi", - "service/valory/trader_pearl/0.1.0": "bafybeiggxhsjbcpmz26kju7ifujr4st2z2k2qry62zs3zoyoyrdzq7jvau" + "skill/valory/market_manager_abci/0.1.0": "bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce", + "skill/valory/decision_maker_abci/0.1.0": "bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy", + "skill/valory/trader_abci/0.1.0": "bafybeifsh6vlual5aikj2wxmjlzpfqz7rnegdihs6yopg7wbqecnamqrpm", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaiiyipkq57rcrsxlvaoytsher37rw3dplda6mpcw67wx5276wbgm", + "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla", + "agent/valory/trader/0.1.0": "bafybeiefd2bglm4qgww7ftx7jvyhrwbqbemoghdvxmgzy7wrubsap363oi", + "service/valory/trader/0.1.0": "bafybeidvxl6myaxxspjpbvoace2lzsad2a5w3qoepyqzrvkvvte5wq7jqa", + "service/valory/trader_pearl/0.1.0": "bafybeih57im33ur6ua5zgfnpgvys2konmwpm5wmcjslccajjkwowvaat7m" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index a5633b2d7..c0027cbbe 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,12 +46,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym -- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q -- valory/trader_abci:0.1.0:bafybeifrwvcbjb5l4aeidod3liqpjki7unvxj2muntsjgk3bklfpnuq6e4 -- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 -- valory/check_stop_trading_abci:0.1.0:bafybeia5uldu4na4qtrli7sbahrsdc56egagltvtrrvaiivvsceljd5uje +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaiiyipkq57rcrsxlvaoytsher37rw3dplda6mpcw67wx5276wbgm +- valory/market_manager_abci:0.1.0:bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce +- valory/decision_maker_abci:0.1.0:bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy +- valory/trader_abci:0.1.0:bafybeifsh6vlual5aikj2wxmjlzpfqz7rnegdihs6yopg7wbqecnamqrpm +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 +- valory/check_stop_trading_abci:0.1.0:bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 22877972b..1cc2adec4 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:bafybeibokakryadwpryl6byoet2u7rhz2danebgf5mxx3rh6ybyoqbdouq +agent: valory/trader:0.1.0:bafybeiefd2bglm4qgww7ftx7jvyhrwbqbemoghdvxmgzy7wrubsap363oi number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 37ee42b31..9c790e2d3 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeibokakryadwpryl6byoet2u7rhz2danebgf5mxx3rh6ybyoqbdouq +agent: valory/trader:0.1.0:bafybeiefd2bglm4qgww7ftx7jvyhrwbqbemoghdvxmgzy7wrubsap363oi number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 88d86ca1e..2e9ee38d2 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 behaviours: main: args: {} diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 1bf5e31de..2e44839b0 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -101,10 +101,10 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq +- valory/market_manager_abci:0.1.0:bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm -- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 behaviours: main: args: {} diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 4fadb771c..b353a51c3 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -29,7 +29,7 @@ fingerprint: tests/test_dialogues.py: bafybeiet646su5nsjmvruahuwg6un4uvwzyj2lnn2jvkye6cxooz22f3ja tests/test_handlers.py: bafybeiaz3idwevvlplcyieaqo5oeikuthlte6e2gi4ajw452ylvimwgiki tests/test_payloads.py: bafybeia3qstr7ieu2nenznqtmuvipmnequkcp5vwefl7buinckwttx674m - tests/test_rounds.py: bafybeiappkwes6ausj63quzg7hapdmubltiks4x54b54i6il6vrdpsnu2m + tests/test_rounds.py: bafybeihowwdqree7mtbxmfrl5hjido4d5qqgbwidsciir5kjbbz5gldroe fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/market_manager_abci/tests/test_rounds.py b/packages/valory/skills/market_manager_abci/tests/test_rounds.py index 342ddd311..f71039001 100644 --- a/packages/valory/skills/market_manager_abci/tests/test_rounds.py +++ b/packages/valory/skills/market_manager_abci/tests/test_rounds.py @@ -45,7 +45,7 @@ from packages.valory.skills.abstract_round_abci.test_tools.rounds import ( BaseCollectSameUntilThresholdRoundTest, ) -from packages.valory.skills.market_manager_abci.payloads import BaseUpdateBetsPayload +from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import ( Event, FailedMarketManagerRound, @@ -86,11 +86,18 @@ def get_participants() -> FrozenSet[str]: def get_payloads( - data: Optional[str], + bets_hash: Optional[str], + wallet_balance: Optional[int], + token_balance: Optional[int], ) -> Mapping[str, BaseTxPayload]: """Get payloads.""" return { - participant: BaseUpdateBetsPayload(participant, data) + participant: UpdateBetsPayload( + sender=participant, + bets_hash=bets_hash, + wallet_balance=wallet_balance, + token_balance=token_balance, + ) for participant in get_participants() } @@ -131,17 +138,15 @@ def run_test(self, test_case: RoundTestCase) -> None: synchronized_data=self.synchronized_data, context=mock.MagicMock() ) - self._complete_run( - self._test_round( - test_round=test_round, - round_payloads=test_case.payloads, - synchronized_data_update_fn=lambda sync_data, _: sync_data.update( - **test_case.final_data - ), - synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, - most_voted_payload=test_case.most_voted_payload, - exit_event=test_case.event, - ) + self._test_round( + test_round=test_round, + round_payloads=test_case.payloads, + synchronized_data_update_fn=lambda sync_data, _: sync_data.update( + **test_case.final_data + ), + synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, + most_voted_payload=test_case.most_voted_payload, + exit_event=test_case.event, ) @@ -160,7 +165,9 @@ class TestUpdateBetsRound(BaseMarketManagerRoundTestClass): name="Happy path", initial_data={}, payloads=get_payloads( - data=DUMMY_BETS_HASH, + bets_hash=DUMMY_BETS_HASH, + wallet_balance=1, + token_balance=1, ), final_data={ "bets_hash": DUMMY_BETS_HASH, @@ -176,7 +183,9 @@ class TestUpdateBetsRound(BaseMarketManagerRoundTestClass): name="Fetch error", initial_data={}, payloads=get_payloads( - data=None, + bets_hash=None, + wallet_balance=None, + token_balance=None, ), final_data={}, event=Event.FETCH_ERROR, @@ -251,16 +260,16 @@ def test_market_manager_abci_app_initialization(abci_app: MarketManagerAbciApp) # Mock serialized collections for different keys -DUMMY_PARTICIPANT_TO_BETS_HASH = json.dumps( +DUMMY_PARTICIPANT_TO_BETS_HASH_S = json.dumps( { "agent_0": {"sender": "agent_0", "data": "bet_1"}, "agent_1": {"sender": "agent_1", "data": "bet_2"}, } ) -DUMMY_BETS_HASH = json.dumps({"bets_hash": "dummy_bets_hash"}) +DUMMY_BETS_HASH_S = json.dumps({"bets_hash": "dummy_bets_hash"}) -DUMMY_SERIALIZED_PARTICIPANT_TO_BETS_HASH = json.dumps(DUMMY_PARTICIPANT_TO_BETS_HASH) -DUMMY_SERIALIZED_BETS_HASH = json.dumps(DUMMY_BETS_HASH) +DUMMY_SERIALIZED_PARTICIPANT_TO_BETS_HASH = json.dumps(DUMMY_PARTICIPANT_TO_BETS_HASH_S) +DUMMY_SERIALIZED_BETS_HASH = json.dumps(DUMMY_BETS_HASH_S) @pytest.mark.parametrize( @@ -269,13 +278,13 @@ def test_market_manager_abci_app_initialization(abci_app: MarketManagerAbciApp) ( "participant_to_bets_hash", DUMMY_SERIALIZED_PARTICIPANT_TO_BETS_HASH, - json.loads(DUMMY_PARTICIPANT_TO_BETS_HASH), + json.loads(DUMMY_PARTICIPANT_TO_BETS_HASH_S), "participant_to_bets_hash", ), ( "bets_hash", DUMMY_SERIALIZED_BETS_HASH, - json.loads(DUMMY_BETS_HASH), + json.loads(DUMMY_BETS_HASH_S), "bets_hash", ), ], diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index e17e2403d..7a232fb80 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -18,8 +18,8 @@ fingerprint: tests/__init__.py: bafybeid7m6ynosqeb4mvsss2hqg75aly5o2d47r7yfg2xtgwzkkilv2d2m tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme - tests/test_payloads.py: bafybeidtkbudsmrx77xs2oooji6cpj7kx7nembf77u32if2sb2kvkavvhq - tests/test_rounds.py: bafybeidge7sp3udobhvjpbdj5kirkukd6w5qycqkcuc6sy3qqiedco2q4i + tests/test_payloads.py: bafybeicgnkiwj6quwfytojjkfoab2yud76khttlqvrtvl4x4eguyceetke + tests/test_rounds.py: bafybeih542rlhhdl5bo7wjviqliicy22a4thekm5fjfdoqxvx55swmv6ge fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/tests/test_payloads.py b/packages/valory/skills/staking_abci/tests/test_payloads.py index f9a7b316b..1487bbcc4 100644 --- a/packages/valory/skills/staking_abci/tests/test_payloads.py +++ b/packages/valory/skills/staking_abci/tests/test_payloads.py @@ -43,6 +43,7 @@ "tx_hash": "dummy tx hash", "ts_checkpoint": 1, "is_checkpoint_reached": True, + "available_slot_count": 0, }, ), ], diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index 2a0564afd..5602320e3 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -66,6 +66,7 @@ def abci_app() -> StakingAbciApp: "tx_hash": "dummy_tx_hash", "ts_checkpoint": 0, "is_checkpoint_reached": True, + "available_slot_count": 0, } @@ -152,6 +153,7 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): "tx_hash": "dummy_tx_hash", "ts_checkpoint": 0, "is_checkpoint_reached": True, + "available_slot_count": 0, } ), final_data={ @@ -160,6 +162,7 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): "tx_hash": "dummy_tx_hash", "ts_checkpoint": 0, "is_checkpoint_reached": True, + "available_slot_count": 0, }, event=Event.DONE, most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], @@ -192,6 +195,7 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): "tx_hash": "dummy_tx_hash", "ts_checkpoint": 0, "is_checkpoint_reached": True, + "available_slot_count": 0, } ), final_data={}, @@ -212,6 +216,7 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): "tx_hash": None, "ts_checkpoint": 0, "is_checkpoint_reached": True, + "available_slot_count": 0, } ), final_data={}, @@ -291,6 +296,7 @@ def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None: get_name(SynchronizedData.service_staking_state), get_name(SynchronizedData.previous_checkpoint), get_name(SynchronizedData.is_checkpoint_reached), + get_name(SynchronizedData.available_staking_slots), }, FinishedStakingRound: { get_name(SynchronizedData.service_staking_state), diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index d26d43db0..96396719c 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,11 +26,11 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeih5r5dstwiouiv2ue3pezu6mf77b5n64rge6vm3y3cvy336lu7kyq -- valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichwngeh3wiqxxp34zdbx77gzw2bhc5dkovsmwogtppenn3kyk4ym -- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 -- valory/check_stop_trading_abci:0.1.0:bafybeia5uldu4na4qtrli7sbahrsdc56egagltvtrrvaiivvsceljd5uje +- valory/market_manager_abci:0.1.0:bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce +- valory/decision_maker_abci:0.1.0:bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaiiyipkq57rcrsxlvaoytsher37rw3dplda6mpcw67wx5276wbgm +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 +- valory/check_stop_trading_abci:0.1.0:bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 98c7db48a..3f3a60632 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,8 +23,8 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeicqgue6mens3colokwycsmznlk5fobheteqghmzczbkmlpwm45c7q -- valory/staking_abci:0.1.0:bafybeif2cwf2bcjczbj4fykzyogtvfbfwo3u3ot2gfmeh4cygdenzvt2d4 +- valory/decision_maker_abci:0.1.0:bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: From 8edd3af76935e14d7992305ca2030e784c51b0d7 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 20 Dec 2024 09:34:44 +0000 Subject: [PATCH 24/32] fix: keywords must be strings --- packages/packages.json | 14 ++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/decision_maker_abci/skill.yaml | 2 +- .../skills/market_manager_abci/behaviours.py | 2 -- .../skills/market_manager_abci/rounds.py | 2 +- .../skills/market_manager_abci/skill.yaml | 6 +++--- .../market_manager_abci/tests/test_rounds.py | 20 ++++++++++--------- packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index b4558c8d3..333d95bc5 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce", - "skill/valory/decision_maker_abci/0.1.0": "bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy", - "skill/valory/trader_abci/0.1.0": "bafybeifsh6vlual5aikj2wxmjlzpfqz7rnegdihs6yopg7wbqecnamqrpm", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaiiyipkq57rcrsxlvaoytsher37rw3dplda6mpcw67wx5276wbgm", + "skill/valory/market_manager_abci/0.1.0": "bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme", + "skill/valory/decision_maker_abci/0.1.0": "bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai", + "skill/valory/trader_abci/0.1.0": "bafybeicx7i6733c3qlxubrqfykrbkh7f557ewe6yj7ze2mk3vvlof7mftu", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeif5vmgdasgt6rxe6caq3nxghpvd6tmk6bvus4lunddvuso6m7q53y", "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla", - "agent/valory/trader/0.1.0": "bafybeiefd2bglm4qgww7ftx7jvyhrwbqbemoghdvxmgzy7wrubsap363oi", - "service/valory/trader/0.1.0": "bafybeidvxl6myaxxspjpbvoace2lzsad2a5w3qoepyqzrvkvvte5wq7jqa", - "service/valory/trader_pearl/0.1.0": "bafybeih57im33ur6ua5zgfnpgvys2konmwpm5wmcjslccajjkwowvaat7m" + "agent/valory/trader/0.1.0": "bafybeicpbxsxvp4b4355wvo5x6hiocimzohkd5jk2thl6gneyxlwrf24o4", + "service/valory/trader/0.1.0": "bafybeidfppwgwvkiejudx5kwgxzfgov7lnrw7qgbtm5k6owwg7thzyz6ca", + "service/valory/trader_pearl/0.1.0": "bafybeiaghlwavqqcptardvphgeull6htv4hrpygjug564iao5autmsrupu" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index c0027cbbe..7488bca05 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaiiyipkq57rcrsxlvaoytsher37rw3dplda6mpcw67wx5276wbgm -- valory/market_manager_abci:0.1.0:bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce -- valory/decision_maker_abci:0.1.0:bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy -- valory/trader_abci:0.1.0:bafybeifsh6vlual5aikj2wxmjlzpfqz7rnegdihs6yopg7wbqecnamqrpm +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif5vmgdasgt6rxe6caq3nxghpvd6tmk6bvus4lunddvuso6m7q53y +- valory/market_manager_abci:0.1.0:bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme +- valory/decision_maker_abci:0.1.0:bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai +- valory/trader_abci:0.1.0:bafybeicx7i6733c3qlxubrqfykrbkh7f557ewe6yj7ze2mk3vvlof7mftu - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 1cc2adec4..ac09934a3 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:bafybeiefd2bglm4qgww7ftx7jvyhrwbqbemoghdvxmgzy7wrubsap363oi +agent: valory/trader:0.1.0:bafybeicpbxsxvp4b4355wvo5x6hiocimzohkd5jk2thl6gneyxlwrf24o4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 9c790e2d3..994b0f726 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiefd2bglm4qgww7ftx7jvyhrwbqbemoghdvxmgzy7wrubsap363oi +agent: valory/trader:0.1.0:bafybeicpbxsxvp4b4355wvo5x6hiocimzohkd5jk2thl6gneyxlwrf24o4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 2e44839b0..c5271b6de 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce +- valory/market_manager_abci:0.1.0:bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 10b70f3c2..10c262dfd 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -299,8 +299,6 @@ def async_act(self) -> Generator: wallet_balance = self.wallet_balance token_balance = self.token_balance - print(f"WALLET BALANCE: {wallet_balance}") - bets_hash = self.hash_stored_bets() if self.bets else None payload = UpdateBetsPayload( self.context.agent_address, bets_hash, wallet_balance, token_balance diff --git a/packages/valory/skills/market_manager_abci/rounds.py b/packages/valory/skills/market_manager_abci/rounds.py index 319d2a830..4025c6a8e 100644 --- a/packages/valory/skills/market_manager_abci/rounds.py +++ b/packages/valory/skills/market_manager_abci/rounds.py @@ -125,7 +125,7 @@ class BaseUpdateBetsRound(CollectSameUntilThresholdRound, MarketManagerAbstractR done_event: Enum = Event.DONE none_event: Enum = Event.FETCH_ERROR no_majority_event: Enum = Event.NO_MAJORITY - selection_key = (get_name(SynchronizedData.bets_hash),) + selection_key = get_name(SynchronizedData.bets_hash) collection_key = get_name(SynchronizedData.participant_to_bets_hash) synchronized_data_class = SynchronizedData diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index b353a51c3..392e9d84a 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeig5akdvjjl2jviph5x76jvdeydk6ykasfkv5em3x7xflm6w3ylmwm + behaviours.py: bafybeifydfnmic6vkeu52cwuw2qtr3lwomvo3m6f42yh6fqne3srxhhtoi bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q @@ -24,12 +24,12 @@ fingerprint: handlers.py: bafybeihot2i2yvfkz2gcowvt66wdu6tkjbmv7hsmc4jzt4reqeaiuphbtu models.py: bafybeibjttnga54y4auz6f33ecfrngyw53b2xzpompm72drjsr4xoytmiy payloads.py: bafybeigaoni6raoz4ebdghe5jhvmjkuldkocwg2qbxj2cr62454ed2voae - rounds.py: bafybeigzbssdfjwtia7xa2okip4yx33ilyqnhdrilittrm3ezb7jac2q5a + rounds.py: bafybeic655jrb3oc3sr4fufc2n6psxhvbw4pw24qpbblzhbmbinwl242aq tests/__init__.py: bafybeigaewntxawezvygss345kytjijo56bfwddjtfm6egzxfajsgojam4 tests/test_dialogues.py: bafybeiet646su5nsjmvruahuwg6un4uvwzyj2lnn2jvkye6cxooz22f3ja tests/test_handlers.py: bafybeiaz3idwevvlplcyieaqo5oeikuthlte6e2gi4ajw452ylvimwgiki tests/test_payloads.py: bafybeia3qstr7ieu2nenznqtmuvipmnequkcp5vwefl7buinckwttx674m - tests/test_rounds.py: bafybeihowwdqree7mtbxmfrl5hjido4d5qqgbwidsciir5kjbbz5gldroe + tests/test_rounds.py: bafybeiejxlbcmzb654bmjkbe2bamm25qo6imvnf2jt4fi4fq26j2s4q4ju fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/market_manager_abci/tests/test_rounds.py b/packages/valory/skills/market_manager_abci/tests/test_rounds.py index f71039001..5927b4503 100644 --- a/packages/valory/skills/market_manager_abci/tests/test_rounds.py +++ b/packages/valory/skills/market_manager_abci/tests/test_rounds.py @@ -138,15 +138,17 @@ def run_test(self, test_case: RoundTestCase) -> None: synchronized_data=self.synchronized_data, context=mock.MagicMock() ) - self._test_round( - test_round=test_round, - round_payloads=test_case.payloads, - synchronized_data_update_fn=lambda sync_data, _: sync_data.update( - **test_case.final_data - ), - synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, - most_voted_payload=test_case.most_voted_payload, - exit_event=test_case.event, + self._complete_run( + self._test_round( + test_round=test_round, + round_payloads=test_case.payloads, + synchronized_data_update_fn=lambda sync_data, _: sync_data.update( + **test_case.final_data + ), + synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, + most_voted_payload=test_case.most_voted_payload, + exit_event=test_case.event, + ) ) diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 96396719c..879e39bc4 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeih2qtjac3clerbksdolhwmild2qraq52wyqy4e4sfrjr5cwsq7jce -- valory/decision_maker_abci:0.1.0:bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaiiyipkq57rcrsxlvaoytsher37rw3dplda6mpcw67wx5276wbgm +- valory/market_manager_abci:0.1.0:bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme +- valory/decision_maker_abci:0.1.0:bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif5vmgdasgt6rxe6caq3nxghpvd6tmk6bvus4lunddvuso6m7q53y - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 3f3a60632..cb24e7a9c 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeihyah4wq5bcnoe6zwdj7vvfka5lzvccoly533uhisd6hdtiqmckuy +- valory/decision_maker_abci:0.1.0:bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From b565ad6355c11eec572e5b7f7a5c386ece292cdd Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 23 Dec 2024 13:28:20 +0000 Subject: [PATCH 25/32] fix: yield balance check --- packages/packages.json | 16 +++--- packages/valory/agents/trader/aea-config.yaml | 10 ++-- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../check_stop_trading_abci/behaviours.py | 23 +++++++-- .../check_stop_trading_abci/payloads.py | 2 +- .../skills/check_stop_trading_abci/rounds.py | 19 +++---- .../skills/check_stop_trading_abci/skill.yaml | 10 ++-- .../tests/test_payloads.py | 6 ++- .../tests/test_rounds.py | 2 +- .../skills/decision_maker_abci/handlers.py | 49 +++---------------- .../skills/decision_maker_abci/rounds.py | 1 + .../skills/decision_maker_abci/skill.yaml | 8 +-- .../skills/decision_maker_abci/states/base.py | 16 ++---- .../skills/market_manager_abci/behaviours.py | 5 +- packages/valory/skills/trader_abci/skill.yaml | 8 +-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 17 files changed, 77 insertions(+), 104 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 333d95bc5..70d1b6656 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme", - "skill/valory/decision_maker_abci/0.1.0": "bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai", - "skill/valory/trader_abci/0.1.0": "bafybeicx7i6733c3qlxubrqfykrbkh7f557ewe6yj7ze2mk3vvlof7mftu", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeif5vmgdasgt6rxe6caq3nxghpvd6tmk6bvus4lunddvuso6m7q53y", + "skill/valory/market_manager_abci/0.1.0": "bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm", + "skill/valory/decision_maker_abci/0.1.0": "bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4", + "skill/valory/trader_abci/0.1.0": "bafybeiaatsecdoppjbvmgwwrsnh6qzjlwowaszbn4dukkunfkorplqanay", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeihsty6wyvell7533fmwkdd2qi5ldy7zvtk7oozn3fyugizogfcmxe", "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla", - "agent/valory/trader/0.1.0": "bafybeicpbxsxvp4b4355wvo5x6hiocimzohkd5jk2thl6gneyxlwrf24o4", - "service/valory/trader/0.1.0": "bafybeidfppwgwvkiejudx5kwgxzfgov7lnrw7qgbtm5k6owwg7thzyz6ca", - "service/valory/trader_pearl/0.1.0": "bafybeiaghlwavqqcptardvphgeull6htv4hrpygjug564iao5autmsrupu" + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq", + "agent/valory/trader/0.1.0": "bafybeicbs53gzz6mlevwwpizyfqeefxl42f4ywp42pveg5etktscpcy2nu", + "service/valory/trader/0.1.0": "bafybeibxx7gpdnf4zjyl7denfgg5mqx4yfmv5qnydslhu5cmnp4aoez3uu", + "service/valory/trader_pearl/0.1.0": "bafybeic3qqbajngpk7557gavwjrmcdcrq6z3vnexcgoqbmsntrgfm4ogz4" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 7488bca05..dc3f51149 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,12 +46,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif5vmgdasgt6rxe6caq3nxghpvd6tmk6bvus4lunddvuso6m7q53y -- valory/market_manager_abci:0.1.0:bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme -- valory/decision_maker_abci:0.1.0:bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai -- valory/trader_abci:0.1.0:bafybeicx7i6733c3qlxubrqfykrbkh7f557ewe6yj7ze2mk3vvlof7mftu +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihsty6wyvell7533fmwkdd2qi5ldy7zvtk7oozn3fyugizogfcmxe +- valory/market_manager_abci:0.1.0:bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm +- valory/decision_maker_abci:0.1.0:bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4 +- valory/trader_abci:0.1.0:bafybeiaatsecdoppjbvmgwwrsnh6qzjlwowaszbn4dukkunfkorplqanay - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 -- valory/check_stop_trading_abci:0.1.0:bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla +- valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index ac09934a3..07df62407 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:bafybeicpbxsxvp4b4355wvo5x6hiocimzohkd5jk2thl6gneyxlwrf24o4 +agent: valory/trader:0.1.0:bafybeicbs53gzz6mlevwwpizyfqeefxl42f4ywp42pveg5etktscpcy2nu number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 994b0f726..cde4593d2 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeicpbxsxvp4b4355wvo5x6hiocimzohkd5jk2thl6gneyxlwrf24o4 +agent: valory/trader:0.1.0:bafybeicbs53gzz6mlevwwpizyfqeefxl42f4ywp42pveg5etktscpcy2nu number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/behaviours.py b/packages/valory/skills/check_stop_trading_abci/behaviours.py index 42b503c66..d620766b4 100644 --- a/packages/valory/skills/check_stop_trading_abci/behaviours.py +++ b/packages/valory/skills/check_stop_trading_abci/behaviours.py @@ -57,6 +57,7 @@ class CheckStopTradingBehaviour(StakingInteractBaseBehaviour): def __init__(self, **kwargs: Any) -> None: """Initialize the behaviour.""" super().__init__(**kwargs) + self._mech_requests_since_last_cp: int = 0 self._mech_request_count: int = 0 @property @@ -69,6 +70,16 @@ def mech_request_count(self, mech_request_count: int) -> None: """Set the liveness period.""" self._mech_request_count = mech_request_count + @property + def mech_requests_since_last_cp(self) -> int: + """Get the mech requests since last checkpoint.""" + return self._mech_requests_since_last_cp + + @mech_requests_since_last_cp.setter + def mech_requests_since_last_cp(self, mech_requests_since_last_cp: int) -> None: + """Set the mech requests since last checkpoint.""" + self._mech_requests_since_last_cp = mech_requests_since_last_cp + def _get_mech_request_count(self) -> WaitableConditionType: """Get the mech request count.""" status = yield from self.contract_interact( @@ -89,6 +100,7 @@ def is_first_period(self) -> bool: @property def params(self) -> CheckStopTradingParams: """Return the params.""" + return cast(CheckStopTradingParams, self.context.params) def is_staking_kpi_met(self) -> Generator[None, None, bool]: @@ -96,6 +108,7 @@ def is_staking_kpi_met(self) -> Generator[None, None, bool]: yield from self.wait_for_condition_with_sleep(self._check_service_staked) self.context.logger.debug(f"{self.service_staking_state=}") if self.service_staking_state != StakingState.STAKED: + self.mech_requests_since_last_cp = 0 return False yield from self.wait_for_condition_with_sleep(self._get_mech_request_count) @@ -118,10 +131,10 @@ def is_staking_kpi_met(self) -> Generator[None, None, bool]: liveness_ratio = self.liveness_ratio self.context.logger.debug(f"{liveness_ratio=}") - mech_requests_since_last_cp = ( + self.mech_requests_since_last_cp = ( mech_request_count - mech_request_count_on_last_checkpoint ) - self.context.logger.debug(f"{mech_requests_since_last_cp=}") + self.context.logger.debug(f"{self.mech_requests_since_last_cp=}") current_timestamp = self.synced_timestamp self.context.logger.debug(f"{current_timestamp=}") @@ -136,7 +149,7 @@ def is_staking_kpi_met(self) -> Generator[None, None, bool]: ) self.context.logger.debug(f"{required_mech_requests=}") - if mech_requests_since_last_cp >= required_mech_requests: + if self.mech_requests_since_last_cp >= required_mech_requests: return True return False @@ -170,7 +183,9 @@ def async_act(self) -> Generator: stop_trading = yield from self._compute_stop_trading() self.context.logger.info(f"Computed {stop_trading=}") payload = CheckStopTradingPayload( - self.context.agent_address, stop_trading, self.mech_request_count + self.context.agent_address, + stop_trading, + self.mech_requests_since_last_cp, ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): diff --git a/packages/valory/skills/check_stop_trading_abci/payloads.py b/packages/valory/skills/check_stop_trading_abci/payloads.py index 9d3059a62..4f87a9873 100644 --- a/packages/valory/skills/check_stop_trading_abci/payloads.py +++ b/packages/valory/skills/check_stop_trading_abci/payloads.py @@ -30,4 +30,4 @@ class CheckStopTradingPayload(BaseTxPayload): """A transaction payload for the check stop trading abci.""" vote: bool - mech_request_count: Optional[int] + n_mech_requests_this_epoch: Optional[int] diff --git a/packages/valory/skills/check_stop_trading_abci/rounds.py b/packages/valory/skills/check_stop_trading_abci/rounds.py index 68d59107d..b36bb9fc7 100644 --- a/packages/valory/skills/check_stop_trading_abci/rounds.py +++ b/packages/valory/skills/check_stop_trading_abci/rounds.py @@ -66,14 +66,6 @@ def is_staking_kpi_met(self) -> bool: """Get the status of the staking kpi.""" return bool(self.db.get("is_staking_kpi_met", False)) - @property - def n_mech_requests(self) -> int: - """Get the number of mech requests.""" - n_mech_requests = self.db.get("n_mech_requests", 0) - if n_mech_requests is None: - return 0 - return n_mech_requests - class CheckStopTradingRound(VotingRound): """A round for checking stop trading conditions.""" @@ -87,13 +79,13 @@ class CheckStopTradingRound(VotingRound): collection_key = get_name(SynchronizedData.participant_to_votes) @property - def mech_request_count(self) -> int: + def n_mech_requests_this_epoch(self) -> int: """Get the mech request count from the payload.""" payload = self.payloads[0] - if not hasattr(payload, "mech_request_count"): + if not hasattr(payload, "n_mech_requests_this_epoch"): return 0 - return payload.mech_request_count + return payload.n_mech_requests_this_epoch def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: """Process the end of the block.""" @@ -103,10 +95,11 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: return None is_staking_kpi_met = self.positive_vote_threshold_reached - n_mech_requests = self.mech_request_count + n_mech_requests_this_epoch = self.n_mech_requests_this_epoch self.synchronized_data.update( - is_staking_kpi_met=is_staking_kpi_met, n_mech_requests=n_mech_requests + is_staking_kpi_met=is_staking_kpi_met, + n_mech_requests_this_epoch=n_mech_requests_this_epoch, ) return res diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 2e9ee38d2..348b81a2c 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -8,18 +8,18 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeif2pq7fg5upl6vmfgfzpiwsh4nbk4zaeyz6upyucqi5tasrxgq4ee __init__.py: bafybeifc23rlw2hzhplp3wfceixnmwq5ztnixhh7jp4dd5av3crwp3x22a - behaviours.py: bafybeibbjo73ntwkwnc2ozbx27b2min6hgwrayrql5ozn6ttjb4z6jxp3m + behaviours.py: bafybeif3edw4ddrhzivercrij3rz3wu5vhg6e35737hzg5cijv6y6gnwmi dialogues.py: bafybeictrrnwcijiejczy23dfvbx5kujgef3dulzqhs3etl2juvz5spm2e fsm_specification.yaml: bafybeihhau35a5xclncjpxh5lg7qiw34xs4d5qlez7dnjpkf45d3gc57ai handlers.py: bafybeiard64fwxib3rtyp67ymhf222uongcyqhfhdyttpsyqkmyh5ajipu models.py: bafybeigwdhgianx5rizlb7ebmm6pdtkixh4uehbvu5c24ysvyvojs74dfq - payloads.py: bafybeigyuhfflh45oovhlwij3zgay4xjrrj2mt2pbhtxtughlimzn2jvgq - rounds.py: bafybeigjx533enl364yfbylno5psehrlj6l74v2sukg2pioawbcz7ermzm + payloads.py: bafybeifcwsf3pkkm5wk5nbhotubdoaz2ppcx2uxn7gtzqgz63ldjk6gbwm + rounds.py: bafybeib3e4qggah6cmf4oaqcjx3z7jlzgyaklwqtvwt7xebp7ss7kd3pzi tests/__init__.py: bafybeihv2cjk4va5bc5ncqtppqg2xmmxcro34bma36trtvk32gtmhdycxu tests/test_dialogues.py: bafybeia5ac27w7ijx2nyx5dqyrnv4troo4572gjq7nrcxdncexoxucnqti tests/test_handlers.py: bafybeigpmtx2hyunzn6nxk2x4bvvybek7jvuhbk34fqlj7fgfsszcoqhxy - tests/test_payloads.py: bafybeic3sbhm7maqyrxkr7pshtzi3tt2prnyb5nvaywj36ttkd5nw7sate - tests/test_rounds.py: bafybeigxv27wqlpf4si2xcpe7bgn6k6ubr5nt37w7sskiapbuht5miz3wq + tests/test_payloads.py: bafybeid5x5zu7bv2hp7z2hh4d43udglqdw6bjfs34sap46qoe4azmyxnry + tests/test_rounds.py: bafybeihglyjeg6pgxzro2eqk27e736l2qwiqe24ema2u2bexxyuopaez4e fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py b/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py index a6c6bf0bc..1f14d036d 100644 --- a/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py +++ b/packages/valory/skills/check_stop_trading_abci/tests/test_payloads.py @@ -26,9 +26,11 @@ def test_check_stop_trading_payload() -> None: """Test `CheckStopTradingPayload`.""" - payload = CheckStopTradingPayload(sender="sender", vote=True, mech_request_count=1) + payload = CheckStopTradingPayload( + sender="sender", vote=True, n_mech_requests_this_epoch=1 + ) assert payload.vote - assert payload.mech_request_count + assert payload.n_mech_requests_this_epoch assert payload.data == {"vote": True, "mech_request_count": 1} assert CheckStopTradingPayload.from_json(payload.json) == payload diff --git a/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py b/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py index 8abeaa9af..a849aa810 100644 --- a/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py +++ b/packages/valory/skills/check_stop_trading_abci/tests/test_rounds.py @@ -85,7 +85,7 @@ def get_participant_to_votes( return { participant: CheckStopTradingPayload( - sender=participant, vote=vote, mech_request_count=1 + sender=participant, vote=vote, n_mech_requests_this_epoch=1 ) for participant in participants } diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index 43303a389..17ae8d322 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -130,12 +130,12 @@ def __init__(self, **kwargs: Any) -> None: self._time_since_last_successful_mech_tx: int = 0 @property - def time_since_last_successful_mech_tx(self) -> int: + def last_successful_mech_tx_ts(self) -> int: """Get the time since the last successful mech response in seconds.""" return self._time_since_last_successful_mech_tx - @time_since_last_successful_mech_tx.setter - def time_since_last_successful_mech_tx( + @last_successful_mech_tx_ts.setter + def last_successful_mech_tx_ts( self, time_since_last_successful_mech_tx: int ) -> None: """Set the time since the last successful mech response in seconds.""" @@ -436,9 +436,7 @@ def set_metrics(self) -> None: time_since_last_mech_tx_attempt = ( self.calculate_time_since_last_mech_tx_attempt() ) - n_total_mech_requests = self.synchronized_data.n_mech_requests - n_successful_mech_requests = len(self.synchronized_data.mech_responses) - n_failed_mech_requests = n_total_mech_requests - n_successful_mech_requests + n_total_mech_requests = self.synchronized_data.n_mech_requests_this_epoch NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( native_balance @@ -458,36 +456,19 @@ def set_metrics(self) -> None: TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE.labels( agent_address, safe_address, service_id ).set(time_since_last_mech_tx_attempt) - TOTAL_MECH_TXS.labels(agent_address, safe_address, service_id).set( + TOTAL_MECH_REQUESTS.labels(agent_address, safe_address, service_id).set( n_total_mech_requests ) - TOTAL_SUCCESSFUL_MECH_TXS.labels(agent_address, safe_address, service_id).set( - n_successful_mech_requests - ) - TOTAL_FAILED_MECH_TXS.labels(agent_address, safe_address, service_id).set( - n_failed_mech_requests - ) def calculate_time_since_last_successful_mech_tx(self) -> int: """Calculate the time since the last successful mech transaction (mech response).""" - previous_time_since_last_successful_mech_tx = ( - self.time_since_last_successful_mech_tx - ) mech_tx_ts = self.synchronized_data.decision_receive_timestamp now = int(datetime.now().timestamp()) seconds_since_last_successful_mech_tx = 0 if mech_tx_ts != 0: seconds_since_last_successful_mech_tx = now - mech_tx_ts - self.time_since_last_successful_mech_tx = ( - seconds_since_last_successful_mech_tx - ) - - elif previous_time_since_last_successful_mech_tx != 0: - seconds_since_last_successful_mech_tx = ( - now - previous_time_since_last_successful_mech_tx - ) return seconds_since_last_successful_mech_tx @@ -555,23 +536,9 @@ def calculate_time_since_last_mech_tx_attempt(self) -> int: registry=REGISTRY, ) -TOTAL_MECH_TXS = Gauge( - "olas_agent_txs", - "Total number of transactions", - ["agent_address", "safe_address", "service_id"], - registry=REGISTRY, -) - -TOTAL_SUCCESSFUL_MECH_TXS = Gauge( - "olas_successful_agent_txs", - "Total successful number of transactions", - ["agent_address", "safe_address", "service_id"], - registry=REGISTRY, -) - -TOTAL_FAILED_MECH_TXS = Gauge( - "olas_failed_agent_txs", - "Total failed number of transaction", +TOTAL_MECH_REQUESTS = Gauge( + "olas_agent_mech_requests", + "Total number of mech requests made by the agent this epoch", ["agent_address", "safe_address", "service_id"], registry=REGISTRY, ) diff --git a/packages/valory/skills/decision_maker_abci/rounds.py b/packages/valory/skills/decision_maker_abci/rounds.py index 46aacc9a7..3a7c83ad6 100644 --- a/packages/valory/skills/decision_maker_abci/rounds.py +++ b/packages/valory/skills/decision_maker_abci/rounds.py @@ -328,6 +328,7 @@ class DecisionMakerAbciApp(AbciApp[Event]): get_name(SynchronizedData.mocking_mode), get_name(SynchronizedData.next_mock_data_row), get_name(SynchronizedData.agreement_id), + get_name(SynchronizedData.decision_receive_timestamp), } ) final_states: Set[AppState] = { diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index c5271b6de..3b60f1d40 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -29,16 +29,16 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeie35jlzzy3kf3kayw5wokywkv35c2vv5q2ikxniuxlnsmvs6uwubu + handlers.py: bafybeifwy4x7diuwo73xlseberyq4dyrbyhvajbgvmyfstj3vbyvnrfm3u io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm payloads.py: bafybeicgpilyalsnnlygecbooxjpxywcwscyf7saj42m6qr5cuvl4elkji policy.py: bafybeihlzs4o5e7yfmfzcvvrzkf4bhxfsg5gxnzsrpepwgfugh45gafye4 redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm - rounds.py: bafybeiazjcsukgefair52aw37hhvxzlopnzqqmi4ntqrinakljlcm4kt4a + rounds.py: bafybeif3lbithuwljc7hwnoukk5guemym4dh24po52xkg2act73jbd43sa states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeifjbh4hy5pv74gworu4qke6lp7b5x3hofnitlbuutrz7ev7wth4ra + states/base.py: bafybeiamq2rv5f7lfdbz22fq6pirz5l2tk7a6tdwq2ojghxkgtjebp3sgu states/bet_placement.py: bafybeid6ffwooqeb2uj3f5t2iy7ffoeltoyc76jqzn6x4yjezgvofnsasm states/blacklisting.py: bafybeidqi356wrxmvj2hqs22hw3kaszh4fg4rs3fo5axk2biosxt6kfbiy states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme +- valory/market_manager_abci:0.1.0:bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index c3e52a74d..0356c2ed6 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -278,20 +278,12 @@ def service_staking_state(self) -> StakingState: return StakingState(self.db.get("service_staking_state", 0)) @property - def n_mech_requests(self) -> int: + def n_mech_requests_this_epoch(self) -> int: """Get the number of mech requests.""" - n_mech_requests = self.db.get("n_mech_requests", 0) - if n_mech_requests is None: + n_mech_requests_this_epoch = self.db.get("n_mech_requests_this_epoch", 0) + if n_mech_requests_this_epoch is None: return 0 - return n_mech_requests - - @property - def token_balance(self) -> int: - """Get the token balance.""" - token_balance = self.db.get("token_balance", 0) - if token_balance is None: - return 0 - return int(token_balance) + return n_mech_requests_this_epoch class TxPreparationRound(CollectSameUntilThresholdRound): diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 10c262dfd..1dc0753b4 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -172,6 +172,9 @@ def get_balance(self) -> WaitableConditionType: self.token_balance = int(token) self.wallet_balance = int(wallet) + + self.context.logger.info("Balances updated.") + return True def get_olas_balance(self) -> WaitableConditionType: @@ -295,7 +298,7 @@ def async_act(self) -> Generator: self.store_bets() # set the balances - self.get_balance() + yield from self.get_balance() wallet_balance = self.wallet_balance token_balance = self.token_balance diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 879e39bc4..27d7033f3 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,11 +26,11 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeicyfwbse4smcqutejtxkucxmgz3zwd2xbu5ssey2idz6qrgdeyxme -- valory/decision_maker_abci:0.1.0:bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif5vmgdasgt6rxe6caq3nxghpvd6tmk6bvus4lunddvuso6m7q53y +- valory/market_manager_abci:0.1.0:bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm +- valory/decision_maker_abci:0.1.0:bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihsty6wyvell7533fmwkdd2qi5ldy7zvtk7oozn3fyugizogfcmxe - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 -- valory/check_stop_trading_abci:0.1.0:bafybeigx27kht65vungmp4ldck7vgjsg4zr62fyvspzoxjsg66g6pkglla +- valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index cb24e7a9c..4e8ace99c 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeigte5gwpotorfip225z335ilhgkztgbmpac7yhdovwgk3ihyg2lai +- valory/decision_maker_abci:0.1.0:bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4 - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From d6f1cbce1d073dc2b9f9851a339f29c47ff7732a Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 23 Dec 2024 13:28:36 +0000 Subject: [PATCH 26/32] chore: generators --- packages/valory/skills/market_manager_abci/skill.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 392e9d84a..ceb8a0448 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeifydfnmic6vkeu52cwuw2qtr3lwomvo3m6f42yh6fqne3srxhhtoi + behaviours.py: bafybeiarvnoautczggn3pzn2l6qiw23yhy4raqbhvcjf52p234sc5yz3qm bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q From 0c54647f03886d75fca4522420ea72b58d6c3dcc Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 23 Dec 2024 15:39:14 +0000 Subject: [PATCH 27/32] fix: olas balance contract call --- packages/packages.json | 14 ++++----- packages/valory/agents/trader/aea-config.yaml | 8 ++--- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/decision_maker_abci/handlers.py | 6 ++++ .../skills/decision_maker_abci/skill.yaml | 4 +-- .../skills/market_manager_abci/behaviours.py | 29 +++++++++++++++---- .../skills/market_manager_abci/payloads.py | 1 + .../skills/market_manager_abci/rounds.py | 9 ++++++ .../skills/market_manager_abci/skill.yaml | 9 +++--- .../market_manager_abci/tests/test_rounds.py | 4 +++ packages/valory/skills/trader_abci/skill.yaml | 6 ++-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 13 files changed, 66 insertions(+), 30 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 70d1b6656..18ebfce78 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm", - "skill/valory/decision_maker_abci/0.1.0": "bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4", - "skill/valory/trader_abci/0.1.0": "bafybeiaatsecdoppjbvmgwwrsnh6qzjlwowaszbn4dukkunfkorplqanay", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeihsty6wyvell7533fmwkdd2qi5ldy7zvtk7oozn3fyugizogfcmxe", + "skill/valory/market_manager_abci/0.1.0": "bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy", + "skill/valory/decision_maker_abci/0.1.0": "bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm", + "skill/valory/trader_abci/0.1.0": "bafybeibibvifwtvbrg4ohvubmxdmivohjxoqjwhbpck3myjjbu7j3yqo4a", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiargh6vczgjymjzdwiohnhieg2ye2a5bekawwvqc424pf53msxgia", "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq", - "agent/valory/trader/0.1.0": "bafybeicbs53gzz6mlevwwpizyfqeefxl42f4ywp42pveg5etktscpcy2nu", - "service/valory/trader/0.1.0": "bafybeibxx7gpdnf4zjyl7denfgg5mqx4yfmv5qnydslhu5cmnp4aoez3uu", - "service/valory/trader_pearl/0.1.0": "bafybeic3qqbajngpk7557gavwjrmcdcrq6z3vnexcgoqbmsntrgfm4ogz4" + "agent/valory/trader/0.1.0": "bafybeigdy35irzvrcvnwptw7q452rykqn27cgnznm6gywn5kfhedpickym", + "service/valory/trader/0.1.0": "bafybeih4kfuhfjjiaf2b7nv356ngdmrciirjlydc544kwgf3gitfveqb5y", + "service/valory/trader_pearl/0.1.0": "bafybeiejm4jnxliorodpha7gyfyrbrso2mpmgwudlrarwrvhkkwdotupu4" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index dc3f51149..0691a79ce 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihsty6wyvell7533fmwkdd2qi5ldy7zvtk7oozn3fyugizogfcmxe -- valory/market_manager_abci:0.1.0:bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm -- valory/decision_maker_abci:0.1.0:bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4 -- valory/trader_abci:0.1.0:bafybeiaatsecdoppjbvmgwwrsnh6qzjlwowaszbn4dukkunfkorplqanay +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiargh6vczgjymjzdwiohnhieg2ye2a5bekawwvqc424pf53msxgia +- valory/market_manager_abci:0.1.0:bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy +- valory/decision_maker_abci:0.1.0:bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm +- valory/trader_abci:0.1.0:bafybeibibvifwtvbrg4ohvubmxdmivohjxoqjwhbpck3myjjbu7j3yqo4a - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 07df62407..97a4c1c1b 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:bafybeicbs53gzz6mlevwwpizyfqeefxl42f4ywp42pveg5etktscpcy2nu +agent: valory/trader:0.1.0:bafybeigdy35irzvrcvnwptw7q452rykqn27cgnznm6gywn5kfhedpickym number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index cde4593d2..c6ebc06f7 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeicbs53gzz6mlevwwpizyfqeefxl42f4ywp42pveg5etktscpcy2nu +agent: valory/trader:0.1.0:bafybeigdy35irzvrcvnwptw7q452rykqn27cgnznm6gywn5kfhedpickym number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index 17ae8d322..5725376e4 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -425,6 +425,9 @@ def set_metrics(self) -> None: native_balance = DecisionMakerBaseBehaviour.wei_to_native( self.synchronized_data.wallet_balance ) + olas_balance = DecisionMakerBaseBehaviour.wei_to_native( + self.synchronized_data.olas_balance + ) wxdai_balance = self.synchronized_data.token_balance staking_contract_available_slots = ( self.synchronized_data.available_staking_slots @@ -441,6 +444,9 @@ def set_metrics(self) -> None: NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( native_balance ) + OLAS_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( + olas_balance + ) WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( wxdai_balance ) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 3b60f1d40..b28cceaa4 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -29,7 +29,7 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeifwy4x7diuwo73xlseberyq4dyrbyhvajbgvmyfstj3vbyvnrfm3u + handlers.py: bafybeih5fnmhayc7ng3d42454tmjzmndrhb4ipfwvgb7uf6cwjgaydlc7e io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm +- valory/market_manager_abci:0.1.0:bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 1dc0753b4..66013ff89 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -28,7 +28,6 @@ from aea.helpers.ipfs.base import IPFSHashOnly from packages.valory.contracts.erc20.contract import ERC20 -from packages.valory.contracts.staking_token.contract import StakingTokenContract from packages.valory.protocols.contract_api import ContractApiMessage from packages.valory.skills.abstract_round_abci.behaviour_utils import BaseBehaviour from packages.valory.skills.abstract_round_abci.behaviours import AbstractRoundBehaviour @@ -52,12 +51,12 @@ WaitableConditionType = Generator[None, None, bool] - BETS_FILENAME = "bets.json" MULTI_BETS_FILENAME = "multi_bets.json" READ_MODE = "r" WRITE_MODE = "w" WXDAI = "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" +OLAS_TOKEN_ADDRESS = "0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f" class BetsManagerBehaviour(BaseBehaviour, ABC): @@ -72,6 +71,7 @@ def __init__(self, **kwargs: Any) -> None: self.token_balance = 0 self.wallet_balance = 0 self.native_balance = 0 + self.olas_balance = 0 @property def synchronized_data(self) -> SynchronizedData: @@ -178,11 +178,12 @@ def get_balance(self) -> WaitableConditionType: return True def get_olas_balance(self) -> WaitableConditionType: - """Get the safe's olas balance.""" + """Get the safe's olas balance in wei.""" + response_msg = yield from self.get_contract_api_response( performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore - contract_address="0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f", - contract_id=str(StakingTokenContract.contract_id), + contract_address=OLAS_TOKEN_ADDRESS, + contract_id=str(ERC20.contract_id), contract_callable="check_balance", account=self.synchronized_data.safe_contract_address, ) @@ -191,6 +192,16 @@ def get_olas_balance(self) -> WaitableConditionType: f"Could not calculate the balance of the safe: {response_msg}" ) return False + + token = response_msg.raw_transaction.body.get("token", None) + wallet = response_msg.raw_transaction.body.get("wallet", None) + if token is None or wallet is None: + self.context.logger.error( + f"Something went wrong while trying to get the balance of the safe: {response_msg}" + ) + return False + + self.olas_balance = int(token) return True @@ -299,12 +310,18 @@ def async_act(self) -> Generator: # set the balances yield from self.get_balance() + yield from self.get_olas_balance() + olas_balance = self.olas_balance wallet_balance = self.wallet_balance token_balance = self.token_balance bets_hash = self.hash_stored_bets() if self.bets else None payload = UpdateBetsPayload( - self.context.agent_address, bets_hash, wallet_balance, token_balance + self.context.agent_address, + bets_hash, + wallet_balance, + token_balance, + olas_balance, ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): diff --git a/packages/valory/skills/market_manager_abci/payloads.py b/packages/valory/skills/market_manager_abci/payloads.py index 9a0824577..89a04d8ff 100644 --- a/packages/valory/skills/market_manager_abci/payloads.py +++ b/packages/valory/skills/market_manager_abci/payloads.py @@ -38,3 +38,4 @@ class UpdateBetsPayload(BaseUpdateBetsPayload): wallet_balance: Optional[int] token_balance: Optional[int] + olas_balance: Optional[int] diff --git a/packages/valory/skills/market_manager_abci/rounds.py b/packages/valory/skills/market_manager_abci/rounds.py index 4025c6a8e..0fef3ef8c 100644 --- a/packages/valory/skills/market_manager_abci/rounds.py +++ b/packages/valory/skills/market_manager_abci/rounds.py @@ -92,6 +92,14 @@ def token_balance(self) -> int: return 0 return int(token_balance) + @property + def olas_balance(self) -> int: + """Get the wallet balance.""" + olas_balance = self.db.get("olas_balance", 0) + if olas_balance is None: + return 0 + return int(olas_balance) + @property def sampled_bet_index(self) -> int: """Get the sampled bet.""" @@ -141,6 +149,7 @@ class UpdateBetsRound(BaseUpdateBetsRound): BaseUpdateBetsRound.selection_key, get_name(SynchronizedData.wallet_balance), get_name(SynchronizedData.token_balance), + get_name(SynchronizedData.olas_balance), ) collection_key = get_name(SynchronizedData.participant_to_bets_hash) synchronized_data_class = SynchronizedData diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index ceb8a0448..7bb9d193d 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeiarvnoautczggn3pzn2l6qiw23yhy4raqbhvcjf52p234sc5yz3qm + behaviours.py: bafybeif6c7mrjpoo2rqpgv7hqyamgeuitkjhoz24xbnfqnyvtzi4lwdtmy bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q @@ -23,18 +23,17 @@ fingerprint: graph_tooling/utils.py: bafybeig5hxhnqgyfn5ym3poc5nziqwpeozqbd6wa4s6c2hjn6iyedg3t3y handlers.py: bafybeihot2i2yvfkz2gcowvt66wdu6tkjbmv7hsmc4jzt4reqeaiuphbtu models.py: bafybeibjttnga54y4auz6f33ecfrngyw53b2xzpompm72drjsr4xoytmiy - payloads.py: bafybeigaoni6raoz4ebdghe5jhvmjkuldkocwg2qbxj2cr62454ed2voae - rounds.py: bafybeic655jrb3oc3sr4fufc2n6psxhvbw4pw24qpbblzhbmbinwl242aq + payloads.py: bafybeiedeo677yrjphfr5og37mt4emf6cwpmxwzdnfxyrr73shu33pyqd4 + rounds.py: bafybeihffhpi5ewa2mrnseocoj3fq7klyw5u3vomvwidvqxiudb2ellzw4 tests/__init__.py: bafybeigaewntxawezvygss345kytjijo56bfwddjtfm6egzxfajsgojam4 tests/test_dialogues.py: bafybeiet646su5nsjmvruahuwg6un4uvwzyj2lnn2jvkye6cxooz22f3ja tests/test_handlers.py: bafybeiaz3idwevvlplcyieaqo5oeikuthlte6e2gi4ajw452ylvimwgiki tests/test_payloads.py: bafybeia3qstr7ieu2nenznqtmuvipmnequkcp5vwefl7buinckwttx674m - tests/test_rounds.py: bafybeiejxlbcmzb654bmjkbe2bamm25qo6imvnf2jt4fi4fq26j2s4q4ju + tests/test_rounds.py: bafybeidzooq3km7al3ix4hhozpj7g6rmgruoatufndjyms5wuzztw4qkye fingerprint_ignore_patterns: [] connections: [] contracts: - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi -- valory/staking_token:0.1.0:bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae - valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i diff --git a/packages/valory/skills/market_manager_abci/tests/test_rounds.py b/packages/valory/skills/market_manager_abci/tests/test_rounds.py index 5927b4503..0c0cefafd 100644 --- a/packages/valory/skills/market_manager_abci/tests/test_rounds.py +++ b/packages/valory/skills/market_manager_abci/tests/test_rounds.py @@ -89,6 +89,7 @@ def get_payloads( bets_hash: Optional[str], wallet_balance: Optional[int], token_balance: Optional[int], + olas_balance: Optional[int], ) -> Mapping[str, BaseTxPayload]: """Get payloads.""" return { @@ -97,6 +98,7 @@ def get_payloads( bets_hash=bets_hash, wallet_balance=wallet_balance, token_balance=token_balance, + olas_balance=olas_balance, ) for participant in get_participants() } @@ -170,6 +172,7 @@ class TestUpdateBetsRound(BaseMarketManagerRoundTestClass): bets_hash=DUMMY_BETS_HASH, wallet_balance=1, token_balance=1, + olas_balance=1, ), final_data={ "bets_hash": DUMMY_BETS_HASH, @@ -188,6 +191,7 @@ class TestUpdateBetsRound(BaseMarketManagerRoundTestClass): bets_hash=None, wallet_balance=None, token_balance=None, + olas_balance=None, ), final_data={}, event=Event.FETCH_ERROR, diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 27d7033f3..7e1091699 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeidfyf6irz72yll5tx3yhddw76ffdrsdgtf5qcmrjymqmvqdvhl7hm -- valory/decision_maker_abci:0.1.0:bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4 -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihsty6wyvell7533fmwkdd2qi5ldy7zvtk7oozn3fyugizogfcmxe +- valory/market_manager_abci:0.1.0:bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy +- valory/decision_maker_abci:0.1.0:bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiargh6vczgjymjzdwiohnhieg2ye2a5bekawwvqc424pf53msxgia - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 4e8ace99c..b3c33b282 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeieibronqy6oki6hbmyijcaifbutgn6g4avx4gws3mtpsoanrtvss4 +- valory/decision_maker_abci:0.1.0:bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 061e1536b2baaf36d1074b512b067dcf3a427c47 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 23 Dec 2024 16:09:47 +0000 Subject: [PATCH 28/32] add: service owner address --- packages/packages.json | 14 ++--- packages/valory/agents/trader/aea-config.yaml | 8 +-- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/decision_maker_abci/handlers.py | 53 ++++++++++--------- .../skills/decision_maker_abci/skill.yaml | 4 +- .../skills/market_manager_abci/behaviours.py | 29 +++++++++- .../skills/market_manager_abci/payloads.py | 1 + .../skills/market_manager_abci/rounds.py | 11 +++- .../skills/market_manager_abci/skill.yaml | 9 ++-- .../market_manager_abci/tests/test_rounds.py | 4 ++ packages/valory/skills/trader_abci/skill.yaml | 6 +-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 13 files changed, 94 insertions(+), 51 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 18ebfce78..44068e119 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy", - "skill/valory/decision_maker_abci/0.1.0": "bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm", - "skill/valory/trader_abci/0.1.0": "bafybeibibvifwtvbrg4ohvubmxdmivohjxoqjwhbpck3myjjbu7j3yqo4a", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiargh6vczgjymjzdwiohnhieg2ye2a5bekawwvqc424pf53msxgia", + "skill/valory/market_manager_abci/0.1.0": "bafybeidn2ghgtdnqi435bjiksyvisxexcjesimzwwdyqmnrlx446zr6wxm", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiawzathsc65xznjklsgyuabakz3t5rujkfpy7qd37qsvtrxfrdn7a", + "skill/valory/trader_abci/0.1.0": "bafybeibzws5erdkm5tmgjtpxt6n4gimdbdslph5zfvjcqgcffgba4njrue", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicgcoazt4w7m5rfjbdvrybnprlpv5yia5tecfqqiaev7po2hvjopa", "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq", - "agent/valory/trader/0.1.0": "bafybeigdy35irzvrcvnwptw7q452rykqn27cgnznm6gywn5kfhedpickym", - "service/valory/trader/0.1.0": "bafybeih4kfuhfjjiaf2b7nv356ngdmrciirjlydc544kwgf3gitfveqb5y", - "service/valory/trader_pearl/0.1.0": "bafybeiejm4jnxliorodpha7gyfyrbrso2mpmgwudlrarwrvhkkwdotupu4" + "agent/valory/trader/0.1.0": "bafybeihxbfp7tmtv4swo7woo7irujlvtpawoqfsit2y7w3yr4kcbcus2si", + "service/valory/trader/0.1.0": "bafybeignxehcvrskmpmmnw5hukyv67uwu4ef66lr2izuhfqyrdtrditiaa", + "service/valory/trader_pearl/0.1.0": "bafybeiemqpfidticjoh5sivlk6znn443op4eecjqr7rjll5r2ck3nw4esy" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 0691a79ce..40d7a7ca7 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiargh6vczgjymjzdwiohnhieg2ye2a5bekawwvqc424pf53msxgia -- valory/market_manager_abci:0.1.0:bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy -- valory/decision_maker_abci:0.1.0:bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm -- valory/trader_abci:0.1.0:bafybeibibvifwtvbrg4ohvubmxdmivohjxoqjwhbpck3myjjbu7j3yqo4a +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgcoazt4w7m5rfjbdvrybnprlpv5yia5tecfqqiaev7po2hvjopa +- valory/market_manager_abci:0.1.0:bafybeidn2ghgtdnqi435bjiksyvisxexcjesimzwwdyqmnrlx446zr6wxm +- valory/decision_maker_abci:0.1.0:bafybeiawzathsc65xznjklsgyuabakz3t5rujkfpy7qd37qsvtrxfrdn7a +- valory/trader_abci:0.1.0:bafybeibzws5erdkm5tmgjtpxt6n4gimdbdslph5zfvjcqgcffgba4njrue - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 97a4c1c1b..9db87cc9b 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:bafybeigdy35irzvrcvnwptw7q452rykqn27cgnznm6gywn5kfhedpickym +agent: valory/trader:0.1.0:bafybeihxbfp7tmtv4swo7woo7irujlvtpawoqfsit2y7w3yr4kcbcus2si number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index c6ebc06f7..2309a4514 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeigdy35irzvrcvnwptw7q452rykqn27cgnznm6gywn5kfhedpickym +agent: valory/trader:0.1.0:bafybeihxbfp7tmtv4swo7woo7irujlvtpawoqfsit2y7w3yr4kcbcus2si number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/handlers.py b/packages/valory/skills/decision_maker_abci/handlers.py index 5725376e4..342d12f17 100644 --- a/packages/valory/skills/decision_maker_abci/handlers.py +++ b/packages/valory/skills/decision_maker_abci/handlers.py @@ -421,6 +421,7 @@ def set_metrics(self) -> None: agent_address = self.context.agent_address safe_address = self.synchronized_data.safe_contract_address service_id = self.context.params.on_chain_service_id + service_owner_address = self.synchronized_data.service_owner_address native_balance = DecisionMakerBaseBehaviour.wei_to_native( self.synchronized_data.wallet_balance @@ -441,30 +442,30 @@ def set_metrics(self) -> None: ) n_total_mech_requests = self.synchronized_data.n_mech_requests_this_epoch - NATIVE_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( - native_balance - ) - OLAS_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( - olas_balance - ) - WXDAI_BALANCE_GAUGE.labels(agent_address, safe_address, service_id).set( - wxdai_balance - ) + NATIVE_BALANCE_GAUGE.labels( + agent_address, safe_address, service_id, service_owner_address + ).set(native_balance) + OLAS_BALANCE_GAUGE.labels( + agent_address, safe_address, service_id, service_owner_address + ).set(olas_balance) + WXDAI_BALANCE_GAUGE.labels( + agent_address, safe_address, service_id, service_owner_address + ).set(wxdai_balance) STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE.labels( - agent_address, safe_address, service_id + agent_address, safe_address, service_id, service_owner_address ).set(staking_contract_available_slots) - STAKING_STATE_GAUGE.labels(agent_address, safe_address, service_id).set( - staking_state - ) + STAKING_STATE_GAUGE.labels( + agent_address, safe_address, service_id, service_owner_address + ).set(staking_state) TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE.labels( - agent_address, safe_address, service_id + agent_address, safe_address, service_id, service_owner_address ).set(time_since_last_successful_mech_tx) TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE.labels( - agent_address, safe_address, service_id + agent_address, safe_address, service_id, service_owner_address ).set(time_since_last_mech_tx_attempt) - TOTAL_MECH_REQUESTS.labels(agent_address, safe_address, service_id).set( - n_total_mech_requests - ) + TOTAL_MECH_REQUESTS.labels( + agent_address, safe_address, service_id, service_owner_address + ).set(n_total_mech_requests) def calculate_time_since_last_successful_mech_tx(self) -> int: """Calculate the time since the last successful mech transaction (mech response).""" @@ -496,55 +497,55 @@ def calculate_time_since_last_mech_tx_attempt(self) -> int: NATIVE_BALANCE_GAUGE = Gauge( "olas_agent_native_balance", "Native token balance in xDai", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) OLAS_BALANCE_GAUGE = Gauge( "olas_agent_olas_balance", "OLAS token balance", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) WXDAI_BALANCE_GAUGE = Gauge( "olas_agent_wxdai_balance", "WXDAI token balance", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) STAKING_CONTRACT_AVAILABLE_SLOTS_GAUGE = Gauge( "olas_staking_contract_available_slots", "Number of available slots in the staking contract", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) STAKING_STATE_GAUGE = Gauge( "olas_agent_staked", "Indicates if an agent is staked (1), not staked (0) or eviceted (2)", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) TIME_SINCE_LAST_SUCCESSFUL_MECH_TX_GAUGE = Gauge( "olas_agent_time_since_last_successful_tx", "Time in seconds since last successful mech transaction", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) TIME_SINCE_LAST_MECH_TX_ATTEMPT_GAUGE = Gauge( "olas_agent_time_since_last_mech_tx_attempt", "Time in seconds since last transaction attempt (successful or not)", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) TOTAL_MECH_REQUESTS = Gauge( "olas_agent_mech_requests", "Total number of mech requests made by the agent this epoch", - ["agent_address", "safe_address", "service_id"], + ["agent_address", "safe_address", "service_id", "service_owner_address"], registry=REGISTRY, ) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index b28cceaa4..37094d2e1 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -29,7 +29,7 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeigwlvvi6fav72wg4wz22xjekegenzjnub5efwz5xu6qsrjnxluspq - handlers.py: bafybeih5fnmhayc7ng3d42454tmjzmndrhb4ipfwvgb7uf6cwjgaydlc7e + handlers.py: bafybeiboy2cgdvcoe4mtonwwyssz5ef7qj72gs2c3o2vaz4akgwrtd5qra io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeidhdqgwcgn4rrncufpdmkbcye7xfqd6ytow7zx3hbcpsgpjmxgfmm @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy +- valory/market_manager_abci:0.1.0:bafybeidn2ghgtdnqi435bjiksyvisxexcjesimzwwdyqmnrlx446zr6wxm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index 66013ff89..a6c3c69da 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -28,6 +28,7 @@ from aea.helpers.ipfs.base import IPFSHashOnly from packages.valory.contracts.erc20.contract import ERC20 +from packages.valory.contracts.service_registry.contract import ServiceRegistryContract from packages.valory.protocols.contract_api import ContractApiMessage from packages.valory.skills.abstract_round_abci.behaviour_utils import BaseBehaviour from packages.valory.skills.abstract_round_abci.behaviours import AbstractRoundBehaviour @@ -70,8 +71,8 @@ def __init__(self, **kwargs: Any) -> None: self.bets_filepath: str = self.params.store_path / BETS_FILENAME self.token_balance = 0 self.wallet_balance = 0 - self.native_balance = 0 self.olas_balance = 0 + self.service_owner_address = "" @property def synchronized_data(self) -> SynchronizedData: @@ -204,6 +205,28 @@ def get_olas_balance(self) -> WaitableConditionType: self.olas_balance = int(token) return True + def _get_service_owner(self) -> WaitableConditionType: + """Method that returns the service owner.""" + response = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_STATE, # type: ignore + contract_id=str(ServiceRegistryContract.contract_id), + contract_callable="get_service_owner", + contract_address=self.params.service_registry_address, + service_id=self.params.on_chain_service_id, + chain_id=self.params.default_chain_id, + ) + + if response.performative != ContractApiMessage.Performative.STATE: + self.context.logger.error( + f"Couldn't get the service owner for service with id={self.params.on_chain_service_id}. " + f"Expected response performative {ContractApiMessage.Performative.STATE.value}, " # type: ignore + f"received {response.performative.value}." + ) + return False + + self.service_owner_address = response.state.body.get("service_owner", None) + return True + class UpdateBetsBehaviour(BetsManagerBehaviour, QueryingBehaviour): """Behaviour that fetches and updates the bets.""" @@ -315,6 +338,9 @@ def async_act(self) -> Generator: wallet_balance = self.wallet_balance token_balance = self.token_balance + yield from self._get_service_owner() + service_owner_address = self.service_owner_address + bets_hash = self.hash_stored_bets() if self.bets else None payload = UpdateBetsPayload( self.context.agent_address, @@ -322,6 +348,7 @@ def async_act(self) -> Generator: wallet_balance, token_balance, olas_balance, + service_owner_address, ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): diff --git a/packages/valory/skills/market_manager_abci/payloads.py b/packages/valory/skills/market_manager_abci/payloads.py index 89a04d8ff..d1e7759fd 100644 --- a/packages/valory/skills/market_manager_abci/payloads.py +++ b/packages/valory/skills/market_manager_abci/payloads.py @@ -39,3 +39,4 @@ class UpdateBetsPayload(BaseUpdateBetsPayload): wallet_balance: Optional[int] token_balance: Optional[int] olas_balance: Optional[int] + service_owner_address: Optional[str] diff --git a/packages/valory/skills/market_manager_abci/rounds.py b/packages/valory/skills/market_manager_abci/rounds.py index 0fef3ef8c..7c25350d9 100644 --- a/packages/valory/skills/market_manager_abci/rounds.py +++ b/packages/valory/skills/market_manager_abci/rounds.py @@ -21,7 +21,7 @@ from abc import ABC from enum import Enum -from typing import Any, Dict, Set, Tuple, Type, cast +from typing import Any, Dict, Optional, Set, Tuple, Type, cast from packages.valory.skills.abstract_round_abci.base import ( AbciApp, @@ -108,6 +108,14 @@ def sampled_bet_index(self) -> int: return 0 return int(sampled_bet_index) + @property + def service_owner_address(self) -> Optional[str]: + """Get the service owner address.""" + service_owner_address = self.db.get("service_owner_address", None) + if service_owner_address is None: + return None + return str(service_owner_address) + class MarketManagerAbstractRound(AbstractRound[Event], ABC): """Abstract round for the MarketManager skill.""" @@ -150,6 +158,7 @@ class UpdateBetsRound(BaseUpdateBetsRound): get_name(SynchronizedData.wallet_balance), get_name(SynchronizedData.token_balance), get_name(SynchronizedData.olas_balance), + get_name(SynchronizedData.service_owner_address), ) collection_key = get_name(SynchronizedData.participant_to_bets_hash) synchronized_data_class = SynchronizedData diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 7bb9d193d..9c3903d4d 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeif6c7mrjpoo2rqpgv7hqyamgeuitkjhoz24xbnfqnyvtzi4lwdtmy + behaviours.py: bafybeig7flymus7uwvqn33ltced74atiah2kx2pmbwwkyyqr4qpxkxl5nq bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q @@ -23,17 +23,18 @@ fingerprint: graph_tooling/utils.py: bafybeig5hxhnqgyfn5ym3poc5nziqwpeozqbd6wa4s6c2hjn6iyedg3t3y handlers.py: bafybeihot2i2yvfkz2gcowvt66wdu6tkjbmv7hsmc4jzt4reqeaiuphbtu models.py: bafybeibjttnga54y4auz6f33ecfrngyw53b2xzpompm72drjsr4xoytmiy - payloads.py: bafybeiedeo677yrjphfr5og37mt4emf6cwpmxwzdnfxyrr73shu33pyqd4 - rounds.py: bafybeihffhpi5ewa2mrnseocoj3fq7klyw5u3vomvwidvqxiudb2ellzw4 + payloads.py: bafybeib2a2e4fableelw246sr2vougv4vdiyyvdggffy6eohi4c4e3b4se + rounds.py: bafybeic3nwjaf6j7zwuso7d4sfmvlp4urkr4t2z2e75xbeu32wvsacjdem tests/__init__.py: bafybeigaewntxawezvygss345kytjijo56bfwddjtfm6egzxfajsgojam4 tests/test_dialogues.py: bafybeiet646su5nsjmvruahuwg6un4uvwzyj2lnn2jvkye6cxooz22f3ja tests/test_handlers.py: bafybeiaz3idwevvlplcyieaqo5oeikuthlte6e2gi4ajw452ylvimwgiki tests/test_payloads.py: bafybeia3qstr7ieu2nenznqtmuvipmnequkcp5vwefl7buinckwttx674m - tests/test_rounds.py: bafybeidzooq3km7al3ix4hhozpj7g6rmgruoatufndjyms5wuzztw4qkye + tests/test_rounds.py: bafybeiaxnoswwgkrd6pcvkbyvvmjnt6gawyzf32zurpyi2u45t5hzkkaia fingerprint_ignore_patterns: [] connections: [] contracts: - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi +- valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae - valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i diff --git a/packages/valory/skills/market_manager_abci/tests/test_rounds.py b/packages/valory/skills/market_manager_abci/tests/test_rounds.py index 0c0cefafd..19e26ef80 100644 --- a/packages/valory/skills/market_manager_abci/tests/test_rounds.py +++ b/packages/valory/skills/market_manager_abci/tests/test_rounds.py @@ -90,6 +90,7 @@ def get_payloads( wallet_balance: Optional[int], token_balance: Optional[int], olas_balance: Optional[int], + service_owner_address: Optional[str], ) -> Mapping[str, BaseTxPayload]: """Get payloads.""" return { @@ -99,6 +100,7 @@ def get_payloads( wallet_balance=wallet_balance, token_balance=token_balance, olas_balance=olas_balance, + service_owner_address=service_owner_address, ) for participant in get_participants() } @@ -173,6 +175,7 @@ class TestUpdateBetsRound(BaseMarketManagerRoundTestClass): wallet_balance=1, token_balance=1, olas_balance=1, + service_owner_address="dummy_service_owner_address", ), final_data={ "bets_hash": DUMMY_BETS_HASH, @@ -192,6 +195,7 @@ class TestUpdateBetsRound(BaseMarketManagerRoundTestClass): wallet_balance=None, token_balance=None, olas_balance=None, + service_owner_address=None, ), final_data={}, event=Event.FETCH_ERROR, diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 7e1091699..716918fbd 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeihyxd76w23luc2hkbje7x5r5unu7ae4mja3uiqlpc7awfxrlf2jfy -- valory/decision_maker_abci:0.1.0:bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiargh6vczgjymjzdwiohnhieg2ye2a5bekawwvqc424pf53msxgia +- valory/market_manager_abci:0.1.0:bafybeidn2ghgtdnqi435bjiksyvisxexcjesimzwwdyqmnrlx446zr6wxm +- valory/decision_maker_abci:0.1.0:bafybeiawzathsc65xznjklsgyuabakz3t5rujkfpy7qd37qsvtrxfrdn7a +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgcoazt4w7m5rfjbdvrybnprlpv5yia5tecfqqiaev7po2hvjopa - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index b3c33b282..803fa2fc6 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeig3ikrc2rmre3pyls5k5s3d2f4veic5giiyygdezq5lrrmlmo7flm +- valory/decision_maker_abci:0.1.0:bafybeiawzathsc65xznjklsgyuabakz3t5rujkfpy7qd37qsvtrxfrdn7a - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 84dbcf727b932587dcfdb3a1391e07d72f2b5688 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 23 Dec 2024 16:48:39 +0000 Subject: [PATCH 29/32] fix: servie owner address duplication --- packages/packages.json | 18 +++++------ packages/valory/agents/trader/aea-config.yaml | 12 +++---- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/decision_maker_abci/skill.yaml | 32 +++++++++---------- .../skills/market_manager_abci/behaviours.py | 2 +- .../skills/market_manager_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 10 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 4 +-- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index f11b90961..88878907b 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi", - "skill/valory/decision_maker_abci/0.1.0": "bafybeig5oivc24sqhgyxfhjbl2xsoa5yssv72lcu5ezunbcpwu3xo4jglm", - "skill/valory/trader_abci/0.1.0": "bafybeicmtcs4gaabwbyr4im2ux7co73y5n6ugj4abk6dayxzew7jly2zhe", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeifpf3sk5evrvwxyht7mswcml3qy4nhzo5ddvjvgklapwsjwq6mera", - "skill/valory/staking_abci/0.1.0": "bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeieduekpd4zbvjztyxyooppqnmjvup6jfp74uo6hhupvtvzzscdzkq", - "agent/valory/trader/0.1.0": "bafybeih3r5xefwfqfdmmwx3e5n3i4df7pv3mvhqlk7qen2i75anj27ds4u", - "service/valory/trader/0.1.0": "bafybeid2xxc5plszxy644kbhcqxjwmpc6ay6xqhewc2c6bb3dqv3llt63u", - "service/valory/trader_pearl/0.1.0": "bafybeiaihaivsiyotduxvnmecvdf23t42bwnphwmswxcpfdhi3k6w57gze" + "skill/valory/market_manager_abci/0.1.0": "bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole", + "skill/valory/decision_maker_abci/0.1.0": "bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui", + "skill/valory/trader_abci/0.1.0": "bafybeihpkbw26e3j673rd5std76y5idjmg5uyl6l6ngtpukyq6frm2m6hq", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaxjpv44g5estpr2pmccgfyv5iywq6htmmns7md4c33rilolyzqxq", + "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq", + "agent/valory/trader/0.1.0": "bafybeicls2tptdt77w46xsk7njext4mhmrs22rsvbzre2vwqglur26d2p4", + "service/valory/trader/0.1.0": "bafybeib5shk3mrsj72burbxsnrcbooafn23c2q4ygm2e5yugnsmrrhuk4i", + "service/valory/trader_pearl/0.1.0": "bafybeiga4sxrukuzxqcuh7vicbua3mmx424l7ggzl5jelbmj3eackslrqm" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index d8aacfdab..913d53218 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,12 +46,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifpf3sk5evrvwxyht7mswcml3qy4nhzo5ddvjvgklapwsjwq6mera -- valory/market_manager_abci:0.1.0:bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi -- valory/decision_maker_abci:0.1.0:bafybeig5oivc24sqhgyxfhjbl2xsoa5yssv72lcu5ezunbcpwu3xo4jglm -- valory/trader_abci:0.1.0:bafybeicmtcs4gaabwbyr4im2ux7co73y5n6ugj4abk6dayxzew7jly2zhe -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeieduekpd4zbvjztyxyooppqnmjvup6jfp74uo6hhupvtvzzscdzkq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaxjpv44g5estpr2pmccgfyv5iywq6htmmns7md4c33rilolyzqxq +- valory/market_manager_abci:0.1.0:bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole +- valory/decision_maker_abci:0.1.0:bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui +- valory/trader_abci:0.1.0:bafybeihpkbw26e3j673rd5std76y5idjmg5uyl6l6ngtpukyq6frm2m6hq +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 +- valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index e0b11b58d..9fad06797 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:bafybeih3r5xefwfqfdmmwx3e5n3i4df7pv3mvhqlk7qen2i75anj27ds4u +agent: valory/trader:0.1.0:bafybeicls2tptdt77w46xsk7njext4mhmrs22rsvbzre2vwqglur26d2p4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index fcc4ed446..931b577d7 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeih3r5xefwfqfdmmwx3e5n3i4df7pv3mvhqlk7qen2i75anj27ds4u +agent: valory/trader:0.1.0:bafybeicls2tptdt77w46xsk7njext4mhmrs22rsvbzre2vwqglur26d2p4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 8a0cd78b4..5dce4c157 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -12,13 +12,13 @@ fingerprint: README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky - behaviours/base.py: bafybeieqvxpzjnwjgq4ffhjojle2q7onif44nefrlza6pxriewisqcm324 - behaviours/bet_placement.py: bafybeia4listbfzsk4n4wkc4ycaftxgywjnl3mmpcqhuo3nwwia4n3oufu + behaviours/base.py: bafybeihym4ws7sprnqrqcpuaua5gwyyvwgfoxxw7ozker3r26mq755chz4 + behaviours/bet_placement.py: bafybeignqylvy5mownwsngtbmjsuanyu7ep26tmmdfiz5hhzuetfp2h2li behaviours/blacklisting.py: bafybeieuqoup2vrmrtvjfqnr5mzrvkegc7afb2oeujzq2itsbhcsham2se behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e behaviours/decision_receive.py: bafybeibsthk6fjydkengwzgpgz5v44xpta67nnlyxt6uugx2voitqgojpq - behaviours/decision_request.py: bafybeia22omb7tvocyfe3z2ucn5au5mcas7dg37ha42u7znefzrewjpk7y + behaviours/decision_request.py: bafybeigf7nihxq525oukz5wb2zoks3j7mzbi37w3vpp7dux47on6g3lybq behaviours/handle_failed_tx.py: bafybeiashwlfp6ty3g6ukgmliaghwu6yiunbqpjmyrzheokw3pbcr2ckaq behaviours/order_subscription.py: bafybeib3maqohhx35wzryy4otdcjp5thkr4sbp27ksvwidy3pwm444itra behaviours/randomness.py: bafybeiaoj3awyyg2onhpsdsn3dyczs23gr4smuzqcbw3e5ocljwxswjkce @@ -29,22 +29,22 @@ fingerprint: behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeidlnqnd7dwg7r2vhsgm2balrqhxm36qdflkmr7csze2kdeu3a7sbu - handlers.py: bafybeibf42562x3d5i66yf5p3vi6a2oolhwwxr32pjqtuxz5w4gmg3r4oa + handlers.py: bafybeiboy2cgdvcoe4mtonwwyssz5ef7qj72gs2c3o2vaz4akgwrtd5qra io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa models.py: bafybeibifjp45ii5amaghmdk5yjha7if5qpyreg2axpcxcj3ek23ys4fxm - payloads.py: bafybeieygushjlrzwzpnhagjgpbs3goot3pnfheh6yawuwctrk3uoeesfm + payloads.py: bafybeib6tbvhtjnlxd73spnv3ogdjtps3i36c7wgzfuscvhlv26gjqwnsa policy.py: bafybeidya6626uuvztdf3vhmrazjg2yxafa2iqrxmeh5gddzjjcbano5bi redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm - rounds.py: bafybeidjve7efycfkkbignqky4x6awvrobn4w32grxiubxxiiparr7xd2i + rounds.py: bafybeicltzxlavwper6sh3xko6xp6onkxpawlyxbphcfefsw3gdptr7wvm states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeiglqvym3ri6hurx4k7hrnykzbmslxe3vuj23djt6hai4czii4vbqq - states/bet_placement.py: bafybeih5eopyxubczys5u5t3bdxbxpc7mmfdyqrpqsbm2uha5jc2phza4i - states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi + states/base.py: bafybeiba2tikdy7ffcnpozfwslm3v2ous3ytoi4pt34o4qs7mkl5mfahy4 + states/bet_placement.py: bafybeid6ffwooqeb2uj3f5t2iy7ffoeltoyc76jqzn6x4yjezgvofnsasm + states/blacklisting.py: bafybeidqi356wrxmvj2hqs22hw3kaszh4fg4rs3fo5axk2biosxt6kfbiy states/check_benchmarking.py: bafybeifvto757zbfzy7mpehblyjd7zqboarxesjfiobtnbxew4nkltfkim states/claim_subscription.py: bafybeidlubctpk5djsredvvwdhubs34rztud3lw7pwp5kj6ggzah6dvyly - states/decision_receive.py: bafybeiexc26g7z7by6eziawjld52nglljiwlj6oam5ramtbyo6un2tqs5y - states/decision_request.py: bafybeiarv3r5j7cfvxmudki2llbdl2pvf24p5mvsva6bdgrylnwdyag5xy + states/decision_receive.py: bafybeibktcd4clpfyrb3lsoa7bvmpoloyqdhw5eh5fjnno5duaoid55pse + states/decision_request.py: bafybeig6l3l6ulv7alhwfxjlzz53i6g5gw3l5vumivadqstnmqoupwmaea states/final_states.py: bafybeicjrrojo3gmfaxzicwloyorlnqgzl6a2avevo4nvhoh424zwzmbti states/handle_failed_tx.py: bafybeiha5wkl4u4jlj7txpmhuzfnibnu3ix5zw4vmufjunoyuq6s6ubhnu states/order_subscription.py: bafybeihl3pwrbccaitiukbigygd5u3weyih34pvzql3c6n5k7gjj47f2be @@ -61,10 +61,10 @@ fingerprint: tests/conftest.py: bafybeidy5hw56kw5mxudnfbhvogofn6k4rqb4ux2bd45baedrrhmgyrude tests/states/test_base.py: bafybeieqy7wz5677jathwnolsgrt7zdifauammly3aeoq6dk4hdsqo5fte tests/states/test_bet_placement.py: bafybeibvc37n2cluep4tasvgmvwxwne2deais6ptirducpogk67v4gj4ga - tests/states/test_blacklising.py: bafybeihm2ex6l7fhorgi3mjj2epztu2r7bqbg56unpgpzfzymghshchqzy + tests/states/test_blacklising.py: bafybeifcsv7v34qi75vx5kw6w72wdjfxyq7vjcfm2oejqgpxitlnk7athy tests/states/test_check_benchmarking.py: bafybeiaauepn46l5z5kx2ifzsqcuravg3zvddecuhdgp4eaeous6vaqyoq tests/states/test_claim_subscription.py: bafybeiclkxjhceb3ehgmg6klt4uywew5drk5b3w6no7mwxetpubxqrejfy - tests/states/test_decision_receive.py: bafybeibkxalkfxuyokb6y5hkyu4pdlg4yfusbpgtkfr66cprygu7cgyd2y + tests/states/test_decision_receive.py: bafybeieshzx2nyjj6rbwkboku3paqismypof64vb6zwt7bhjvspeyu5kae tests/states/test_decision_request.py: bafybeigqbakm2olkwvcngertjplhnmu6on6tp6hxn7lxygi2gf5a5eurbe tests/states/test_final_states.py: bafybeiftfd3ovaqpfe7t5ry7maiziavk74wl66d6zo6ikhgodznormd2nm tests/states/test_handle_failed_tx.py: bafybeiebqgfhncmdexgq7khgkmcsym35547x3j6tr3mmybuyhocv6h5zpq @@ -74,8 +74,8 @@ fingerprint: tests/states/test_sampling.py: bafybeigefevj5ncbey2ynoctifqsmw6fa6ybhojoo4ah3derfgcwjqpwoy tests/states/test_tool_selection.py: bafybeib7js3dj7647t33o5ybfqftwytxktwrvhbri5yuyymg6znj6y7xxa tests/test_dialogues.py: bafybeibulo64tgfrq4e5qbcqnmifrlehkqciwuavublints353zaj2mlpa - tests/test_handlers.py: bafybeihpkgtjjm3uegpup6zkznpoaxqpu6kmp3ujiggrzbe73p5fzlq7im - tests/test_payloads.py: bafybeiggbcppj4j54r23qvg423elsnd7dcxl3sfo534ek5sd3g65ua57nq + tests/test_handlers.py: bafybeibpmso4geiw6n72lteqiqwjnkaux7rlkh7z3i2teuo2x4ajt3izye + tests/test_payloads.py: bafybeiejpbnrvcwjed3baqyu6h52ex4cglmlsz75j5jwr5yfarzaosogeu tests/test_rounds.py: bafybeigifftusd4ew42tyvyrr55o2uehhcik2gdq3atkpjwwlqdeskedty utils/__init__.py: bafybeiazrfg3kwfdl5q45azwz6b6mobqxngxpf4hazmrnkhinpk4qhbbf4 utils/nevermined.py: bafybeigallaqxhqopznhjhefr6bukh4ojkz5vdtqyzod5dksshrf24fjgi @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeidn2ghgtdnqi435bjiksyvisxexcjesimzwwdyqmnrlx446zr6wxm +- valory/market_manager_abci:0.1.0:bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index a6c3c69da..bcdf804ba 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -72,7 +72,7 @@ def __init__(self, **kwargs: Any) -> None: self.token_balance = 0 self.wallet_balance = 0 self.olas_balance = 0 - self.service_owner_address = "" + self.service_owner_address = None @property def synchronized_data(self) -> SynchronizedData: diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 9c3903d4d..4cea39611 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeig7flymus7uwvqn33ltced74atiah2kx2pmbwwkyyqr4qpxkxl5nq + behaviours.py: bafybeicppfir4pon7esmuuqcos6b2oas3cng3b4kkxuxwtnw2muuqdszjy bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 90f212313..3063a0048 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,11 +26,11 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeiaru2d32wpmcgqs64eepxud4idgubc3vmsbdwbia7gygipql2mmqi -- valory/decision_maker_abci:0.1.0:bafybeig5oivc24sqhgyxfhjbl2xsoa5yssv72lcu5ezunbcpwu3xo4jglm -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifpf3sk5evrvwxyht7mswcml3qy4nhzo5ddvjvgklapwsjwq6mera -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq -- valory/check_stop_trading_abci:0.1.0:bafybeieduekpd4zbvjztyxyooppqnmjvup6jfp74uo6hhupvtvzzscdzkq +- valory/market_manager_abci:0.1.0:bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole +- valory/decision_maker_abci:0.1.0:bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaxjpv44g5estpr2pmccgfyv5iywq6htmmns7md4c33rilolyzqxq +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 +- valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 3178b371d..ba7cbf1c9 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,8 +23,8 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeig5oivc24sqhgyxfhjbl2xsoa5yssv72lcu5ezunbcpwu3xo4jglm -- valory/staking_abci:0.1.0:bafybeicupccurmrg7qesivonlyt3nryarsmk5qf5yh6auno64wn45bybvq +- valory/decision_maker_abci:0.1.0:bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui +- valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: main: From 518f4ec1e1b80f45420c3626613833a27b0aab5d Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 27 Dec 2024 12:18:36 +0000 Subject: [PATCH 30/32] refactor: make olas token address param --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 9 +++++---- packages/valory/services/trader/service.yaml | 6 +++++- packages/valory/services/trader_pearl/service.yaml | 3 ++- .../valory/skills/decision_maker_abci/skill.yaml | 2 +- .../skills/market_manager_abci/behaviours.py | 11 ++++++++--- .../valory/skills/market_manager_abci/models.py | 1 + .../valory/skills/market_manager_abci/skill.yaml | 5 +++-- packages/valory/skills/trader_abci/skill.yaml | 7 ++++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 10 files changed, 37 insertions(+), 23 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 88878907b..1b2d0ddc7 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,15 +15,15 @@ "contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4", "contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", - "skill/valory/market_manager_abci/0.1.0": "bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole", - "skill/valory/decision_maker_abci/0.1.0": "bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui", - "skill/valory/trader_abci/0.1.0": "bafybeihpkbw26e3j673rd5std76y5idjmg5uyl6l6ngtpukyq6frm2m6hq", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaxjpv44g5estpr2pmccgfyv5iywq6htmmns7md4c33rilolyzqxq", + "skill/valory/market_manager_abci/0.1.0": "bafybeiaempf6otwzyjssxsztskv2zdv7ohsher2wkbzemsjcv2h47zuqsi", + "skill/valory/decision_maker_abci/0.1.0": "bafybeid52rs2v2zpognldegvlfbzbtchyfccchl7zqusvnbi77h7wti77y", + "skill/valory/trader_abci/0.1.0": "bafybeid4iscyvaga6eklhpvvannkfboazmig7p5yy447ma6i4x7ejnacma", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeihonvyfs2lc4olih2jirqmzbngccsxsrxqkkzfaqltjm7vkrnjrya", "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq", - "agent/valory/trader/0.1.0": "bafybeicls2tptdt77w46xsk7njext4mhmrs22rsvbzre2vwqglur26d2p4", - "service/valory/trader/0.1.0": "bafybeib5shk3mrsj72burbxsnrcbooafn23c2q4ygm2e5yugnsmrrhuk4i", - "service/valory/trader_pearl/0.1.0": "bafybeiga4sxrukuzxqcuh7vicbua3mmx424l7ggzl5jelbmj3eackslrqm" + "agent/valory/trader/0.1.0": "bafybeifoahwpraff5m5ymcyrjrh4hcgcaaodvwk4knic5olcttfcclvuym", + "service/valory/trader/0.1.0": "bafybeieawifob2p3xknnyhec6dtpgh3rkvmc7gvlxu7oifirstwdswagna", + "service/valory/trader_pearl/0.1.0": "bafybeihe5rahey4nnji3ru7nh6pqjvshkz2c554kjmdz5tn3rxzimukm5a" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 913d53218..4eef2fda1 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -46,10 +46,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaxjpv44g5estpr2pmccgfyv5iywq6htmmns7md4c33rilolyzqxq -- valory/market_manager_abci:0.1.0:bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole -- valory/decision_maker_abci:0.1.0:bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui -- valory/trader_abci:0.1.0:bafybeihpkbw26e3j673rd5std76y5idjmg5uyl6l6ngtpukyq6frm2m6hq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihonvyfs2lc4olih2jirqmzbngccsxsrxqkkzfaqltjm7vkrnjrya +- valory/market_manager_abci:0.1.0:bafybeiaempf6otwzyjssxsztskv2zdv7ohsher2wkbzemsjcv2h47zuqsi +- valory/decision_maker_abci:0.1.0:bafybeid52rs2v2zpognldegvlfbzbtchyfccchl7zqusvnbi77h7wti77y +- valory/trader_abci:0.1.0:bafybeid4iscyvaga6eklhpvvannkfboazmig7p5yy447ma6i4x7ejnacma - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm @@ -250,6 +250,7 @@ models: mech_invalid_response: ${str:Invalid Response} mech_consecutive_failures_threshold: ${int:2} tool_quarantine_duration: ${int:18000} + olas_token_address: ${str:0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f} benchmarking_mode: args: enabled: ${bool:false} diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 9fad06797..e6a5c8bd1 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:bafybeicls2tptdt77w46xsk7njext4mhmrs22rsvbzre2vwqglur26d2p4 +agent: valory/trader:0.1.0:bafybeifoahwpraff5m5ymcyrjrh4hcgcaaodvwk4knic5olcttfcclvuym number_of_agents: 4 deployment: agent: @@ -149,6 +149,7 @@ type: skill mech_invalid_response: ${MECH_INVALID_RESPONSE:str:Invalid Response} mech_consecutive_failures_threshold: ${MECH_CONSECUTIVE_FAILURES_THRESHOLD:int:2} tool_quarantine_duration: ${TOOL_QUARANTINE_DURATION:int:18000} + olas_token_address: ${OLAS_TOKEN_ADDRESS:str:0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f} benchmark_tool: &id004 args: log_dir: ${LOG_DIR:str:/benchmarks} @@ -376,6 +377,7 @@ type: skill mech_invalid_response: ${MECH_INVALID_RESPONSE:str:Invalid Response} mech_consecutive_failures_threshold: ${MECH_CONSECUTIVE_FAILURES_THRESHOLD:int:2} tool_quarantine_duration: ${TOOL_QUARANTINE_DURATION:int:18000} + olas_token_address: ${OLAS_TOKEN_ADDRESS:str:0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f} benchmark_tool: *id004 acc_info_fields: *id005 network_subgraph: *id006 @@ -497,6 +499,7 @@ type: skill mech_invalid_response: ${MECH_INVALID_RESPONSE:str:Invalid Response} mech_consecutive_failures_threshold: ${MECH_CONSECUTIVE_FAILURES_THRESHOLD:int:2} tool_quarantine_duration: ${TOOL_QUARANTINE_DURATION:int:18000} + olas_token_address: ${OLAS_TOKEN_ADDRESS:str:0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f} benchmark_tool: *id004 acc_info_fields: *id005 network_subgraph: *id006 @@ -618,6 +621,7 @@ type: skill mech_invalid_response: ${MECH_INVALID_RESPONSE:str:Invalid Response} mech_consecutive_failures_threshold: ${MECH_CONSECUTIVE_FAILURES_THRESHOLD:int:2} tool_quarantine_duration: ${TOOL_QUARANTINE_DURATION:int:18000} + olas_token_address: ${OLAS_TOKEN_ADDRESS:str:0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f} benchmark_tool: *id004 acc_info_fields: *id005 network_subgraph: *id006 diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 931b577d7..19c0906a1 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeicls2tptdt77w46xsk7njext4mhmrs22rsvbzre2vwqglur26d2p4 +agent: valory/trader:0.1.0:bafybeifoahwpraff5m5ymcyrjrh4hcgcaaodvwk4knic5olcttfcclvuym number_of_agents: 1 deployment: agent: @@ -107,6 +107,7 @@ models: mech_invalid_response: ${MECH_INVALID_RESPONSE:str:Invalid Response} mech_consecutive_failures_threshold: ${MECH_CONSECUTIVE_FAILURES_THRESHOLD:int:2} tool_quarantine_duration: ${TOOL_QUARANTINE_DURATION:int:18000} + olas_token_address: ${OLAS_TOKEN_ADDRESS:str:0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f} benchmark_tool: args: log_dir: /benchmarks diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 5dce4c157..784634e45 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -101,7 +101,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole +- valory/market_manager_abci:0.1.0:bafybeiaempf6otwzyjssxsztskv2zdv7ohsher2wkbzemsjcv2h47zuqsi - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 diff --git a/packages/valory/skills/market_manager_abci/behaviours.py b/packages/valory/skills/market_manager_abci/behaviours.py index bcdf804ba..507f3292c 100644 --- a/packages/valory/skills/market_manager_abci/behaviours.py +++ b/packages/valory/skills/market_manager_abci/behaviours.py @@ -23,7 +23,7 @@ import os.path from abc import ABC from json import JSONDecodeError -from typing import Any, Dict, Generator, List, Optional, Set, Type +from typing import Any, Dict, Generator, List, Optional, Set, Type, cast from aea.helpers.ipfs.base import IPFSHashOnly @@ -42,6 +42,7 @@ MAX_LOG_SIZE, QueryingBehaviour, ) +from packages.valory.skills.market_manager_abci.models import MarketManagerParams from packages.valory.skills.market_manager_abci.payloads import UpdateBetsPayload from packages.valory.skills.market_manager_abci.rounds import ( MarketManagerAbciApp, @@ -57,7 +58,6 @@ READ_MODE = "r" WRITE_MODE = "w" WXDAI = "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" -OLAS_TOKEN_ADDRESS = "0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f" class BetsManagerBehaviour(BaseBehaviour, ABC): @@ -74,6 +74,11 @@ def __init__(self, **kwargs: Any) -> None: self.olas_balance = 0 self.service_owner_address = None + @property + def params(self) -> MarketManagerParams: + """Return the params.""" + return cast(MarketManagerParams, self.context.params) + @property def synchronized_data(self) -> SynchronizedData: """Return the synchronized data.""" @@ -183,7 +188,7 @@ def get_olas_balance(self) -> WaitableConditionType: response_msg = yield from self.get_contract_api_response( performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore - contract_address=OLAS_TOKEN_ADDRESS, + contract_address=self.params.olas_token_address, contract_id=str(ERC20.contract_id), contract_callable="check_balance", account=self.synchronized_data.safe_contract_address, diff --git a/packages/valory/skills/market_manager_abci/models.py b/packages/valory/skills/market_manager_abci/models.py index c39c3fc94..87abbb7c1 100644 --- a/packages/valory/skills/market_manager_abci/models.py +++ b/packages/valory/skills/market_manager_abci/models.py @@ -100,6 +100,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.the_graph_payment_required_error: str = self._ensure( "the_graph_payment_required_error", kwargs, str ) + self.olas_token_address: str = self._ensure("olas_token_address", kwargs, str) super().__init__(*args, **kwargs) @property diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 4cea39611..0c547eebb 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeicppfir4pon7esmuuqcos6b2oas3cng3b4kkxuxwtnw2muuqdszjy + behaviours.py: bafybeiatebwhyme2norauysea3fe7yz7ajoanu5enmj2kwsuyhbpee3y4m bets.py: bafybeibx3x5nasuj6loneeat2lb7fr7kgsmnz7on7f4gxfbpzerzdvawou dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q @@ -22,7 +22,7 @@ fingerprint: graph_tooling/requests.py: bafybeibjyb6av33aswnptttekj6t7k7xysgphh2bigoorcgkc54y2j3xkm graph_tooling/utils.py: bafybeig5hxhnqgyfn5ym3poc5nziqwpeozqbd6wa4s6c2hjn6iyedg3t3y handlers.py: bafybeihot2i2yvfkz2gcowvt66wdu6tkjbmv7hsmc4jzt4reqeaiuphbtu - models.py: bafybeibjttnga54y4auz6f33ecfrngyw53b2xzpompm72drjsr4xoytmiy + models.py: bafybeiaqmhz2y4yw4teyvfkmysai536vshzps47snnc2ma3jgaczel7ouy payloads.py: bafybeib2a2e4fableelw246sr2vougv4vdiyyvdggffy6eohi4c4e3b4se rounds.py: bafybeic3nwjaf6j7zwuso7d4sfmvlp4urkr4t2z2e75xbeu32wvsacjdem tests/__init__.py: bafybeigaewntxawezvygss345kytjijo56bfwddjtfm6egzxfajsgojam4 @@ -153,6 +153,7 @@ models: the_graph_error_message_key: message the_graph_payment_required_error: payment required for subsequent requests for this API key + olas_token_address: 1176450834230691801752024514692939426424709160351 class_name: MarketManagerParams network_subgraph: args: diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 3063a0048..688a49966 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/market_manager_abci:0.1.0:bafybeiejkh7xrqqgw7c45yu2wshrleld6h6dbkr7djcxeqwysvcoghyole -- valory/decision_maker_abci:0.1.0:bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaxjpv44g5estpr2pmccgfyv5iywq6htmmns7md4c33rilolyzqxq +- valory/market_manager_abci:0.1.0:bafybeiaempf6otwzyjssxsztskv2zdv7ohsher2wkbzemsjcv2h47zuqsi +- valory/decision_maker_abci:0.1.0:bafybeid52rs2v2zpognldegvlfbzbtchyfccchl7zqusvnbi77h7wti77y +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihonvyfs2lc4olih2jirqmzbngccsxsrxqkkzfaqltjm7vkrnjrya - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm @@ -260,6 +260,7 @@ models: mech_invalid_response: Invalid Response mech_consecutive_failures_threshold: 2 tool_quarantine_duration: 18000 + olas_token_address: '0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f' class_name: TraderParams benchmarking_mode: args: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index ba7cbf1c9..b35f4dfa8 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -23,7 +23,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_maker_abci:0.1.0:bafybeigxhrvngsdlujmoialunj63cuubz2x3guo666bwtazi5ldc5wvoui +- valory/decision_maker_abci:0.1.0:bafybeid52rs2v2zpognldegvlfbzbtchyfccchl7zqusvnbi77h7wti77y - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 204764e45ee5345bf32e74550ba637a60bcbe130 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 27 Dec 2024 12:34:09 +0000 Subject: [PATCH 31/32] fix: gitleaksignore --- .gitleaksignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitleaksignore b/.gitleaksignore index 3bd1b6f60..c5d5a9117 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -27,3 +27,5 @@ ae28aeb8ad56e1873bfb3996c5d5ad8367709cd1:packages/valory/skills/decision_maker_a ae28aeb8ad56e1873bfb3996c5d5ad8367709cd1:packages/valory/skills/trader_abci/skill.yaml:generic-api-key:154 9d8617ddd58c172f8d9dd32a7b74f22aa3d27dfb:packages/valory/skills/mech_interact_abci/skill.yaml:generic-api-key:151 0b4170ce2e876c28a9585081117e6468db17f0b9:packages/valory/services/trader_omen_gnosis/service.yaml:generic-api-key:48 +0c54647f03886d75fca4522420ea72b58d6c3dcc:packages/valory/skills/market_manager_abci/behaviours.py:generic-api-key:59 +ce332275857ab3dabb2c0c57330fb2137b6b77f7:packages/valory/skills/trader_abci/skill.yaml:generic-api-key:263 From 4c6c7a1ed0d65985ebf5f522d78bf185848c2578 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 27 Dec 2024 12:37:33 +0000 Subject: [PATCH 32/32] fix: trader skill --- .gitleaksignore | 1 + packages/packages.json | 8 ++++---- packages/valory/agents/trader/aea-config.yaml | 2 +- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitleaksignore b/.gitleaksignore index c5d5a9117..58238a5d2 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -29,3 +29,4 @@ ae28aeb8ad56e1873bfb3996c5d5ad8367709cd1:packages/valory/skills/trader_abci/skil 0b4170ce2e876c28a9585081117e6468db17f0b9:packages/valory/services/trader_omen_gnosis/service.yaml:generic-api-key:48 0c54647f03886d75fca4522420ea72b58d6c3dcc:packages/valory/skills/market_manager_abci/behaviours.py:generic-api-key:59 ce332275857ab3dabb2c0c57330fb2137b6b77f7:packages/valory/skills/trader_abci/skill.yaml:generic-api-key:263 +518f4ec1e1b80f45420c3626613833a27b0aab5d:packages/valory/skills/trader_abci/skill.yaml:generic-api-key:263 diff --git a/packages/packages.json b/packages/packages.json index 1b2d0ddc7..d0a27f556 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeiaempf6otwzyjssxsztskv2zdv7ohsher2wkbzemsjcv2h47zuqsi", "skill/valory/decision_maker_abci/0.1.0": "bafybeid52rs2v2zpognldegvlfbzbtchyfccchl7zqusvnbi77h7wti77y", - "skill/valory/trader_abci/0.1.0": "bafybeid4iscyvaga6eklhpvvannkfboazmig7p5yy447ma6i4x7ejnacma", + "skill/valory/trader_abci/0.1.0": "bafybeihjydpznncyru7iwx2d5ti6dye2jinzfkscozjhe5iap2mayhm3uu", "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeihonvyfs2lc4olih2jirqmzbngccsxsrxqkkzfaqltjm7vkrnjrya", "skill/valory/staking_abci/0.1.0": "bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq", - "agent/valory/trader/0.1.0": "bafybeifoahwpraff5m5ymcyrjrh4hcgcaaodvwk4knic5olcttfcclvuym", - "service/valory/trader/0.1.0": "bafybeieawifob2p3xknnyhec6dtpgh3rkvmc7gvlxu7oifirstwdswagna", - "service/valory/trader_pearl/0.1.0": "bafybeihe5rahey4nnji3ru7nh6pqjvshkz2c554kjmdz5tn3rxzimukm5a" + "agent/valory/trader/0.1.0": "bafybeidw7p5akevcfjyqvh7kzkxxe7mpceup2dl3weasfudzhpepp6ehdm", + "service/valory/trader/0.1.0": "bafybeib2utrngazrxtuf44xzcvy5szd3dwvipzr6plnukyjv3g7cgfb2ga", + "service/valory/trader_pearl/0.1.0": "bafybeif6pijjqsev6szs2cajgtnrp376xrfvw76j7jpt6ab3msxyf3kkgy" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 4eef2fda1..6f3f1888d 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -49,7 +49,7 @@ skills: - valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihonvyfs2lc4olih2jirqmzbngccsxsrxqkkzfaqltjm7vkrnjrya - valory/market_manager_abci:0.1.0:bafybeiaempf6otwzyjssxsztskv2zdv7ohsher2wkbzemsjcv2h47zuqsi - valory/decision_maker_abci:0.1.0:bafybeid52rs2v2zpognldegvlfbzbtchyfccchl7zqusvnbi77h7wti77y -- valory/trader_abci:0.1.0:bafybeid4iscyvaga6eklhpvvannkfboazmig7p5yy447ma6i4x7ejnacma +- valory/trader_abci:0.1.0:bafybeihjydpznncyru7iwx2d5ti6dye2jinzfkscozjhe5iap2mayhm3uu - valory/staking_abci:0.1.0:bafybeihwaf4gimmzhytwyzujxpg4gt4iq3wpoz5zyduxhbxo2uezm2scg4 - valory/check_stop_trading_abci:0.1.0:bafybeigcvlllbqzn632nmw3eowwkesthlqk56ls4x22tytilver4sasetq - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index e6a5c8bd1..1fad6379d 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:bafybeifoahwpraff5m5ymcyrjrh4hcgcaaodvwk4knic5olcttfcclvuym +agent: valory/trader:0.1.0:bafybeidw7p5akevcfjyqvh7kzkxxe7mpceup2dl3weasfudzhpepp6ehdm number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 19c0906a1..2acc38918 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifoahwpraff5m5ymcyrjrh4hcgcaaodvwk4knic5olcttfcclvuym +agent: valory/trader:0.1.0:bafybeidw7p5akevcfjyqvh7kzkxxe7mpceup2dl3weasfudzhpepp6ehdm number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 688a49966..5ff4cf595 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -260,7 +260,7 @@ models: mech_invalid_response: Invalid Response mech_consecutive_failures_threshold: 2 tool_quarantine_duration: 18000 - olas_token_address: '0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f' + olas_token_address: '0x0000000000000000000000000000000000000000' class_name: TraderParams benchmarking_mode: args: