From d8416085660309874dded9c5e209b82b50a61db1 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 7 Nov 2024 18:21:20 +0000 Subject: [PATCH 01/29] feat/add sell outcome token feature --- packages/packages.json | 14 +- packages/valory/agents/trader/aea-config.yaml | 8 +- .../valory/contracts/market_maker/contract.py | 51 ++++ .../contracts/market_maker/contract.yaml | 2 +- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../behaviours/sell_outcome_token.py | 227 ++++++++++++++++++ .../skills/decision_maker_abci/skill.yaml | 3 +- packages/valory/skills/trader_abci/skill.yaml | 4 +- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 10 files changed, 297 insertions(+), 18 deletions(-) create mode 100644 packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py diff --git a/packages/packages.json b/packages/packages.json index 50d584ed9..e27a6f800 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi", + "contract/valory/market_maker/0.1.0": "bafybeihbiiddv76kgjt2sgiv7qapih5bnz3clamjddmotxn4u6ay223voq", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -16,14 +16,14 @@ "contract/valory/staking_token/0.1.0": "bafybeigwsffbzx62d3ikz5kyjsewcvknrrnq3bcqgktnbrcpz4g6lyu3eq", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka", - "skill/valory/decision_maker_abci/0.1.0": "bafybeiaiqddhwawt7u6stg6ujmzmnn3my7dtqa7tur5jbjfswnsasfoila", - "skill/valory/trader_abci/0.1.0": "bafybeidq5fxitj26rcy37pyrksoyks65zusndh6sor6ct5qv26kz3eupl4", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidw5cedygh25jtxdv35zb4223kbhtwv6enfxtkkdkuhuayvply5gq", + "skill/valory/decision_maker_abci/0.1.0": "bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa", + "skill/valory/trader_abci/0.1.0": "bafybeidvruc4d7mww6g5wwjg2qxmn4otltgnrblmdm33aqz7gaddmuuowu", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibj73lyygkdgejbh35lpdt2lm65scneujktx7hgisfwxinu5ehm4e", "skill/valory/staking_abci/0.1.0": "bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeicsrrxjs6bup267jiek3r7eutd42ssfyjthyvxfku6qozw3xebxta", - "agent/valory/trader/0.1.0": "bafybeief2fkdv5pvryo6kyzguqhyfrvsxvb2sqnt4ptriairagjvuonttq", - "service/valory/trader/0.1.0": "bafybeig4b4v62lkebjacfstiizb3cr6ir6vtj6qhrfcpvry7vltikyqyyq", - "service/valory/trader_pearl/0.1.0": "bafybeicioq4b7o7ajmwigl66lvy2yiaprdagmrvz34awq55nxsoupr6ooe" + "agent/valory/trader/0.1.0": "bafybeieoqnkdrwpjlysrgavjk44f43jwm6tbwomk35uojumohfgnqcjqw4", + "service/valory/trader/0.1.0": "bafybeiaini4ak45ewfywv3dknxot2my7ppqcotm3333fpnmnzmomciilci", + "service/valory/trader_pearl/0.1.0": "bafybeicwvmcjwmmxfpqtuyof4pu4k7duc23mybvfoh4rq3pfdul7s5eblq" }, "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 b17ec0e2a..7aa90fbaf 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeihbiiddv76kgjt2sgiv7qapih5bnz3clamjddmotxn4u6ay223voq - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeidw5cedygh25jtxdv35zb4223kbhtwv6enfxtkkdkuhuayvply5gq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibj73lyygkdgejbh35lpdt2lm65scneujktx7hgisfwxinu5ehm4e - valory/market_manager_abci:0.1.0:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka -- valory/decision_maker_abci:0.1.0:bafybeiaiqddhwawt7u6stg6ujmzmnn3my7dtqa7tur5jbjfswnsasfoila -- valory/trader_abci:0.1.0:bafybeidq5fxitj26rcy37pyrksoyks65zusndh6sor6ct5qv26kz3eupl4 +- valory/decision_maker_abci:0.1.0:bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa +- valory/trader_abci:0.1.0:bafybeidvruc4d7mww6g5wwjg2qxmn4otltgnrblmdm33aqz7gaddmuuowu - valory/staking_abci:0.1.0:bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4 - valory/check_stop_trading_abci:0.1.0:bafybeicsrrxjs6bup267jiek3r7eutd42ssfyjthyvxfku6qozw3xebxta - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/contracts/market_maker/contract.py b/packages/valory/contracts/market_maker/contract.py index 71c233962..b66d20f64 100644 --- a/packages/valory/contracts/market_maker/contract.py +++ b/packages/valory/contracts/market_maker/contract.py @@ -133,3 +133,54 @@ def get_buy_data( outcomeIndex=outcome_index, minOutcomeTokensToBuy=min_outcome_tokens_to_buy, ) + + @classmethod + def calc_sell_amount( + cls, + ledger_api: EthereumApi, + contract_address: str, + return_amount: int, + outcome_index: int, + ) -> JSONLike: + """ + Calculate the buy amount. + + :param ledger_api: the ledger API object + :param contract_address: the contract address + :param return_amount: the amount the user will have returned + :param outcome_index: the index of the answer's outcome that the user wants to sell for + :return: the outcomeTokenSellAmount + """ + outcome_token_sell_amount = cls._method_call( + ledger_api, + contract_address, + "calcSellAmount", + returnAmount=return_amount, + outcomeIndex=outcome_index, + ) + return dict(outcomeTokenSellAmount=outcome_token_sell_amount) + + def get_sell_data( + cls, + ledger_api: LedgerApi, + contract_address: str, + return_amount: int, + outcome_index: int, + max_outcome_tokens_to_sell: int, + ) -> Dict[str, bytes]: + """Gets the encoded arguments for a sell tx, which should only be called via the multisig. + + :param ledger_api: the ledger API object + :param contract_address: the contract address + :param return_amount: the amount the user have returned + :param outcome_index: the index of the answer's outcome that the user wants to sell tokens for + :param max_outcome_tokens_to_sell: the output of the `calcSellAmount` contract method + """ + return cls._encode_abi( + ledger_api, + contract_address, + "sell", + returnAmount=return_amount, + outcomeIndex=outcome_index, + outcomeTokenSellAmount=max_outcome_tokens_to_sell, + ) diff --git a/packages/valory/contracts/market_maker/contract.yaml b/packages/valory/contracts/market_maker/contract.yaml index fbcae9d97..ec213a0a8 100644 --- a/packages/valory/contracts/market_maker/contract.yaml +++ b/packages/valory/contracts/market_maker/contract.yaml @@ -9,7 +9,7 @@ fingerprint: README.md: bafybeiegnihrovfkk5big52pl4bo6evt5toqvvmft2jgnq6ofdbhfp7xwa __init__.py: bafybeicoucixii3fv5xlpk3zfewm4ys4okidcng54bhtjxvwup7g2jcjza build/FixedProductMarketMaker.json: bafybeigim7n3f67r5czfc5wp2m7cxzxwvnhxops3n5j2zlawenan7qrrtu - contract.py: bafybeicfiicuke4ly5hpcxtyvnob5bgzrqsopuxalruxp2m3w4koxmhrqa + contract.py: bafybeicp2tz6tk5nxd4syysvpbieizbl6ryz4ilyglrykqtuh7frlokegi fingerprint_ignore_patterns: [] contracts: [] class_name: FixedProductMarketMakerContract diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index c0bf011d9..06b7c24cb 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:bafybeief2fkdv5pvryo6kyzguqhyfrvsxvb2sqnt4ptriairagjvuonttq +agent: valory/trader:0.1.0:bafybeieoqnkdrwpjlysrgavjk44f43jwm6tbwomk35uojumohfgnqcjqw4 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 fb5b64536..d12d53f20 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:bafybeief2fkdv5pvryo6kyzguqhyfrvsxvb2sqnt4ptriairagjvuonttq +agent: valory/trader:0.1.0:bafybeieoqnkdrwpjlysrgavjk44f43jwm6tbwomk35uojumohfgnqcjqw4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py new file mode 100644 index 000000000..1a3df3a71 --- /dev/null +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2021-2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + + +"""This module contains the behaviour for selling a token.""" +from typing import Any, Generator, Optional, cast + +from hexbytes import HexBytes + +from packages.valory.contracts.erc20.contract import ERC20 +from packages.valory.contracts.market_maker.contract import ( + FixedProductMarketMakerContract, +) +from packages.valory.protocols.contract_api import ContractApiMessage +from packages.valory.skills.decision_maker_abci.behaviours.base import ( + DecisionMakerBaseBehaviour, + WXDAI, + WaitableConditionType, + remove_fraction_wei, +) +from packages.valory.skills.decision_maker_abci.models import MultisendBatch +from packages.valory.skills.decision_maker_abci.payloads import MultisigTxPayload + + +class SellTokenBehaviour(DecisionMakerBaseBehaviour): + """A behaviour in which the agents sell a token.""" + + # matching_round = SellTokenRound + + def __init__(self, **kwargs: Any) -> None: + """Initialize the sell token behaviour.""" + super().__init__(**kwargs) + self.sell_amount = 0 + + @property + def market_maker_contract_address(self) -> str: + """Get the contract address of the market maker on which the service is going to place the bet.""" + return self.sampled_bet.id + + @property + def return_amount(self) -> int: + """Get the return amount of the bet.""" + # TODO: + # this will need to be the amount that we have previously bet on an outcome + return self.synchronized_data.bet_amount + + @property + def outcome_index(self) -> int: + """Get the index of the outcome for which the service is going to sell token.""" + return cast(int, self.synchronized_data.vote) + + def check_outcome_token_balance(self) -> WaitableConditionType: + """Check the safe's balance for a particular outcome token.""" + + def _build_exchange_tx(self) -> WaitableConditionType: + """Exchange xDAI to wxDAI.""" + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_STATE, # type: ignore + contract_address=WXDAI, + contract_id=str(ERC20.contract_id), + contract_callable="build_deposit_tx", + ) + + if response_msg.performative != ContractApiMessage.Performative.STATE: + self.context.logger.info(f"Could not build deposit tx: {response_msg}") + return False + + approval_data = response_msg.state.body.get("data") + if approval_data is None: + self.context.logger.info(f"Could not build deposit tx: {response_msg}") + return False + + batch = MultisendBatch( + to=self.collateral_token, + data=HexBytes(approval_data), + value=self.w_xdai_deficit, + ) + self.multisend_batches.append(batch) + return True + + def _build_approval_tx(self) -> WaitableConditionType: + """Build an ERC20 approve transaction.""" + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_STATE, # type: ignore + contract_address=self.collateral_token, + contract_id=str(ERC20.contract_id), + contract_callable="build_approval_tx", + spender=self.market_maker_contract_address, + amount=self.return_amount, + ) + + if response_msg.performative != ContractApiMessage.Performative.STATE: + self.context.logger.info(f"Could not build approval tx: {response_msg}") + return False + + approval_data = response_msg.state.body.get("data") + if approval_data is None: + self.context.logger.info(f"Could not build approval tx: {response_msg}") + return False + + batch = MultisendBatch( + to=self.market_maker_contract_address, + data=HexBytes(approval_data), + ) + self.multisend_batches.append(batch) + return True + + def _calc_sell_amount(self) -> WaitableConditionType: + """Calculate the sell amount of the conditional token.""" + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore + contract_address=self.market_maker_contract_address, + contract_id=str(FixedProductMarketMakerContract.contract_id), + contract_callable="calc_sell_amount", + return_amount=self.return_amount, + outcome_index=self.outcome_index, + ) + if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION: + self.context.logger.error( + f"Could not calculate the sell amount: {response_msg}" + ) + return False + + sell_amount = response_msg.raw_transaction.body.get( + "outcomeTokenSellAmount", None + ) + if sell_amount is None: + self.context.logger.error( + f"Something went wrong while trying to get the outcomeTokenSellAmount amount for the conditional token: {response_msg}" + ) + return False + + # TODO: not sure this is the correct use of remove_fraction_wei, is sell amount in wxDAI? + self.sell_amount = remove_fraction_wei(sell_amount, self.params.slippage) + return True + + def _build_sell_tx(self) -> WaitableConditionType: + """Get the sell tx data encoded.""" + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_STATE, # type: ignore + contract_address=self.market_maker_contract_address, + contract_id=str(FixedProductMarketMakerContract.contract_id), + contract_callable="get_sell_data", + return_amount=self.return_amount, + outcome_index=self.outcome_index, + max_outcome_tokens_to_sell=self.sell_amount, + ) + if response_msg.performative != ContractApiMessage.Performative.STATE: + self.context.logger.error( + f"Could not get the data for the buy transaction: {response_msg}" + ) + return False + + sell_data = response_msg.state.body.get("data", None) + if sell_data is None: + self.context.logger.error( + f"Something went wrong while trying to encode the buy data: {response_msg}" + ) + return False + + batch = MultisendBatch( + to=self.market_maker_contract_address, + data=HexBytes(sell_data), + ) + self.multisend_batches.append(batch) + return True + + def _prepare_safe_tx(self) -> Generator[None, None, Optional[str]]: + """Prepare the safe transaction for selling an outcome token and return the hex for the tx settlement skill.""" + for step in ( + self._build_approval_tx, + self._calc_sell_amount, + self._build_sell_tx, + self._build_multisend_data, + self._build_multisend_safe_tx_hash, + ): + yield from self.wait_for_condition_with_sleep(step) + + outcome = self.sampled_bet.get_outcome(self.outcome_index) + investment = self._collateral_amount_info(self.return_amount) + self.context.logger.info( + f"Preparing a multisig transaction to sell the outcome token for {outcome!r}, with confidence " + f"{self.synchronized_data.confidence!r}, for the amount of {investment}, which is equal to the amount of " + f"{self.buy_amount!r} WEI of the conditional token corresponding to {outcome!r}." + ) + + return self.tx_hex + + def async_act(self) -> Generator: + """Do the action.""" + + agent = self.context.agent_address + + with self.context.benchmark_tool.measure(self.behaviour_id).local(): + tx_submitter = betting_tx_hex = mocking_mode = None + + # TODO: there should be some kind of check here to verify the amount being sold is not more than the + # previously bought amount + # this needs to call balanceOf on the ERC20 contract + self.check_outcome_token_balance() + + if self.is_wxdai: + tx_submitter = self.matching_round.auto_round_id() + betting_tx_hex = yield from self._prepare_safe_tx() + + payload = MultisigTxPayload( + agent, tx_submitter, betting_tx_hex, mocking_mode + ) + + yield from self.finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 53e5113c5..a91df33af 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -25,6 +25,7 @@ fingerprint: behaviours/reedem.py: bafybeiaxwp4lx62owcaqfp6xcqh6567f5yvwnl4rage2f5hmq4nltkzjjy behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeiekxzublnsvgjb2y2uvtye4zkethvmsxh4itonnwmb3sbviyyhsgq + behaviours/sell_outcome_token.py: bafybeiht5a5ifzwewbethqhmdjbwywywrc7vc7u4ka7gndiw4r5737qbzq behaviours/storage_manager.py: bafybeif7mrnmhrarndx225e26jseuieosdja4jnlewnv2mtxqdydevxuze behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -69,7 +70,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeihbiiddv76kgjt2sgiv7qapih5bnz3clamjddmotxn4u6ay223voq - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 24666df2c..57f79a79d 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:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka -- valory/decision_maker_abci:0.1.0:bafybeiaiqddhwawt7u6stg6ujmzmnn3my7dtqa7tur5jbjfswnsasfoila -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidw5cedygh25jtxdv35zb4223kbhtwv6enfxtkkdkuhuayvply5gq +- valory/decision_maker_abci:0.1.0:bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibj73lyygkdgejbh35lpdt2lm65scneujktx7hgisfwxinu5ehm4e - valory/staking_abci:0.1.0:bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4 - valory/check_stop_trading_abci:0.1.0:bafybeicsrrxjs6bup267jiek3r7eutd42ssfyjthyvxfku6qozw3xebxta - 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 f02c6c7e8..d74faa3f1 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:bafybeiaiqddhwawt7u6stg6ujmzmnn3my7dtqa7tur5jbjfswnsasfoila +- valory/decision_maker_abci:0.1.0:bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa - valory/staking_abci:0.1.0:bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 501b33d8725b5e6825cc61089d31c19d00c14e26 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Tue, 12 Nov 2024 11:45:22 +0000 Subject: [PATCH 02/29] fix error in reported message --- .../decision_maker_abci/behaviours/sell_outcome_token.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index 1a3df3a71..3cab05548 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -198,7 +198,7 @@ def _prepare_safe_tx(self) -> Generator[None, None, Optional[str]]: self.context.logger.info( f"Preparing a multisig transaction to sell the outcome token for {outcome!r}, with confidence " f"{self.synchronized_data.confidence!r}, for the amount of {investment}, which is equal to the amount of " - f"{self.buy_amount!r} WEI of the conditional token corresponding to {outcome!r}." + f"{self.sell_amount!r} WEI of the conditional token corresponding to {outcome!r}." ) return self.tx_hex @@ -214,6 +214,7 @@ def async_act(self) -> Generator: # TODO: there should be some kind of check here to verify the amount being sold is not more than the # previously bought amount # this needs to call balanceOf on the ERC20 contract + # use conditionaltokenaddress self.check_outcome_token_balance() if self.is_wxdai: From 65cb73a3b91e43c5e376405130d8913ff82b528d Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Wed, 13 Nov 2024 10:11:16 +0000 Subject: [PATCH 03/29] add return amount and sell outcome token round --- .../behaviours/sell_outcome_token.py | 65 ++++++++----------- .../skills/decision_maker_abci/models.py | 2 + .../states/sell_outcome_token.py | 7 ++ 3 files changed, 35 insertions(+), 39 deletions(-) create mode 100644 packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index 3cab05548..fedcb8cca 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -22,8 +22,12 @@ """This module contains the behaviour for selling a token.""" from typing import Any, Generator, Optional, cast +from aea.configurations.data_types import PublicId from hexbytes import HexBytes +from packages.valory.contracts.conditional_tokens.contract import ( + ConditionalTokensContract, +) from packages.valory.contracts.erc20.contract import ERC20 from packages.valory.contracts.market_maker.contract import ( FixedProductMarketMakerContract, @@ -31,69 +35,56 @@ from packages.valory.protocols.contract_api import ContractApiMessage from packages.valory.skills.decision_maker_abci.behaviours.base import ( DecisionMakerBaseBehaviour, - WXDAI, WaitableConditionType, remove_fraction_wei, ) from packages.valory.skills.decision_maker_abci.models import MultisendBatch from packages.valory.skills.decision_maker_abci.payloads import MultisigTxPayload +from packages.valory.skills.decision_maker_abci.states.sell_outcome_token import ( + SellOutcomeTokenRound, +) class SellTokenBehaviour(DecisionMakerBaseBehaviour): """A behaviour in which the agents sell a token.""" - # matching_round = SellTokenRound + matching_round = SellOutcomeTokenRound def __init__(self, **kwargs: Any) -> None: """Initialize the sell token behaviour.""" super().__init__(**kwargs) self.sell_amount = 0 + self.outcome_token_balance = 0 + self.return_amount = 0 @property def market_maker_contract_address(self) -> str: """Get the contract address of the market maker on which the service is going to place the bet.""" return self.sampled_bet.id - @property - def return_amount(self) -> int: - """Get the return amount of the bet.""" - # TODO: - # this will need to be the amount that we have previously bet on an outcome - return self.synchronized_data.bet_amount - @property def outcome_index(self) -> int: """Get the index of the outcome for which the service is going to sell token.""" return cast(int, self.synchronized_data.vote) + @property + def current_condition_id(self) -> PublicId: + """Get the current condition id.""" + return self.shared_state.current_condition_id + def check_outcome_token_balance(self) -> WaitableConditionType: """Check the safe's balance for a particular outcome token.""" - - def _build_exchange_tx(self) -> WaitableConditionType: - """Exchange xDAI to wxDAI.""" - response_msg = yield from self.get_contract_api_response( - performative=ContractApiMessage.Performative.GET_STATE, # type: ignore - contract_address=WXDAI, - contract_id=str(ERC20.contract_id), - contract_callable="build_deposit_tx", - ) - - if response_msg.performative != ContractApiMessage.Performative.STATE: - self.context.logger.info(f"Could not build deposit tx: {response_msg}") - return False - - approval_data = response_msg.state.body.get("data") - if approval_data is None: - self.context.logger.info(f"Could not build deposit tx: {response_msg}") - return False - - batch = MultisendBatch( - to=self.collateral_token, - data=HexBytes(approval_data), - value=self.w_xdai_deficit, + response_msg = yield from self.contract_interact( + performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore + contract_address=self.params.conditional_tokens_address, + contract_public_id=ConditionalTokensContract.contract_id, + contract_callable="balanceOf", + data_key="data", + placeholder="outcome_token_balance", + id=self.current_condition_id, + owner=self.synchronized_data.safe_contract_address, ) - self.multisend_batches.append(batch) - return True + return response_msg def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" @@ -211,11 +202,7 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).local(): tx_submitter = betting_tx_hex = mocking_mode = None - # TODO: there should be some kind of check here to verify the amount being sold is not more than the - # previously bought amount - # this needs to call balanceOf on the ERC20 contract - # use conditionaltokenaddress - self.check_outcome_token_balance() + self.return_amount = yield from self.check_outcome_token_balance() if self.is_wxdai: tx_submitter = self.matching_round.auto_round_id() diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 0b90f2e9d..581e4e3e3 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -37,6 +37,7 @@ Union, ) +from aea.configurations.data_types import PublicId from aea.skills.base import Model, SkillContext from hexbytes import HexBytes from web3.constants import HASH_ZERO @@ -215,6 +216,7 @@ def __init__(self, *args: Any, skill_context: SkillContext, **kwargs: Any) -> No self.liquidity_prices: Dict[str, List[float]] = {} # whether this is the last run of the benchmarking mode self.last_benchmarking_has_run: bool = False + self.current_condition_id: Optional[PublicId] = None @property def mock_question_id(self) -> Any: diff --git a/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py new file mode 100644 index 000000000..98a3bc965 --- /dev/null +++ b/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py @@ -0,0 +1,7 @@ +"""This module contains the sell outcome token state of the decision-making abci app.""" + +from packages.valory.skills.decision_maker_abci.states.base import TxPreparationRound + + +class SellOutcomeTokenRound(TxPreparationRound): + """A round for selling a token.""" From b7e7a5185121245a2658574fbfd019e0984df74e Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Wed, 13 Nov 2024 10:12:16 +0000 Subject: [PATCH 04/29] chore: generators --- packages/packages.json | 14 ++++++------- packages/valory/agents/trader/aea-config.yaml | 8 +++---- .../valory/contracts/market_maker/contract.py | 2 +- .../contracts/market_maker/contract.yaml | 2 +- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/decision_maker_abci/skill.yaml | 7 ++++--- .../states/sell_outcome_token.py | 21 +++++++++++++++++++ packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 10 files changed, 43 insertions(+), 21 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index e27a6f800..30fa644c3 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihbiiddv76kgjt2sgiv7qapih5bnz3clamjddmotxn4u6ay223voq", + "contract/valory/market_maker/0.1.0": "bafybeidlivzxbpnxajfmgszioihi7yvv4xrhdu7uz3e6gqp67ugws5dx4i", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -16,14 +16,14 @@ "contract/valory/staking_token/0.1.0": "bafybeigwsffbzx62d3ikz5kyjsewcvknrrnq3bcqgktnbrcpz4g6lyu3eq", "contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4", "skill/valory/market_manager_abci/0.1.0": "bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka", - "skill/valory/decision_maker_abci/0.1.0": "bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa", - "skill/valory/trader_abci/0.1.0": "bafybeidvruc4d7mww6g5wwjg2qxmn4otltgnrblmdm33aqz7gaddmuuowu", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibj73lyygkdgejbh35lpdt2lm65scneujktx7hgisfwxinu5ehm4e", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiadmtn77idgii754dhbsqtnyn3heifyb4vao2enyerqv2ck572r3e", + "skill/valory/trader_abci/0.1.0": "bafybeig42g4afi2d35ntrc7dkssokvsxhibduexda6kiwqrxocxy7nml3y", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigvv6xlnoyfv6shqrtlkubvx67bewrs4whyqqgkshse2ftdktjnjq", "skill/valory/staking_abci/0.1.0": "bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeicsrrxjs6bup267jiek3r7eutd42ssfyjthyvxfku6qozw3xebxta", - "agent/valory/trader/0.1.0": "bafybeieoqnkdrwpjlysrgavjk44f43jwm6tbwomk35uojumohfgnqcjqw4", - "service/valory/trader/0.1.0": "bafybeiaini4ak45ewfywv3dknxot2my7ppqcotm3333fpnmnzmomciilci", - "service/valory/trader_pearl/0.1.0": "bafybeicwvmcjwmmxfpqtuyof4pu4k7duc23mybvfoh4rq3pfdul7s5eblq" + "agent/valory/trader/0.1.0": "bafybeiawqhr67yxzokq5c23hwincma6txrnu76whxyqgpxjybkksst57le", + "service/valory/trader/0.1.0": "bafybeifjn3zcl7ypuazhabedrupb476rbdws4avb2yzhdvfaqkx4zbt3tu", + "service/valory/trader_pearl/0.1.0": "bafybeihgdi5rxw3s42m253zzq6ye7bgf7f7kqad7qj3ap3ucz426uhnzty" }, "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 7aa90fbaf..3d4a313f2 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihbiiddv76kgjt2sgiv7qapih5bnz3clamjddmotxn4u6ay223voq +- valory/market_maker:0.1.0:bafybeidlivzxbpnxajfmgszioihi7yvv4xrhdu7uz3e6gqp67ugws5dx4i - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeibj73lyygkdgejbh35lpdt2lm65scneujktx7hgisfwxinu5ehm4e +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigvv6xlnoyfv6shqrtlkubvx67bewrs4whyqqgkshse2ftdktjnjq - valory/market_manager_abci:0.1.0:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka -- valory/decision_maker_abci:0.1.0:bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa -- valory/trader_abci:0.1.0:bafybeidvruc4d7mww6g5wwjg2qxmn4otltgnrblmdm33aqz7gaddmuuowu +- valory/decision_maker_abci:0.1.0:bafybeiadmtn77idgii754dhbsqtnyn3heifyb4vao2enyerqv2ck572r3e +- valory/trader_abci:0.1.0:bafybeig42g4afi2d35ntrc7dkssokvsxhibduexda6kiwqrxocxy7nml3y - valory/staking_abci:0.1.0:bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4 - valory/check_stop_trading_abci:0.1.0:bafybeicsrrxjs6bup267jiek3r7eutd42ssfyjthyvxfku6qozw3xebxta - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/contracts/market_maker/contract.py b/packages/valory/contracts/market_maker/contract.py index b66d20f64..7c04fa4c1 100644 --- a/packages/valory/contracts/market_maker/contract.py +++ b/packages/valory/contracts/market_maker/contract.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # -# Copyright 2023 Valory AG +# Copyright 2023-2024 Valory AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/valory/contracts/market_maker/contract.yaml b/packages/valory/contracts/market_maker/contract.yaml index ec213a0a8..3ae5e6a2d 100644 --- a/packages/valory/contracts/market_maker/contract.yaml +++ b/packages/valory/contracts/market_maker/contract.yaml @@ -9,7 +9,7 @@ fingerprint: README.md: bafybeiegnihrovfkk5big52pl4bo6evt5toqvvmft2jgnq6ofdbhfp7xwa __init__.py: bafybeicoucixii3fv5xlpk3zfewm4ys4okidcng54bhtjxvwup7g2jcjza build/FixedProductMarketMaker.json: bafybeigim7n3f67r5czfc5wp2m7cxzxwvnhxops3n5j2zlawenan7qrrtu - contract.py: bafybeicp2tz6tk5nxd4syysvpbieizbl6ryz4ilyglrykqtuh7frlokegi + contract.py: bafybeie5koo7aidhdavivxupqmyqxashzxmwzdkurscolpuwomdezk4dzi fingerprint_ignore_patterns: [] contracts: [] class_name: FixedProductMarketMakerContract diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 06b7c24cb..35ad1488c 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:bafybeieoqnkdrwpjlysrgavjk44f43jwm6tbwomk35uojumohfgnqcjqw4 +agent: valory/trader:0.1.0:bafybeiawqhr67yxzokq5c23hwincma6txrnu76whxyqgpxjybkksst57le 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 d12d53f20..8b8eb3ce9 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:bafybeieoqnkdrwpjlysrgavjk44f43jwm6tbwomk35uojumohfgnqcjqw4 +agent: valory/trader:0.1.0:bafybeiawqhr67yxzokq5c23hwincma6txrnu76whxyqgpxjybkksst57le 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 a91df33af..5eaa70495 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -25,7 +25,7 @@ fingerprint: behaviours/reedem.py: bafybeiaxwp4lx62owcaqfp6xcqh6567f5yvwnl4rage2f5hmq4nltkzjjy behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeiekxzublnsvgjb2y2uvtye4zkethvmsxh4itonnwmb3sbviyyhsgq - behaviours/sell_outcome_token.py: bafybeiht5a5ifzwewbethqhmdjbwywywrc7vc7u4ka7gndiw4r5737qbzq + behaviours/sell_outcome_token.py: bafybeihvmtnna6nzjg3y3a2pfbdn6gstjmxja5pwwrvi4i47dpvtwfztvu behaviours/storage_manager.py: bafybeif7mrnmhrarndx225e26jseuieosdja4jnlewnv2mtxqdydevxuze behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -33,7 +33,7 @@ fingerprint: handlers.py: bafybeigod6gbjrxy4mbmulbzsbokeaoycoqys64vqtxnumishfukzf73za io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa - models.py: bafybeicpwbvlrj4ag3kcbhjtp6ojvy4g5ggh7zjw47iwilmmhye72lt3fy + models.py: bafybeid4dzbe5bfo76msdh6az4a7um4ixo4kzgh7ynryl7aqhubk43tglu payloads.py: bafybeicloiy4ax7dlipwp4czlueflgjgtlev4a6vhn2m7ztoehnemiiko4 policy.py: bafybeihcltocxg7zsmvjtx44ilal4zir4fz2rupgmhacktzv5neb2lmas4 redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm @@ -52,6 +52,7 @@ fingerprint: states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe states/sampling.py: bafybeihriyyskmlupjiwytx2pdpftms7plkjku5bip64c3ztx7oi3n43ci + states/sell_outcome_token.py: bafybeifxzswza6sdk6cx6ccsdseynfmaupn2dnk3vt5dtbyklameaxyn7u states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -70,7 +71,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeihbiiddv76kgjt2sgiv7qapih5bnz3clamjddmotxn4u6ay223voq +- valory/market_maker:0.1.0:bafybeidlivzxbpnxajfmgszioihi7yvv4xrhdu7uz3e6gqp67ugws5dx4i - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm diff --git a/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py index 98a3bc965..258b74b21 100644 --- a/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py @@ -1,3 +1,24 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2021-2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + + """This module contains the sell outcome token state of the decision-making abci app.""" from packages.valory.skills.decision_maker_abci.states.base import TxPreparationRound diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 57f79a79d..af38c206a 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:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka -- valory/decision_maker_abci:0.1.0:bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibj73lyygkdgejbh35lpdt2lm65scneujktx7hgisfwxinu5ehm4e +- valory/decision_maker_abci:0.1.0:bafybeiadmtn77idgii754dhbsqtnyn3heifyb4vao2enyerqv2ck572r3e +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigvv6xlnoyfv6shqrtlkubvx67bewrs4whyqqgkshse2ftdktjnjq - valory/staking_abci:0.1.0:bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4 - valory/check_stop_trading_abci:0.1.0:bafybeicsrrxjs6bup267jiek3r7eutd42ssfyjthyvxfku6qozw3xebxta - 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 d74faa3f1..2a9413f97 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:bafybeicwcs7rpseo5jypj55cedry75f3jxuc2hamtmjdvckvafdol5szsa +- valory/decision_maker_abci:0.1.0:bafybeiadmtn77idgii754dhbsqtnyn3heifyb4vao2enyerqv2ck572r3e - valory/staking_abci:0.1.0:bafybeifyqszbiccxwwfldrl6lz5dspuaxbqd5qnniyecusddwvxpfwiyr4 - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 1284dfb29701d10946a2cb8974875a3b673f5bc0 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Wed, 13 Nov 2024 10:14:09 +0000 Subject: [PATCH 05/29] 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 | 6 ++++-- packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 6201dedd8..c26ac531b 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi", + "contract/valory/market_maker/0.1.0": "bafybeidlivzxbpnxajfmgszioihi7yvv4xrhdu7uz3e6gqp67ugws5dx4i", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -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": "bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka", - "skill/valory/decision_maker_abci/0.1.0": "bafybeice4nkv4nmyr2p4znqpcuos2u4viei54p3sgqjudruqjtwczn2usa", - "skill/valory/trader_abci/0.1.0": "bafybeihz6ljwttnikdhvwfje6tdavmdt5xxnmwog62fo5daenjmu6hhdge", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibni4q5cdciv3bicxtmp6wgfs777c7yjudkgz6naamefvaa6yjyzm", + "skill/valory/decision_maker_abci/0.1.0": "bafybeif2xmy67axo6ylufrjzkl4bzofrg5v7y7g3smimp2f7vgxfbhzrau", + "skill/valory/trader_abci/0.1.0": "bafybeifdrrj3fkloqgtnsqqjzcssxfzrzotom5lew3ud4x5jkvmmqd4xki", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibhr6dlweulsdlxmvm3dld6foow26ycgc2ldlym5xkg6ijbauf5nq", "skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini", - "agent/valory/trader/0.1.0": "bafybeichpyij3s3it6dzscjf4pcwasc7ljkzocety4m2vyhbbc343rjkaq", - "service/valory/trader/0.1.0": "bafybeiealh32lmgdlfrh7eszi7ngkdkgfxebntzmbemoajercahkjx3zna", - "service/valory/trader_pearl/0.1.0": "bafybeiachyy6rgyqcu3wlupihiwjth5ciaecqenqnrk7i4moxskmvw5dn4" + "agent/valory/trader/0.1.0": "bafybeifmvz2krz6evvrgy2bxuaprc3h47inxx2qjkvae2caca24xvbby5q", + "service/valory/trader/0.1.0": "bafybeidaitvdkbojwx32whvurnovbuwckllwgv42dh35oghm2sj3wx5ldm", + "service/valory/trader_pearl/0.1.0": "bafybeigirzqyrz2jxtzstvvacf4dhh2nxp32lwdxe3je2l2g2x7z34g2qi" }, "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 54f2db60e..a9575745a 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeidlivzxbpnxajfmgszioihi7yvv4xrhdu7uz3e6gqp67ugws5dx4i - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeibni4q5cdciv3bicxtmp6wgfs777c7yjudkgz6naamefvaa6yjyzm +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibhr6dlweulsdlxmvm3dld6foow26ycgc2ldlym5xkg6ijbauf5nq - valory/market_manager_abci:0.1.0:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka -- valory/decision_maker_abci:0.1.0:bafybeice4nkv4nmyr2p4znqpcuos2u4viei54p3sgqjudruqjtwczn2usa -- valory/trader_abci:0.1.0:bafybeihz6ljwttnikdhvwfje6tdavmdt5xxnmwog62fo5daenjmu6hhdge +- valory/decision_maker_abci:0.1.0:bafybeif2xmy67axo6ylufrjzkl4bzofrg5v7y7g3smimp2f7vgxfbhzrau +- valory/trader_abci:0.1.0:bafybeifdrrj3fkloqgtnsqqjzcssxfzrzotom5lew3ud4x5jkvmmqd4xki - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini - 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 dbe15d2e1..46a41b19f 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:bafybeichpyij3s3it6dzscjf4pcwasc7ljkzocety4m2vyhbbc343rjkaq +agent: valory/trader:0.1.0:bafybeifmvz2krz6evvrgy2bxuaprc3h47inxx2qjkvae2caca24xvbby5q 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 65d4b10d6..4faa52ca4 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:bafybeichpyij3s3it6dzscjf4pcwasc7ljkzocety4m2vyhbbc343rjkaq +agent: valory/trader:0.1.0:bafybeifmvz2krz6evvrgy2bxuaprc3h47inxx2qjkvae2caca24xvbby5q 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 dc0952275..9c3e55331 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -25,6 +25,7 @@ fingerprint: behaviours/reedem.py: bafybeiaxwp4lx62owcaqfp6xcqh6567f5yvwnl4rage2f5hmq4nltkzjjy behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeiekxzublnsvgjb2y2uvtye4zkethvmsxh4itonnwmb3sbviyyhsgq + behaviours/sell_outcome_token.py: bafybeihvmtnna6nzjg3y3a2pfbdn6gstjmxja5pwwrvi4i47dpvtwfztvu behaviours/storage_manager.py: bafybeic7c23rtp3dvgstcusmyxkcm22bpf2bfydljiam2nf55tleym5j3u behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -32,7 +33,7 @@ fingerprint: handlers.py: bafybeigod6gbjrxy4mbmulbzsbokeaoycoqys64vqtxnumishfukzf73za io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa - models.py: bafybeicpwbvlrj4ag3kcbhjtp6ojvy4g5ggh7zjw47iwilmmhye72lt3fy + models.py: bafybeid4dzbe5bfo76msdh6az4a7um4ixo4kzgh7ynryl7aqhubk43tglu payloads.py: bafybeicloiy4ax7dlipwp4czlueflgjgtlev4a6vhn2m7ztoehnemiiko4 policy.py: bafybeihcltocxg7zsmvjtx44ilal4zir4fz2rupgmhacktzv5neb2lmas4 redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm @@ -51,6 +52,7 @@ fingerprint: states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe states/sampling.py: bafybeihriyyskmlupjiwytx2pdpftms7plkjku5bip64c3ztx7oi3n43ci + states/sell_outcome_token.py: bafybeifxzswza6sdk6cx6ccsdseynfmaupn2dnk3vt5dtbyklameaxyn7u states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -69,7 +71,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeidlivzxbpnxajfmgszioihi7yvv4xrhdu7uz3e6gqp67ugws5dx4i - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 565ce6220..9a5fb14e4 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:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka -- valory/decision_maker_abci:0.1.0:bafybeice4nkv4nmyr2p4znqpcuos2u4viei54p3sgqjudruqjtwczn2usa -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibni4q5cdciv3bicxtmp6wgfs777c7yjudkgz6naamefvaa6yjyzm +- valory/decision_maker_abci:0.1.0:bafybeif2xmy67axo6ylufrjzkl4bzofrg5v7y7g3smimp2f7vgxfbhzrau +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibhr6dlweulsdlxmvm3dld6foow26ycgc2ldlym5xkg6ijbauf5nq - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini - 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 3d631a293..4e9b265e9 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:bafybeice4nkv4nmyr2p4znqpcuos2u4viei54p3sgqjudruqjtwczn2usa +- valory/decision_maker_abci:0.1.0:bafybeif2xmy67axo6ylufrjzkl4bzofrg5v7y7g3smimp2f7vgxfbhzrau - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 7cf09973c51a288e6728d221721b953b7a594229 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 15 Nov 2024 12:33:10 +0000 Subject: [PATCH 06/29] make requested changes --- packages/valory/contracts/market_maker/contract.py | 2 +- .../decision_maker_abci/behaviours/sell_outcome_token.py | 4 ++-- packages/valory/skills/decision_maker_abci/models.py | 1 - packages/valory/skills/decision_maker_abci/states/base.py | 7 +++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/valory/contracts/market_maker/contract.py b/packages/valory/contracts/market_maker/contract.py index 7c04fa4c1..77bf78a6d 100644 --- a/packages/valory/contracts/market_maker/contract.py +++ b/packages/valory/contracts/market_maker/contract.py @@ -182,5 +182,5 @@ def get_sell_data( "sell", returnAmount=return_amount, outcomeIndex=outcome_index, - outcomeTokenSellAmount=max_outcome_tokens_to_sell, + maxOutcomeTokenSellAmount=max_outcome_tokens_to_sell, ) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index fedcb8cca..199329ae6 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # -# Copyright 2021-2024 Valory AG +# Copyright 2024 Valory AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ def outcome_index(self) -> int: @property def current_condition_id(self) -> PublicId: """Get the current condition id.""" - return self.shared_state.current_condition_id + return self.synchronized_data.current_condition_id def check_outcome_token_balance(self) -> WaitableConditionType: """Check the safe's balance for a particular outcome token.""" diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 581e4e3e3..9db79257b 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -216,7 +216,6 @@ def __init__(self, *args: Any, skill_context: SkillContext, **kwargs: Any) -> No self.liquidity_prices: Dict[str, List[float]] = {} # whether this is the last run of the benchmarking mode self.last_benchmarking_has_run: bool = False - self.current_condition_id: Optional[PublicId] = None @property def mock_question_id(self) -> Any: diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 320457259..420736143 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -23,6 +23,8 @@ from enum import Enum from typing import Dict, List, Optional, Set, Tuple, cast +from hexbytes import HexBytes + from packages.valory.skills.abstract_round_abci.base import ( BaseSynchronizedData, CollectSameUntilThresholdRound, @@ -230,6 +232,11 @@ def mech_responses(self) -> List[MechInteractionResponse]: responses = json.loads(serialized) return [MechInteractionResponse(**response_item) for response_item in responses] + @property + def current_condition_id(self) -> HexBytes: + """Get the current condition id.""" + return HexBytes(self.db.get_strict("current_condition_id")) + class TxPreparationRound(CollectSameUntilThresholdRound): """A round for preparing a transaction.""" From 104de4ff652ae6991f316483ea53180c2e446a5e Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 22 Nov 2024 13:19:06 +0000 Subject: [PATCH 07/29] make suggested changes --- .../decision_maker_abci/behaviours/base.py | 30 +++++++++ .../behaviours/bet_placement.py | 28 ++------ .../decision_maker_abci/behaviours/reedem.py | 2 +- .../behaviours/sell_outcome_token.py | 65 ++++--------------- .../skills/decision_maker_abci/models.py | 1 - .../skills/decision_maker_abci/states/base.py | 7 -- .../valory/skills/market_manager_abci/bets.py | 2 +- 7 files changed, 48 insertions(+), 87 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/base.py b/packages/valory/skills/decision_maker_abci/behaviours/base.py index 7ddf268cc..3ff8667ef 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/base.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/base.py @@ -29,6 +29,7 @@ from aea.configurations.data_types import PublicId from aea.protocols.base import Message from aea.protocols.dialogue.base import Dialogue +from hexbytes import HexBytes from packages.valory.contracts.erc20.contract import ERC20 from packages.valory.contracts.gnosis_safe.contract import ( @@ -707,6 +708,35 @@ def finish_behaviour(self, payload: BaseTxPayload) -> Generator: self.set_done() + def build_approval_tx( + self, amount: int, market_maker_contract_address: str, to_address: str + ) -> WaitableConditionType: + """Build an ERC20 approve transaction.""" + response_msg = yield from self.get_contract_api_response( + performative=ContractApiMessage.Performative.GET_STATE, # type: ignore + contract_address=self.collateral_token, + contract_id=str(ERC20.contract_id), + contract_callable="build_approval_tx", + spender=market_maker_contract_address, + amount=amount, + ) + + if response_msg.performative != ContractApiMessage.Performative.STATE: + self.context.logger.info(f"Could not build approval tx: {response_msg}") + return False + + approval_data = response_msg.state.body.get("data") + if approval_data is None: + self.context.logger.info(f"Could not build approval tx: {response_msg}") + return False + + batch = MultisendBatch( + to=to_address, + data=HexBytes(approval_data), + ) + self.multisend_batches.append(batch) + return True + class BaseSubscriptionBehaviour(DecisionMakerBaseBehaviour, ABC): """Base class for subscription behaviours.""" 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 efcd346a0..8fa3052a8 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py @@ -99,30 +99,12 @@ def _build_exchange_tx(self) -> WaitableConditionType: def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" - response_msg = yield from self.get_contract_api_response( - performative=ContractApiMessage.Performative.GET_STATE, # type: ignore - contract_address=self.collateral_token, - contract_id=str(ERC20.contract_id), - contract_callable="build_approval_tx", - spender=self.market_maker_contract_address, - amount=self.investment_amount, + approval_tx = yield from self.build_approval_tx( + self.investment_amount, + self.market_maker_contract_address, + self.collateral_token, ) - - if response_msg.performative != ContractApiMessage.Performative.STATE: - self.context.logger.info(f"Could not build approval tx: {response_msg}") - return False - - approval_data = response_msg.state.body.get("data") - if approval_data is None: - self.context.logger.info(f"Could not build approval tx: {response_msg}") - return False - - batch = MultisendBatch( - to=self.collateral_token, - data=HexBytes(approval_data), - ) - self.multisend_batches.append(batch) - return True + return approval_tx def _calc_buy_amount(self) -> WaitableConditionType: """Calculate the buy amount of the conditional token.""" diff --git a/packages/valory/skills/decision_maker_abci/behaviours/reedem.py b/packages/valory/skills/decision_maker_abci/behaviours/reedem.py index 4419fb0e6..e1a192b26 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/reedem.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/reedem.py @@ -52,10 +52,10 @@ FPMM, Trade, ) -from packages.valory.skills.decision_maker_abci.states.redeem import RedeemRound from packages.valory.skills.decision_maker_abci.states.bet_placement import ( BetPlacementRound, ) +from packages.valory.skills.decision_maker_abci.states.redeem import RedeemRound from packages.valory.skills.market_manager_abci.graph_tooling.requests import ( FetchStatus, MAX_LOG_SIZE, diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index 199329ae6..b55e88752 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -22,13 +22,8 @@ """This module contains the behaviour for selling a token.""" from typing import Any, Generator, Optional, cast -from aea.configurations.data_types import PublicId from hexbytes import HexBytes -from packages.valory.contracts.conditional_tokens.contract import ( - ConditionalTokensContract, -) -from packages.valory.contracts.erc20.contract import ERC20 from packages.valory.contracts.market_maker.contract import ( FixedProductMarketMakerContract, ) @@ -36,7 +31,6 @@ from packages.valory.skills.decision_maker_abci.behaviours.base import ( DecisionMakerBaseBehaviour, WaitableConditionType, - remove_fraction_wei, ) from packages.valory.skills.decision_maker_abci.models import MultisendBatch from packages.valory.skills.decision_maker_abci.payloads import MultisigTxPayload @@ -53,9 +47,8 @@ class SellTokenBehaviour(DecisionMakerBaseBehaviour): def __init__(self, **kwargs: Any) -> None: """Initialize the sell token behaviour.""" super().__init__(**kwargs) - self.sell_amount = 0 - self.outcome_token_balance = 0 - self.return_amount = 0 + self.sell_amount: float = 0.0 + self.return_amount: int = 0 @property def market_maker_contract_address(self) -> str: @@ -67,51 +60,14 @@ def outcome_index(self) -> int: """Get the index of the outcome for which the service is going to sell token.""" return cast(int, self.synchronized_data.vote) - @property - def current_condition_id(self) -> PublicId: - """Get the current condition id.""" - return self.synchronized_data.current_condition_id - - def check_outcome_token_balance(self) -> WaitableConditionType: - """Check the safe's balance for a particular outcome token.""" - response_msg = yield from self.contract_interact( - performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore - contract_address=self.params.conditional_tokens_address, - contract_public_id=ConditionalTokensContract.contract_id, - contract_callable="balanceOf", - data_key="data", - placeholder="outcome_token_balance", - id=self.current_condition_id, - owner=self.synchronized_data.safe_contract_address, - ) - return response_msg - def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" - response_msg = yield from self.get_contract_api_response( - performative=ContractApiMessage.Performative.GET_STATE, # type: ignore - contract_address=self.collateral_token, - contract_id=str(ERC20.contract_id), - contract_callable="build_approval_tx", - spender=self.market_maker_contract_address, - amount=self.return_amount, + approval_tx = yield from self.build_approval_tx( + self.return_amount, + self.market_maker_contract_address, + self.market_maker_contract_address, ) - - if response_msg.performative != ContractApiMessage.Performative.STATE: - self.context.logger.info(f"Could not build approval tx: {response_msg}") - return False - - approval_data = response_msg.state.body.get("data") - if approval_data is None: - self.context.logger.info(f"Could not build approval tx: {response_msg}") - return False - - batch = MultisendBatch( - to=self.market_maker_contract_address, - data=HexBytes(approval_data), - ) - self.multisend_batches.append(batch) - return True + return approval_tx def _calc_sell_amount(self) -> WaitableConditionType: """Calculate the sell amount of the conditional token.""" @@ -138,8 +94,7 @@ def _calc_sell_amount(self) -> WaitableConditionType: ) return False - # TODO: not sure this is the correct use of remove_fraction_wei, is sell amount in wxDAI? - self.sell_amount = remove_fraction_wei(sell_amount, self.params.slippage) + self.sell_amount = sell_amount return True def _build_sell_tx(self) -> WaitableConditionType: @@ -202,7 +157,9 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).local(): tx_submitter = betting_tx_hex = mocking_mode = None - self.return_amount = yield from self.check_outcome_token_balance() + self.return_amount = self.bets[ + self.synchronized_data.sampled_bet_index + ].invested_amount if self.is_wxdai: tx_submitter = self.matching_round.auto_round_id() diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 27b04c4de..7b6b3a7c0 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -37,7 +37,6 @@ Union, ) -from aea.configurations.data_types import PublicId from aea.skills.base import Model, SkillContext from hexbytes import HexBytes from web3.constants import HASH_ZERO diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 420736143..320457259 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -23,8 +23,6 @@ from enum import Enum from typing import Dict, List, Optional, Set, Tuple, cast -from hexbytes import HexBytes - from packages.valory.skills.abstract_round_abci.base import ( BaseSynchronizedData, CollectSameUntilThresholdRound, @@ -232,11 +230,6 @@ def mech_responses(self) -> List[MechInteractionResponse]: responses = json.loads(serialized) return [MechInteractionResponse(**response_item) for response_item in responses] - @property - def current_condition_id(self) -> HexBytes: - """Get the current condition id.""" - return HexBytes(self.db.get_strict("current_condition_id")) - class TxPreparationRound(CollectSameUntilThresholdRound): """A round for preparing a transaction.""" diff --git a/packages/valory/skills/market_manager_abci/bets.py b/packages/valory/skills/market_manager_abci/bets.py index 57eb87178..36f2c30b4 100644 --- a/packages/valory/skills/market_manager_abci/bets.py +++ b/packages/valory/skills/market_manager_abci/bets.py @@ -95,7 +95,7 @@ class Bet: prediction_response: PredictionResponse = dataclasses.field( default_factory=get_default_prediction_response ) - invested_amount: float = 0.0 + invested_amount: int = 0 position_liquidity: int = 0 potential_net_profit: int = 0 processed_timestamp: int = 0 From e35ce115e464033cc4b0077f8ec1f2d418ba4c2a Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 22 Nov 2024 13:19:53 +0000 Subject: [PATCH 08/29] chore: generators --- packages/packages.json | 16 ++++++++-------- packages/valory/agents/trader/aea-config.yaml | 10 +++++----- .../valory/contracts/market_maker/contract.yaml | 2 +- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 14 ++++++++------ .../valory/skills/market_manager_abci/skill.yaml | 4 ++-- packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 30 insertions(+), 28 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 287c3e9e8..7683fa5e3 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi", + "contract/valory/market_maker/0.1.0": "bafybeie5swan5s45t3upda67meoes3zntra5hlaf7r3obhd6vq47vipzry", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -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": "bafybeicngtrfoad3yqbrdslmgngpfiqipqac5t4jv3rc22yyboiimp7kjq", - "skill/valory/trader_abci/0.1.0": "bafybeie57hhm6j5jfo43oq4hu2zfrteqh67zb4eatqyvrinsbc4qg4v2ma", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibevivb6pfty5ghtzjwwn2sgnn4ij263wbiziv373yfd5m4cyotpq", + "skill/valory/market_manager_abci/0.1.0": "bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u", + "skill/valory/trader_abci/0.1.0": "bafybeiawj4aqokvzlj772h7pommq32pzhwz334jzrztjctvvivb6xp3tci", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeifkjn47evldbefqsmet6p4fkx3cdppwh6sab5hyrly4i52nqsbcuu", "skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini", - "agent/valory/trader/0.1.0": "bafybeicc6jkakg6dhvqpb6esidgnffl5ses2bnk67eqs3falrkbw4aa47q", - "service/valory/trader/0.1.0": "bafybeih6cbruabwq5z2jl22pcrhzamzw4pz5yhvld4nmee3k7jkjvhmohu", - "service/valory/trader_pearl/0.1.0": "bafybeibvcu6rnngqw4i6mzqukwwn4gxc2v7hn6cydyha6ouqeyen54vcla" + "agent/valory/trader/0.1.0": "bafybeic3cyecmkkowdco4esmo6tgtxbltqunmznnsgs2bp3qjkqb3xxgg4", + "service/valory/trader/0.1.0": "bafybeiaf3ambpy7lnweecx77awgv24xn3ozsgj74ldo4ftaqz4licfplha", + "service/valory/trader_pearl/0.1.0": "bafybeihoafwfy45c6iswpeynh2spzi6p5jbvgrjnospnqdw3g2rykucpty" }, "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 e614375c4..f663c802d 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeie5swan5s45t3upda67meoes3zntra5hlaf7r3obhd6vq47vipzry - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeibevivb6pfty5ghtzjwwn2sgnn4ij263wbiziv373yfd5m4cyotpq -- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa -- valory/decision_maker_abci:0.1.0:bafybeicngtrfoad3yqbrdslmgngpfiqipqac5t4jv3rc22yyboiimp7kjq -- valory/trader_abci:0.1.0:bafybeie57hhm6j5jfo43oq4hu2zfrteqh67zb4eatqyvrinsbc4qg4v2ma +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifkjn47evldbefqsmet6p4fkx3cdppwh6sab5hyrly4i52nqsbcuu +- valory/market_manager_abci:0.1.0:bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue +- valory/decision_maker_abci:0.1.0:bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u +- valory/trader_abci:0.1.0:bafybeiawj4aqokvzlj772h7pommq32pzhwz334jzrztjctvvivb6xp3tci - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/contracts/market_maker/contract.yaml b/packages/valory/contracts/market_maker/contract.yaml index 3ae5e6a2d..8136c5687 100644 --- a/packages/valory/contracts/market_maker/contract.yaml +++ b/packages/valory/contracts/market_maker/contract.yaml @@ -9,7 +9,7 @@ fingerprint: README.md: bafybeiegnihrovfkk5big52pl4bo6evt5toqvvmft2jgnq6ofdbhfp7xwa __init__.py: bafybeicoucixii3fv5xlpk3zfewm4ys4okidcng54bhtjxvwup7g2jcjza build/FixedProductMarketMaker.json: bafybeigim7n3f67r5czfc5wp2m7cxzxwvnhxops3n5j2zlawenan7qrrtu - contract.py: bafybeie5koo7aidhdavivxupqmyqxashzxmwzdkurscolpuwomdezk4dzi + contract.py: bafybeibgyuzsekmwhvapgoqv5lery2qignnzl4zm3en3sohzboc6t7axzy fingerprint_ignore_patterns: [] contracts: [] class_name: FixedProductMarketMakerContract diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 8473fa8e7..c4919a27c 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:bafybeicc6jkakg6dhvqpb6esidgnffl5ses2bnk67eqs3falrkbw4aa47q +agent: valory/trader:0.1.0:bafybeic3cyecmkkowdco4esmo6tgtxbltqunmznnsgs2bp3qjkqb3xxgg4 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 c920a0a81..174cac253 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:bafybeicc6jkakg6dhvqpb6esidgnffl5ses2bnk67eqs3falrkbw4aa47q +agent: valory/trader:0.1.0:bafybeic3cyecmkkowdco4esmo6tgtxbltqunmznnsgs2bp3qjkqb3xxgg4 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 060d4fa0f..c5fe9cb2d 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -12,8 +12,8 @@ fingerprint: README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky - behaviours/base.py: bafybeidjmsljdaw7y5chzzkub63mzf5ydpauch5ugojds5jwpeyvovkq3y - behaviours/bet_placement.py: bafybeihmia64t2payxfqcnfdqg675ui2yp3hnyfwb2xhj2hn7wl237b4re + behaviours/base.py: bafybeiateqzhdmun5zjxp3obov2tm3au3kqhdak66w2hu4sa452nw2gvte + behaviours/bet_placement.py: bafybeibwohp7i4jj3vlcyomh43hq4alegmygxmokymduisrd4uz2745uga behaviours/blacklisting.py: bafybeicqwj7o4l7qcym5xjqwq45jngqkhyf44mn6qise2ysyfnlnwz7pdy behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e @@ -22,9 +22,10 @@ fingerprint: behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm behaviours/order_subscription.py: bafybeicrmdvhci5prfldvuf3bclbbqi6j7lpv6hmphw3qwgmkmwat3od44 behaviours/randomness.py: bafybeiaoj3awyyg2onhpsdsn3dyczs23gr4smuzqcbw3e5ocljwxswjkce - behaviours/reedem.py: bafybeiaxwp4lx62owcaqfp6xcqh6567f5yvwnl4rage2f5hmq4nltkzjjy + behaviours/reedem.py: bafybeiebc5fe7yg6i5pqcfzrcoen2jcmbjn4vcpbnq6ki5he3qtyrmrjbi behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i - behaviours/sampling.py: bafybeie6ab5pdwal5glhg75am2637lijz5kwqx4ctk2lgqjyllmnw335ca + behaviours/sampling.py: bafybeiaitm6ry2dvdlldk73jwzf6yotlymaj7b4l6acbigrljfocmkl2ne + behaviours/sell_outcome_token.py: bafybeidzlqvmwfctsppli6awcl5utj3fxo7brp4abq67bngspifby6xrpq behaviours/storage_manager.py: bafybeignur4cwwkdmoj33ll3pmylnddbaqd6gpn6m2n7idieyyti7m3jg4 behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -51,6 +52,7 @@ fingerprint: states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe states/sampling.py: bafybeihriyyskmlupjiwytx2pdpftms7plkjku5bip64c3ztx7oi3n43ci + states/sell_outcome_token.py: bafybeifxzswza6sdk6cx6ccsdseynfmaupn2dnk3vt5dtbyklameaxyn7u states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -85,7 +87,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeie5swan5s45t3upda67meoes3zntra5hlaf7r3obhd6vq47vipzry - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm @@ -101,7 +103,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:bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 44e6f05ad..e451b64bb 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -8,8 +8,8 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e - behaviours.py: bafybeifzt6vykvvgr5rtzmzdbo7bfsxi765xsljdfrktrq35ogf6cdhmna - bets.py: bafybeif25efeykh4lcw36dxzb35bcoaqtays6o2pmtqhgxske3mf2lkku4 + behaviours.py: bafybeihj5zfo7dlhz2sv7izjeabd7pmdv73anriufhbaq7jtftng6ftaie + bets.py: bafybeictkbg2jelzcc22d3pg46af52dnadmacdjgfxpspqkl4olngjt5fq dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q graph_tooling/__init__.py: bafybeigzo7nhbzafyq3fuhrlewksjvmzttiuk4vonrggtjtph4rw4ncpk4 diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 06fa45387..c3f6fdfd5 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:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa -- valory/decision_maker_abci:0.1.0:bafybeicngtrfoad3yqbrdslmgngpfiqipqac5t4jv3rc22yyboiimp7kjq -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibevivb6pfty5ghtzjwwn2sgnn4ij263wbiziv373yfd5m4cyotpq +- valory/market_manager_abci:0.1.0:bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue +- valory/decision_maker_abci:0.1.0:bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifkjn47evldbefqsmet6p4fkx3cdppwh6sab5hyrly4i52nqsbcuu - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini - 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 1c410677d..13b0cdc12 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:bafybeicngtrfoad3yqbrdslmgngpfiqipqac5t4jv3rc22yyboiimp7kjq +- valory/decision_maker_abci:0.1.0:bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 17116257391865ee0f663c900247a29d00bc159f Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 22 Nov 2024 13:28:10 +0000 Subject: [PATCH 09/29] fix: change copyright date --- packages/valory/contracts/market_maker/contract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/valory/contracts/market_maker/contract.py b/packages/valory/contracts/market_maker/contract.py index 77bf78a6d..e77c282ca 100644 --- a/packages/valory/contracts/market_maker/contract.py +++ b/packages/valory/contracts/market_maker/contract.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # -# Copyright 2023-2024 Valory AG +# Copyright 2024 Valory AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 502897e9579dee4cb415b1cdf34986ec7665e76e Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 22 Nov 2024 13:28:42 +0000 Subject: [PATCH 10/29] chore: generators --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- .../valory/contracts/market_maker/contract.yaml | 2 +- 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 ++-- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 7683fa5e3..5f7b83fb4 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeie5swan5s45t3upda67meoes3zntra5hlaf7r3obhd6vq47vipzry", + "contract/valory/market_maker/0.1.0": "bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -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": "bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue", - "skill/valory/decision_maker_abci/0.1.0": "bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u", - "skill/valory/trader_abci/0.1.0": "bafybeiawj4aqokvzlj772h7pommq32pzhwz334jzrztjctvvivb6xp3tci", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeifkjn47evldbefqsmet6p4fkx3cdppwh6sab5hyrly4i52nqsbcuu", + "skill/valory/decision_maker_abci/0.1.0": "bafybeihqloxrcbycu2rwrjhp72le36nn35kblfpnioiltk4ou3iliqrmra", + "skill/valory/trader_abci/0.1.0": "bafybeihncubt5lww7g3n5ibuqlf5iy6pigwwmp5uyyphwfckqi62gnheye", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiemzw7pcbbvctkphd3p5peai5fj7uw7hmkuytrgycyhhjwmdrh6ye", "skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini", - "agent/valory/trader/0.1.0": "bafybeic3cyecmkkowdco4esmo6tgtxbltqunmznnsgs2bp3qjkqb3xxgg4", - "service/valory/trader/0.1.0": "bafybeiaf3ambpy7lnweecx77awgv24xn3ozsgj74ldo4ftaqz4licfplha", - "service/valory/trader_pearl/0.1.0": "bafybeihoafwfy45c6iswpeynh2spzi6p5jbvgrjnospnqdw3g2rykucpty" + "agent/valory/trader/0.1.0": "bafybeif6stqxcxbtvb3odyvfxmq5qluvvzafag7dse3jtxo7767xgmsbnq", + "service/valory/trader/0.1.0": "bafybeid6fd5ihl3k3bctcyvhxvezxlibqfdwmyxflyfw2dlqbpg46tcjwq", + "service/valory/trader_pearl/0.1.0": "bafybeids5avccenbirji5kdhqje52makphrmax5rxfmeielbgtmi34adx4" }, "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 f663c802d..756eccf16 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeie5swan5s45t3upda67meoes3zntra5hlaf7r3obhd6vq47vipzry +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeifkjn47evldbefqsmet6p4fkx3cdppwh6sab5hyrly4i52nqsbcuu +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiemzw7pcbbvctkphd3p5peai5fj7uw7hmkuytrgycyhhjwmdrh6ye - valory/market_manager_abci:0.1.0:bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue -- valory/decision_maker_abci:0.1.0:bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u -- valory/trader_abci:0.1.0:bafybeiawj4aqokvzlj772h7pommq32pzhwz334jzrztjctvvivb6xp3tci +- valory/decision_maker_abci:0.1.0:bafybeihqloxrcbycu2rwrjhp72le36nn35kblfpnioiltk4ou3iliqrmra +- valory/trader_abci:0.1.0:bafybeihncubt5lww7g3n5ibuqlf5iy6pigwwmp5uyyphwfckqi62gnheye - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/contracts/market_maker/contract.yaml b/packages/valory/contracts/market_maker/contract.yaml index 8136c5687..0065c491b 100644 --- a/packages/valory/contracts/market_maker/contract.yaml +++ b/packages/valory/contracts/market_maker/contract.yaml @@ -9,7 +9,7 @@ fingerprint: README.md: bafybeiegnihrovfkk5big52pl4bo6evt5toqvvmft2jgnq6ofdbhfp7xwa __init__.py: bafybeicoucixii3fv5xlpk3zfewm4ys4okidcng54bhtjxvwup7g2jcjza build/FixedProductMarketMaker.json: bafybeigim7n3f67r5czfc5wp2m7cxzxwvnhxops3n5j2zlawenan7qrrtu - contract.py: bafybeibgyuzsekmwhvapgoqv5lery2qignnzl4zm3en3sohzboc6t7axzy + contract.py: bafybeifcopgnnts3dbfh636vvdsgporlkt2olwr2iwuwaom5vjcrtbe5wi fingerprint_ignore_patterns: [] contracts: [] class_name: FixedProductMarketMakerContract diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index c4919a27c..881023ca3 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:bafybeic3cyecmkkowdco4esmo6tgtxbltqunmznnsgs2bp3qjkqb3xxgg4 +agent: valory/trader:0.1.0:bafybeif6stqxcxbtvb3odyvfxmq5qluvvzafag7dse3jtxo7767xgmsbnq 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 174cac253..1830ca122 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:bafybeic3cyecmkkowdco4esmo6tgtxbltqunmznnsgs2bp3qjkqb3xxgg4 +agent: valory/trader:0.1.0:bafybeif6stqxcxbtvb3odyvfxmq5qluvvzafag7dse3jtxo7767xgmsbnq 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 c5fe9cb2d..0bb8f9279 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -87,7 +87,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeie5swan5s45t3upda67meoes3zntra5hlaf7r3obhd6vq47vipzry +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index c3f6fdfd5..6a87ea588 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:bafybeieyx6tyvxxpzygm7zhxh3c5g2m7dgpnaid7xp5oivd5yjcteptwue -- valory/decision_maker_abci:0.1.0:bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifkjn47evldbefqsmet6p4fkx3cdppwh6sab5hyrly4i52nqsbcuu +- valory/decision_maker_abci:0.1.0:bafybeihqloxrcbycu2rwrjhp72le36nn35kblfpnioiltk4ou3iliqrmra +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiemzw7pcbbvctkphd3p5peai5fj7uw7hmkuytrgycyhhjwmdrh6ye - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini - 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 13b0cdc12..18489f7ef 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:bafybeiaf6ojv3f5i3utwhzpt7yvqkpcyp4r6g3mvnzxctuz62tsn3yro5u +- valory/decision_maker_abci:0.1.0:bafybeihqloxrcbycu2rwrjhp72le36nn35kblfpnioiltk4ou3iliqrmra - valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 445998e7a3240eae2a082a5caf5abca5dc39414f Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 5 Dec 2024 12:49:54 +0000 Subject: [PATCH 11/29] add: previous_vote and sell logic --- .../decision_maker_abci/behaviours/sell_outcome_token.py | 9 +++++++++ .../valory/skills/decision_maker_abci/states/base.py | 6 ++++++ .../decision_maker_abci/states/decision_receive.py | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index b55e88752..6b2920306 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -157,6 +157,15 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).local(): tx_submitter = betting_tx_hex = mocking_mode = None + # if the vote is the same as the previous vote then there is no change in the supported outcome, so we + # should not sell + if self.synchronized_data.vote == self.synchronized_data.previous_vote: + payload = MultisigTxPayload( + agent, tx_submitter, betting_tx_hex, mocking_mode + ) + + yield from self.finish_behaviour(payload) + self.return_amount = self.bets[ self.synchronized_data.sampled_bet_index ].invested_amount diff --git a/packages/valory/skills/decision_maker_abci/states/base.py b/packages/valory/skills/decision_maker_abci/states/base.py index 33bdc4638..70a2641b2 100644 --- a/packages/valory/skills/decision_maker_abci/states/base.py +++ b/packages/valory/skills/decision_maker_abci/states/base.py @@ -152,6 +152,12 @@ def vote(self) -> Optional[int]: vote = self.db.get_strict("vote") return int(vote) if vote is not None else None + @property + def previous_vote(self) -> Optional[int]: + """Get the bet's previous vote index.""" + previous_vote = self.db.get_strict("previous_vote") + return int(previous_vote) if previous_vote is not None else None + @property def confidence(self) -> float: """Get the vote's confidence.""" 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..2d5486342 100644 --- a/packages/valory/skills/decision_maker_abci/states/decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/states/decision_receive.py @@ -54,6 +54,12 @@ class DecisionReceiveRound(CollectSameUntilThresholdRound): def end_block(self) -> Optional[Tuple[SynchronizedData, Enum]]: """Process the end of the block.""" + + # update the previous vote before calling the super method + SynchronizedData.update( + previous_vote=SynchronizedData.vote + ) + res = super().end_block() if res is None: return None From fe78d74d18abb52dfb7afd59b079fe294120bf41 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 5 Dec 2024 15:33:14 +0000 Subject: [PATCH 12/29] add: initial fsm changes to include sell outcome token round --- .../states/decision_receive.py | 5 --- .../skills/trader_abci/fsm_specification.yaml | 11 +++++- .../fsm_specification.yaml | 10 ++++- .../tx_settlement_multiplexer_abci/rounds.py | 37 ++++++++++++++++--- 4 files changed, 49 insertions(+), 14 deletions(-) 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 2d5486342..a82555cc2 100644 --- a/packages/valory/skills/decision_maker_abci/states/decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/states/decision_receive.py @@ -55,11 +55,6 @@ class DecisionReceiveRound(CollectSameUntilThresholdRound): def end_block(self) -> Optional[Tuple[SynchronizedData, Enum]]: """Process the end of the block.""" - # update the previous vote before calling the super method - SynchronizedData.update( - previous_vote=SynchronizedData.vote - ) - res = super().end_block() if res is None: return None diff --git a/packages/valory/skills/trader_abci/fsm_specification.yaml b/packages/valory/skills/trader_abci/fsm_specification.yaml index f00240b02..cff5e3a38 100644 --- a/packages/valory/skills/trader_abci/fsm_specification.yaml +++ b/packages/valory/skills/trader_abci/fsm_specification.yaml @@ -2,7 +2,8 @@ alphabet_in: - BENCHMARKING_DISABLED - BENCHMARKING_ENABLED - BENCHMARKING_FINISHED -- BET_PLACEMENT_DONE +- BET_PLACEMENT_NO_SELL_DONE +- BET_PLACEMENT_SELL_DONE - BLACKLIST - CHECKS_PASSED - CHECK_HISTORY @@ -87,6 +88,7 @@ states: - SelectKeeperTransactionSubmissionARound - SelectKeeperTransactionSubmissionBAfterTimeoutRound - SelectKeeperTransactionSubmissionBRound +- SellOutcomeTokenRound - ServiceEvictedRound - SubscriptionRound - SynchronizeLateMessagesRound @@ -172,10 +174,12 @@ transition_func: (MechResponseRound, DONE): DecisionReceiveRound (MechResponseRound, NO_MAJORITY): MechResponseRound (MechResponseRound, ROUND_TIMEOUT): MechResponseRound - (PostTxSettlementRound, BET_PLACEMENT_DONE): RedeemRound + (PostTxSettlementRound, BET_PLACEMENT_NO_SELL_DONE): RedeemRound + (PostTxSettlementRound, BET_PLACEMENT_SELL_DONE): SellOutcomeTokenRound (PostTxSettlementRound, MECH_REQUESTING_DONE): MechResponseRound (PostTxSettlementRound, REDEEMING_DONE): CallCheckpointRound (PostTxSettlementRound, ROUND_TIMEOUT): PostTxSettlementRound + (PostTxSettlementRound, SELL_OUTCOME_TOKEN_DONE): RedeemRound (PostTxSettlementRound, STAKING_DONE): ResetAndPauseRound (PostTxSettlementRound, SUBSCRIPTION_DONE): ClaimRound (PostTxSettlementRound, UNRECOGNIZED): FailedMultiplexerRound @@ -226,6 +230,9 @@ transition_func: (SelectKeeperTransactionSubmissionBRound, INCORRECT_SERIALIZATION): HandleFailedTxRound (SelectKeeperTransactionSubmissionBRound, NO_MAJORITY): ResetRound (SelectKeeperTransactionSubmissionBRound, ROUND_TIMEOUT): SelectKeeperTransactionSubmissionBRound + (SellOutcomeTokenRound, DONE): PreTxSettlementRound + (SellOutcomeTokenRound, NO_MAJORITY): SellOutcomeTokenRound + (SellOutcomeTokenRound, ROUND_TIMEOUT): SellOutcomeTokenRound (SubscriptionRound, DONE): PreTxSettlementRound (SubscriptionRound, MOCK_TX): ToolSelectionRound (SubscriptionRound, NONE): SubscriptionRound diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/fsm_specification.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/fsm_specification.yaml index d21d8966f..d671e1d6b 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/fsm_specification.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/fsm_specification.yaml @@ -1,11 +1,13 @@ alphabet_in: -- BET_PLACEMENT_DONE +- BET_PLACEMENT_NO_SELL_DONE +- BET_PLACEMENT_SELL_DONE - CHECKS_PASSED - MECH_REQUESTING_DONE - NO_MAJORITY - REDEEMING_DONE - REFILL_REQUIRED - ROUND_TIMEOUT +- SELL_OUTCOME_TOKEN_DONE - STAKING_DONE - SUBSCRIPTION_DONE - UNRECOGNIZED @@ -16,6 +18,7 @@ final_states: - FinishedBetPlacementTxRound - FinishedMechRequestTxRound - FinishedRedeemingTxRound +- FinishedSellOutcomeTokenTxRound - FinishedStakingTxRound - FinishedSubscriptionTxRound label: TxSettlementMultiplexerAbciApp @@ -28,15 +31,18 @@ states: - FinishedBetPlacementTxRound - FinishedMechRequestTxRound - FinishedRedeemingTxRound +- FinishedSellOutcomeTokenTxRound - FinishedStakingTxRound - FinishedSubscriptionTxRound - PostTxSettlementRound - PreTxSettlementRound transition_func: - (PostTxSettlementRound, BET_PLACEMENT_DONE): FinishedBetPlacementTxRound + (PostTxSettlementRound, BET_PLACEMENT_NO_SELL_DONE): FinishedBetPlacementTxRound + (PostTxSettlementRound, BET_PLACEMENT_SELL_DONE): FinishedBetPlacementTxRound (PostTxSettlementRound, MECH_REQUESTING_DONE): FinishedMechRequestTxRound (PostTxSettlementRound, REDEEMING_DONE): FinishedRedeemingTxRound (PostTxSettlementRound, ROUND_TIMEOUT): PostTxSettlementRound + (PostTxSettlementRound, SELL_OUTCOME_TOKEN_DONE): FinishedSellOutcomeTokenTxRound (PostTxSettlementRound, STAKING_DONE): FinishedStakingTxRound (PostTxSettlementRound, SUBSCRIPTION_DONE): FinishedSubscriptionTxRound (PostTxSettlementRound, UNRECOGNIZED): FailedMultiplexerRound diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py b/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py index cee817002..b3cc56448 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py @@ -42,6 +42,7 @@ SubscriptionRound, ) from packages.valory.skills.decision_maker_abci.states.redeem import RedeemRound +from packages.valory.skills.decision_maker_abci.states.sell_outcome_token import SellOutcomeTokenRound from packages.valory.skills.mech_interact_abci.states.request import MechRequestRound from packages.valory.skills.staking_abci.rounds import CallCheckpointRound @@ -52,8 +53,10 @@ class Event(Enum): CHECKS_PASSED = "checks_passed" REFILL_REQUIRED = "refill_required" MECH_REQUESTING_DONE = "mech_requesting_done" - BET_PLACEMENT_DONE = "bet_placement_done" + BET_PLACEMENT_NO_SELL_DONE = "bet_placement_done_no_sell" + BET_PLACEMENT_SELL_DONE = "bet_placement_done_sell" REDEEMING_DONE = "redeeming_done" + SELL_OUTCOME_TOKEN_DONE = "sell_outcome_token_done" STAKING_DONE = "staking_done" SUBSCRIPTION_DONE = "subscription_done" ROUND_TIMEOUT = "round_timeout" @@ -91,15 +94,19 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: """ submitter_to_event: Dict[str, Event] = { MechRequestRound.auto_round_id(): Event.MECH_REQUESTING_DONE, - BetPlacementRound.auto_round_id(): Event.BET_PLACEMENT_DONE, + BetPlacementRound.auto_round_id(): Event.BET_PLACEMENT_NO_SELL_DONE, RedeemRound.auto_round_id(): Event.REDEEMING_DONE, CallCheckpointRound.auto_round_id(): Event.STAKING_DONE, SubscriptionRound.auto_round_id(): Event.SUBSCRIPTION_DONE, + SellOutcomeTokenRound.auto_round_id(): Event.SELL_OUTCOME_TOKEN_DONE } synced_data = SynchronizedData(self.synchronized_data.db) event = submitter_to_event.get(synced_data.tx_submitter, Event.UNRECOGNIZED) + if synced_data.vote != synced_data.previous_vote: + event = Event.BET_PLACEMENT_SELL_DONE + # if a mech request was just performed, increase the utilized tool's counter if event == Event.MECH_REQUESTING_DONE: policy = synced_data.policy @@ -108,11 +115,22 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: self.synchronized_data.update(policy=policy_update) # if a bet was just placed, edit the utilized tools mapping - if event == Event.BET_PLACEMENT_DONE: + if event == Event.BET_PLACEMENT_NO_SELL_DONE or event == Event.BET_PLACEMENT_SELL_DONE: utilized_tools = synced_data.utilized_tools utilized_tools[synced_data.final_tx_hash] = synced_data.mech_tool tools_update = json.dumps(utilized_tools, sort_keys=True) - self.synchronized_data.update(utilized_tools=tools_update) + vote = synced_data.vote + self.synchronized_data.update( + utilized_tools=tools_update, + previous_vote=vote + ) + + # if all tokens for an outcome have been sold, set the previous vote to None as we no longer have any + # investment in that outcome + if event == Event.SELL_OUTCOME_TOKEN_DONE: + self.synchronized_data.update( + previous_vote=None + ) return synced_data, event @@ -141,6 +159,10 @@ class FinishedSubscriptionTxRound(DegenerateRound): """Finished subscription round.""" +class FinishedSellOutcomeTokenTxRound(DegenerateRound): + """Finished sell outcome token round.""" + + class FailedMultiplexerRound(DegenerateRound): """Round that represents failure in identifying the transmitter round.""" @@ -191,8 +213,10 @@ class TxSettlementMultiplexerAbciApp(AbciApp[Event]): }, PostTxSettlementRound: { Event.MECH_REQUESTING_DONE: FinishedMechRequestTxRound, - Event.BET_PLACEMENT_DONE: FinishedBetPlacementTxRound, + Event.BET_PLACEMENT_NO_SELL_DONE: FinishedBetPlacementTxRound, + Event.BET_PLACEMENT_SELL_DONE: FinishedBetPlacementTxRound, Event.REDEEMING_DONE: FinishedRedeemingTxRound, + Event.SELL_OUTCOME_TOKEN_DONE: FinishedSellOutcomeTokenTxRound, Event.STAKING_DONE: FinishedStakingTxRound, Event.SUBSCRIPTION_DONE: FinishedSubscriptionTxRound, Event.ROUND_TIMEOUT: PostTxSettlementRound, @@ -204,6 +228,7 @@ class TxSettlementMultiplexerAbciApp(AbciApp[Event]): FinishedSubscriptionTxRound: {}, FinishedRedeemingTxRound: {}, FinishedStakingTxRound: {}, + FinishedSellOutcomeTokenTxRound: {}, FailedMultiplexerRound: {}, } event_to_timeout: Dict[Event, float] = { @@ -216,6 +241,7 @@ class TxSettlementMultiplexerAbciApp(AbciApp[Event]): FinishedRedeemingTxRound, FinishedStakingTxRound, FinishedSubscriptionTxRound, + FinishedSellOutcomeTokenTxRound, FailedMultiplexerRound, } db_pre_conditions: Dict[AppState, Set[str]] = { @@ -230,4 +256,5 @@ class TxSettlementMultiplexerAbciApp(AbciApp[Event]): FinishedStakingTxRound: set(), FailedMultiplexerRound: set(), FinishedSubscriptionTxRound: set(), + FinishedSellOutcomeTokenTxRound: set(), } From 3fd007fa052d986b32b0300af03ce21f657374d0 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Thu, 5 Dec 2024 15:41:06 +0000 Subject: [PATCH 13/29] 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/decision_maker_abci/skill.yaml | 15 ++++++---- .../skills/market_manager_abci/skill.yaml | 3 +- .../skills/trader_abci/fsm_specification.yaml | 11 ++++--- packages/valory/skills/trader_abci/skill.yaml | 8 ++--- .../tx_settlement_multiplexer_abci/rounds.py | 29 +++++++++++-------- .../tx_settlement_multiplexer_abci/skill.yaml | 6 ++-- 10 files changed, 55 insertions(+), 47 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index bc5bd71dd..eb5c2c717 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi", + "contract/valory/market_maker/0.1.0": "bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -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": "bafybeie2dby7d5rh7lqapqazlpa37ryehl335bgnkoym7kkxcpt2fyjgw4", - "skill/valory/decision_maker_abci/0.1.0": "bafybeif2crsr4ga655mngnq2eu7itmshvrlom726aouwxrgrwy4wymvpie", - "skill/valory/trader_abci/0.1.0": "bafybeidikyhe4ole3nedmfqmgmxd63zmgnojviyjdv4jf2q7rv7kdqcifi", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeienjc2l65c7o77vkuoxogaduvgohs7c2xhuonmrj5vbvaaag6kjai", + "skill/valory/market_manager_abci/0.1.0": "bafybeifwxoohe3nnjearvtsdf3c3gz73nc2eljvpfzea4j2kiwm6oc2f7e", + "skill/valory/decision_maker_abci/0.1.0": "bafybeibeqkgpuzrw67755ddk4nkzi2tcx3nkdclk7tkakb7t77uak3xtsa", + "skill/valory/trader_abci/0.1.0": "bafybeicoceb6ehtlpeftsc2rkygduvckbsxwte6q6moi5hccto2h2ykw2e", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicbauspz5gzgmy77rekqqdrw2yjdr56eezvrisqv3nnoyn4a2fxby", "skill/valory/staking_abci/0.1.0": "bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni", - "agent/valory/trader/0.1.0": "bafybeibg76o3eq6egkk3vp7yrtbp65vorczlwz657tml7ujnkvw4w3iuci", - "service/valory/trader/0.1.0": "bafybeib5vbdfambusgtfn2b5spvn554yphyokeka6ayysflma4zxhyywve", - "service/valory/trader_pearl/0.1.0": "bafybeiedff4y5r3taeps5tim4cggefanqgdrxz3bjaxcjedfevnwaf5i5u" + "agent/valory/trader/0.1.0": "bafybeiggand4c4cujkrwdb6djumqrkpzpyre5izsxtivnvhlp24rvbd54i", + "service/valory/trader/0.1.0": "bafybeiaqgbi7fsahqk6uzv7zczrf3sdc7pjx67hzyzli7vymlkfdwj32ya", + "service/valory/trader_pearl/0.1.0": "bafybeiedzbycxa52bp46z34654c5cd6vs7ghhi3qf4pseyrnbhnpuaap6i" }, "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 9c8bb5855..4c69fc4b6 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeienjc2l65c7o77vkuoxogaduvgohs7c2xhuonmrj5vbvaaag6kjai -- valory/market_manager_abci:0.1.0:bafybeie2dby7d5rh7lqapqazlpa37ryehl335bgnkoym7kkxcpt2fyjgw4 -- valory/decision_maker_abci:0.1.0:bafybeif2crsr4ga655mngnq2eu7itmshvrlom726aouwxrgrwy4wymvpie -- valory/trader_abci:0.1.0:bafybeidikyhe4ole3nedmfqmgmxd63zmgnojviyjdv4jf2q7rv7kdqcifi +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicbauspz5gzgmy77rekqqdrw2yjdr56eezvrisqv3nnoyn4a2fxby +- valory/market_manager_abci:0.1.0:bafybeifwxoohe3nnjearvtsdf3c3gz73nc2eljvpfzea4j2kiwm6oc2f7e +- valory/decision_maker_abci:0.1.0:bafybeibeqkgpuzrw67755ddk4nkzi2tcx3nkdclk7tkakb7t77uak3xtsa +- valory/trader_abci:0.1.0:bafybeicoceb6ehtlpeftsc2rkygduvckbsxwte6q6moi5hccto2h2ykw2e - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 a74982e35..1efce23a9 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:bafybeibg76o3eq6egkk3vp7yrtbp65vorczlwz657tml7ujnkvw4w3iuci +agent: valory/trader:0.1.0:bafybeiggand4c4cujkrwdb6djumqrkpzpyre5izsxtivnvhlp24rvbd54i 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 a160b9e52..cdbfbf440 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:bafybeibg76o3eq6egkk3vp7yrtbp65vorczlwz657tml7ujnkvw4w3iuci +agent: valory/trader:0.1.0:bafybeiggand4c4cujkrwdb6djumqrkpzpyre5izsxtivnvhlp24rvbd54i 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 9315422f2..8930aede1 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: bafybeic2fxlidmklpfkv4fxs7rusxd3vyddo6bsxqh4z32hz2v4segikue - behaviours/bet_placement.py: bafybeia4listbfzsk4n4wkc4ycaftxgywjnl3mmpcqhuo3nwwia4n3oufu + behaviours/base.py: bafybeidrgmnhgler4kho325u5xszfhshsqpeegi7imwzyienyaqgiimsby + behaviours/bet_placement.py: bafybeihq4z2jhzzk4qrufydnedk5iplkfshexq3ktzfn65te4g6qpp346m behaviours/blacklisting.py: bafybeif7gtifpsiqvnpbzyegzsqndhf4yqcqedkfy24q32v4bdyjeihyem behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e @@ -25,6 +26,7 @@ fingerprint: behaviours/reedem.py: bafybeiga4dmqeftkkrt6cvbtr2eciiykm2b54bjk2pc5eilm6ftdri4lxu behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeid5ehttobzqsx4hxdjbu7iwhd472xqgurug6eitcrp75jtthiyxv4 + behaviours/sell_outcome_token.py: bafybeia33ou7v7clovaeezy4fwvlsbsfquiwaz4twixnjs5gxpyrxyihra behaviours/storage_manager.py: bafybeiez6daaj2bufxdcsghtmqybyrzdh74z26cc4ajsqsiy5krgjo2tla behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -38,12 +40,12 @@ fingerprint: redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm rounds.py: bafybeiazjcsukgefair52aw37hhvxzlopnzqqmi4ntqrinakljlcm4kt4a states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeifkip6bw3oacpnyhko7fi3i72nv2fc33ld6bkr2myaay4qa2ybcie + states/base.py: bafybeiaaxd3zefxuk7kulo52hucbvww46hbvs4lebwai3lilmtybvi5ixu states/bet_placement.py: bafybeih5eopyxubczys5u5t3bdxbxpc7mmfdyqrpqsbm2uha5jc2phza4i states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni states/claim_subscription.py: bafybeiampifhdoztggwj6gthl2hfzecmjcwnm6nic2o47q4je7j4x3ujne - states/decision_receive.py: bafybeib3eahaehvmcrdojnlrz34q2crdb3ao6qun2wohokdf3t3ywwfa4y + states/decision_receive.py: bafybeigydiheb5a7l65vrtahnwtoj2yjgcxmxkpdtgxl4n56tptxlarhfy states/decision_request.py: bafybeiarv3r5j7cfvxmudki2llbdl2pvf24p5mvsva6bdgrylnwdyag5xy states/final_states.py: bafybeicjrrojo3gmfaxzicwloyorlnqgzl6a2avevo4nvhoh424zwzmbti states/handle_failed_tx.py: bafybeihewm2vernvhktuorljdupjqcg2p5vs6wvsira2d62wkoyo5xlzjm @@ -51,6 +53,7 @@ fingerprint: states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe states/sampling.py: bafybeif2yuwl5swelp7oh5nfuupdf3vg2ijjzapk2xqht7e6i6ggcsl2zy + states/sell_outcome_token.py: bafybeifxzswza6sdk6cx6ccsdseynfmaupn2dnk3vt5dtbyklameaxyn7u states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -85,7 +88,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm @@ -101,7 +104,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeie2dby7d5rh7lqapqazlpa37ryehl335bgnkoym7kkxcpt2fyjgw4 +- valory/market_manager_abci:0.1.0:bafybeifwxoohe3nnjearvtsdf3c3gz73nc2eljvpfzea4j2kiwm6oc2f7e - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 55957c406..db4d0260e 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -6,10 +6,11 @@ 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: bafybeibppnnn5qmzc25lqna4taegwfrt7meipvmzytkjtui2tnjudc6q34 - bets.py: bafybeiehjifg77e3xecfy2y3bj4zcxhvdgrqiilhc6sjrnfl2gz5pddz5a + bets.py: bafybeiffau7h2gdllbd32kyxb7fbgd6tnjkpm64xumguupkhdhxm7a2slm dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q graph_tooling/__init__.py: bafybeigzo7nhbzafyq3fuhrlewksjvmzttiuk4vonrggtjtph4rw4ncpk4 diff --git a/packages/valory/skills/trader_abci/fsm_specification.yaml b/packages/valory/skills/trader_abci/fsm_specification.yaml index cff5e3a38..dfe664222 100644 --- a/packages/valory/skills/trader_abci/fsm_specification.yaml +++ b/packages/valory/skills/trader_abci/fsm_specification.yaml @@ -34,6 +34,7 @@ alphabet_in: - RESET_AND_PAUSE_TIMEOUT - RESET_TIMEOUT - ROUND_TIMEOUT +- SELL_OUTCOME_TOKEN_DONE - SERVICE_EVICTED - SERVICE_NOT_STAKED - SKIP_REQUEST @@ -50,6 +51,7 @@ alphabet_in: default_start_state: RegistrationStartupRound final_states: - FailedMultiplexerRound +- FinishedSellOutcomeTokenTxRound - ImpossibleRound - ServiceEvictedRound label: TraderAbciApp @@ -71,6 +73,7 @@ states: - DecisionRequestRound - FailedMultiplexerRound - FinalizationRound +- FinishedSellOutcomeTokenTxRound - HandleFailedTxRound - ImpossibleRound - MechRequestRound @@ -88,7 +91,6 @@ states: - SelectKeeperTransactionSubmissionARound - SelectKeeperTransactionSubmissionBAfterTimeoutRound - SelectKeeperTransactionSubmissionBRound -- SellOutcomeTokenRound - ServiceEvictedRound - SubscriptionRound - SynchronizeLateMessagesRound @@ -175,11 +177,11 @@ transition_func: (MechResponseRound, NO_MAJORITY): MechResponseRound (MechResponseRound, ROUND_TIMEOUT): MechResponseRound (PostTxSettlementRound, BET_PLACEMENT_NO_SELL_DONE): RedeemRound - (PostTxSettlementRound, BET_PLACEMENT_SELL_DONE): SellOutcomeTokenRound + (PostTxSettlementRound, BET_PLACEMENT_SELL_DONE): RedeemRound (PostTxSettlementRound, MECH_REQUESTING_DONE): MechResponseRound (PostTxSettlementRound, REDEEMING_DONE): CallCheckpointRound (PostTxSettlementRound, ROUND_TIMEOUT): PostTxSettlementRound - (PostTxSettlementRound, SELL_OUTCOME_TOKEN_DONE): RedeemRound + (PostTxSettlementRound, SELL_OUTCOME_TOKEN_DONE): FinishedSellOutcomeTokenTxRound (PostTxSettlementRound, STAKING_DONE): ResetAndPauseRound (PostTxSettlementRound, SUBSCRIPTION_DONE): ClaimRound (PostTxSettlementRound, UNRECOGNIZED): FailedMultiplexerRound @@ -230,9 +232,6 @@ transition_func: (SelectKeeperTransactionSubmissionBRound, INCORRECT_SERIALIZATION): HandleFailedTxRound (SelectKeeperTransactionSubmissionBRound, NO_MAJORITY): ResetRound (SelectKeeperTransactionSubmissionBRound, ROUND_TIMEOUT): SelectKeeperTransactionSubmissionBRound - (SellOutcomeTokenRound, DONE): PreTxSettlementRound - (SellOutcomeTokenRound, NO_MAJORITY): SellOutcomeTokenRound - (SellOutcomeTokenRound, ROUND_TIMEOUT): SellOutcomeTokenRound (SubscriptionRound, DONE): PreTxSettlementRound (SubscriptionRound, MOCK_TX): ToolSelectionRound (SubscriptionRound, NONE): SubscriptionRound diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 81dd2cfe5..e561dcf03 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -11,7 +11,7 @@ fingerprint: behaviours.py: bafybeigc6hszbu66ccajny5eh7thfgsrlr36je4mzziwp4mupgvtaeu6aa composition.py: bafybeifxerfvssuhodqmtvkz6umlmrmdqjv5ptpszhnwlavzxaavdpdyly dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeiea2w6rhdxwc2ogvdnoxw2wbklnlspsoxyzhpz6h6x6dnctqurnoi + fsm_specification.yaml: bafybeidmvysaytecqg6e75qwl3x2badc2j33pzrqjpvzn2qmpdvk24z6v4 handlers.py: bafybeibbxybbi66em63ad33cllymypr3za3f5xvor3m2krhuxoyxnqjnxu models.py: bafybeih2vkf4ln7n7ar27iemho7w7sdr4clmhbnhbcznmsri6mc2skkky4 tests/__init__.py: bafybeiadatapyjh3e7ucg2ehz77oms3ihrbutwb2cs2tkjehy54utwvuyi @@ -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:bafybeie2dby7d5rh7lqapqazlpa37ryehl335bgnkoym7kkxcpt2fyjgw4 -- valory/decision_maker_abci:0.1.0:bafybeif2crsr4ga655mngnq2eu7itmshvrlom726aouwxrgrwy4wymvpie -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeienjc2l65c7o77vkuoxogaduvgohs7c2xhuonmrj5vbvaaag6kjai +- valory/market_manager_abci:0.1.0:bafybeifwxoohe3nnjearvtsdf3c3gz73nc2eljvpfzea4j2kiwm6oc2f7e +- valory/decision_maker_abci:0.1.0:bafybeibeqkgpuzrw67755ddk4nkzi2tcx3nkdclk7tkakb7t77uak3xtsa +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicbauspz5gzgmy77rekqqdrw2yjdr56eezvrisqv3nnoyn4a2fxby - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py b/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py index b3cc56448..51c293edf 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py @@ -42,7 +42,9 @@ SubscriptionRound, ) from packages.valory.skills.decision_maker_abci.states.redeem import RedeemRound -from packages.valory.skills.decision_maker_abci.states.sell_outcome_token import SellOutcomeTokenRound +from packages.valory.skills.decision_maker_abci.states.sell_outcome_token import ( + SellOutcomeTokenRound, +) from packages.valory.skills.mech_interact_abci.states.request import MechRequestRound from packages.valory.skills.staking_abci.rounds import CallCheckpointRound @@ -98,7 +100,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: RedeemRound.auto_round_id(): Event.REDEEMING_DONE, CallCheckpointRound.auto_round_id(): Event.STAKING_DONE, SubscriptionRound.auto_round_id(): Event.SUBSCRIPTION_DONE, - SellOutcomeTokenRound.auto_round_id(): Event.SELL_OUTCOME_TOKEN_DONE + SellOutcomeTokenRound.auto_round_id(): Event.SELL_OUTCOME_TOKEN_DONE, } synced_data = SynchronizedData(self.synchronized_data.db) @@ -115,22 +117,22 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: self.synchronized_data.update(policy=policy_update) # if a bet was just placed, edit the utilized tools mapping - if event == Event.BET_PLACEMENT_NO_SELL_DONE or event == Event.BET_PLACEMENT_SELL_DONE: + if ( + event == Event.BET_PLACEMENT_NO_SELL_DONE + or event == Event.BET_PLACEMENT_SELL_DONE + ): utilized_tools = synced_data.utilized_tools utilized_tools[synced_data.final_tx_hash] = synced_data.mech_tool tools_update = json.dumps(utilized_tools, sort_keys=True) vote = synced_data.vote self.synchronized_data.update( - utilized_tools=tools_update, - previous_vote=vote + utilized_tools=tools_update, previous_vote=vote ) # if all tokens for an outcome have been sold, set the previous vote to None as we no longer have any # investment in that outcome if event == Event.SELL_OUTCOME_TOKEN_DONE: - self.synchronized_data.update( - previous_vote=None - ) + self.synchronized_data.update(previous_vote=None) return synced_data, event @@ -182,21 +184,24 @@ class TxSettlementMultiplexerAbciApp(AbciApp[Event]): - round timeout: 0. 1. PostTxSettlementRound - mech requesting done: 3. - - bet placement done: 4. + - bet placement done no sell: 4. + - bet placement done sell: 4. - redeeming done: 6. + - sell outcome token done: 8. - staking done: 7. - subscription done: 5. - round timeout: 1. - - unrecognized: 8. + - unrecognized: 9. 2. ChecksPassedRound 3. FinishedMechRequestTxRound 4. FinishedBetPlacementTxRound 5. FinishedSubscriptionTxRound 6. FinishedRedeemingTxRound 7. FinishedStakingTxRound - 8. FailedMultiplexerRound + 8. FinishedSellOutcomeTokenTxRound + 9. FailedMultiplexerRound - Final states: {ChecksPassedRound, FailedMultiplexerRound, FinishedBetPlacementTxRound, FinishedMechRequestTxRound, FinishedRedeemingTxRound, FinishedStakingTxRound, FinishedSubscriptionTxRound} + Final states: {ChecksPassedRound, FailedMultiplexerRound, FinishedBetPlacementTxRound, FinishedMechRequestTxRound, FinishedRedeemingTxRound, FinishedSellOutcomeTokenTxRound, FinishedStakingTxRound, FinishedSubscriptionTxRound} Timeouts: round timeout: 30.0 diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 71f47812a..1ea58cb1b 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -10,10 +10,10 @@ fingerprint: __init__.py: bafybeide6k22zk4f3hyzhpapaoddsnxpw5elqcfvrxxj4nfvpzctv6jqhu behaviours.py: bafybeictumcqn2pgo7y2duemvzoaafognfhl6s6il3tv53hq66tf7xgpsu dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeicd7us5ffvsrxm7ybaanyzojbhmo7xtsfd3swtdem4dfsxkidxw7a + fsm_specification.yaml: bafybeieoyrx3nt3qsvd5n2bkryzq6twvrphmbqn3fs4gts6eoy2tvksxoy handlers.py: bafybeiafbqr7ojfcbwohvee7x4zzswad3ymfrrbjlfz7uuuttmn3qdfs6q models.py: bafybeigtmxoecoow663hgqnyinxarlrttyyt5ghpbdamdv4tc4kikcfx3a - rounds.py: bafybeig3dhhrf5tkj63b3bk2mqfprcwzk3galz2ukzvdenz4g2femaixku + rounds.py: bafybeiclmrxazjjsaka3pr2z34rknseclwnvhhfwghpikn7uvjvmvxmega tests/__init__.py: bafybeiat74pbtmxvylsz7karp57qp2v7y6wtrsz572jkrghbcssoudgjay tests/test_handlers.py: bafybeiayuktfupylm3p3ygufjb66swzxhpbmioqoffwuauakfgbkwrv7ma fingerprint_ignore_patterns: [] @@ -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:bafybeif2crsr4ga655mngnq2eu7itmshvrlom726aouwxrgrwy4wymvpie +- valory/decision_maker_abci:0.1.0:bafybeibeqkgpuzrw67755ddk4nkzi2tcx3nkdclk7tkakb7t77uak3xtsa - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 5e0524c3f82b64cb69d60f44b923e63b2d0b5086 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Fri, 6 Dec 2024 10:47:30 +0000 Subject: [PATCH 14/29] fix: copyright date --- .../skills/decision_maker_abci/states/sell_outcome_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py index 258b74b21..3fdeb628c 100644 --- a/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/states/sell_outcome_token.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # -# Copyright 2021-2024 Valory AG +# Copyright 2024 Valory AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From b65ba87ecf4c788761252def707b8992b1072fb0 Mon Sep 17 00:00:00 2001 From: Adamantios Date: Fri, 6 Dec 2024 20:38:36 +0200 Subject: [PATCH 15/29] chore: ignore bandit's false positive error Reported error: > Issue: [B105:hardcoded_password_string] Possible hardcoded password: 'sell_outcome_token_done' --- packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py b/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py index 51c293edf..ec8912db0 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/rounds.py @@ -58,7 +58,7 @@ class Event(Enum): BET_PLACEMENT_NO_SELL_DONE = "bet_placement_done_no_sell" BET_PLACEMENT_SELL_DONE = "bet_placement_done_sell" REDEEMING_DONE = "redeeming_done" - SELL_OUTCOME_TOKEN_DONE = "sell_outcome_token_done" + SELL_OUTCOME_TOKEN_DONE = "sell_outcome_token_done" # nosec STAKING_DONE = "staking_done" SUBSCRIPTION_DONE = "subscription_done" ROUND_TIMEOUT = "round_timeout" From e9ba6eeae37b08f19a9af88c15f33bb21a69637a Mon Sep 17 00:00:00 2001 From: Adamantios Date: Fri, 6 Dec 2024 20:38:57 +0200 Subject: [PATCH 16/29] chore: run 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 +- .../valory/skills/decision_maker_abci/skill.yaml | 11 ++++++----- .../valory/skills/market_manager_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 8 ++++---- .../tx_settlement_multiplexer_abci/skill.yaml | 6 +++--- 8 files changed, 29 insertions(+), 28 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 0a929d343..f83f1e0f9 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi", + "contract/valory/market_maker/0.1.0": "bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -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": "bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi", - "skill/valory/decision_maker_abci/0.1.0": "bafybeifineeaqixdqafihy5ch2gmuq2pyb7xdcxychfbypfpz344nc3j4e", - "skill/valory/trader_abci/0.1.0": "bafybeieauih4nqotqjiamd2mrehjvxxbq7astbt2ypnltokhkvdjqzrkkm", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeie433saaj7gn6ronam3eaaneqnr6fjcjnpchkswqjye2jfv5rntfi", + "skill/valory/market_manager_abci/0.1.0": "bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie", + "skill/valory/decision_maker_abci/0.1.0": "bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha", + "skill/valory/trader_abci/0.1.0": "bafybeib4rakcrqp47grlhgcswi6q2zo5rha5nuskidpfgfvitdbotar2j4", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicgs7q5gttstxb25th27nncieku3etmmab4ewtdkozuaswz67k3w4", "skill/valory/staking_abci/0.1.0": "bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni", - "agent/valory/trader/0.1.0": "bafybeidedkcb7vbbu5stg5rpajlwq4h5wtuhdygvmfgtbvgpwttrs6frve", - "service/valory/trader/0.1.0": "bafybeigmu3xk233huyc7i7on7fqrkke2piijnd5ijwvsstt45vez4tno5a", - "service/valory/trader_pearl/0.1.0": "bafybeifxmmnkpg6d7ka7tlurzm5vuzaxiurdoxgoqydr7ksjkzpngpn7cy" + "agent/valory/trader/0.1.0": "bafybeietht7fwg2gvwtbwmtwny2haobearktv42xyjencolxregostynba", + "service/valory/trader/0.1.0": "bafybeifka4fszmveucfuefdp7lzttlb5iad5s5u34cao3bllzmdgdjhoay", + "service/valory/trader_pearl/0.1.0": "bafybeidwhdkyilx4ub4pzme2l5w5v4nhafrttk7n4b74jyil4a57j3kjnq" }, "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 d9c7e12b6..13ce91229 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeie433saaj7gn6ronam3eaaneqnr6fjcjnpchkswqjye2jfv5rntfi -- valory/market_manager_abci:0.1.0:bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi -- valory/decision_maker_abci:0.1.0:bafybeifineeaqixdqafihy5ch2gmuq2pyb7xdcxychfbypfpz344nc3j4e -- valory/trader_abci:0.1.0:bafybeieauih4nqotqjiamd2mrehjvxxbq7astbt2ypnltokhkvdjqzrkkm +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgs7q5gttstxb25th27nncieku3etmmab4ewtdkozuaswz67k3w4 +- valory/market_manager_abci:0.1.0:bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie +- valory/decision_maker_abci:0.1.0:bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha +- valory/trader_abci:0.1.0:bafybeib4rakcrqp47grlhgcswi6q2zo5rha5nuskidpfgfvitdbotar2j4 - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 487932fa9..4910b6e33 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:bafybeidedkcb7vbbu5stg5rpajlwq4h5wtuhdygvmfgtbvgpwttrs6frve +agent: valory/trader:0.1.0:bafybeietht7fwg2gvwtbwmtwny2haobearktv42xyjencolxregostynba 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 05d55a4ee..7d4c599f8 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:bafybeidedkcb7vbbu5stg5rpajlwq4h5wtuhdygvmfgtbvgpwttrs6frve +agent: valory/trader:0.1.0:bafybeietht7fwg2gvwtbwmtwny2haobearktv42xyjencolxregostynba 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 1b7d1f04f..4b6f3279f 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -12,9 +12,9 @@ fingerprint: README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky - behaviours/base.py: bafybeic2fxlidmklpfkv4fxs7rusxd3vyddo6bsxqh4z32hz2v4segikue - behaviours/bet_placement.py: bafybeia4listbfzsk4n4wkc4ycaftxgywjnl3mmpcqhuo3nwwia4n3oufu - behaviours/blacklisting.py: bafybeif7gtifpsiqvnpbzyegzsqndhf4yqcqedkfy24q32v4bdyjeihyem + behaviours/base.py: bafybeifc365wikrz5pej4xv6snztyn3hbrfrxeql6rtcr7swn35yn4hxsi + behaviours/bet_placement.py: bafybeihq4z2jhzzk4qrufydnedk5iplkfshexq3ktzfn65te4g6qpp346m + behaviours/blacklisting.py: bafybeicah7vcruhbakrhpsxdmw3ftq72o5e3plfhhqsnvhk3vk6iud6og4 behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e behaviours/decision_receive.py: bafybeifrsnxref7yyl4hq4nmh4xa4rden4wygv5y5ugvqb5ji7zgj7mv5m @@ -24,7 +24,8 @@ fingerprint: behaviours/randomness.py: bafybeiaoj3awyyg2onhpsdsn3dyczs23gr4smuzqcbw3e5ocljwxswjkce behaviours/reedem.py: bafybeiga4dmqeftkkrt6cvbtr2eciiykm2b54bjk2pc5eilm6ftdri4lxu behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i - behaviours/sampling.py: bafybeid5ehttobzqsx4hxdjbu7iwhd472xqgurug6eitcrp75jtthiyxv4 + behaviours/sampling.py: bafybeihe2waj53xrhonw4mgipagsgl3xoorcwzuqzyxwhn3mw7mjyeewfa + behaviours/sell_outcome_token.py: bafybeia33ou7v7clovaeezy4fwvlsbsfquiwaz4twixnjs5gxpyrxyihra behaviours/storage_manager.py: bafybeiez6daaj2bufxdcsghtmqybyrzdh74z26cc4ajsqsiy5krgjo2tla behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -102,7 +103,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeie2dby7d5rh7lqapqazlpa37ryehl335bgnkoym7kkxcpt2fyjgw4 +- valory/market_manager_abci:0.1.0:bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 0da138f12..170b0ccd3 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -9,7 +9,7 @@ fingerprint: README.md: bafybeie6miwn67uin3bphukmf7qgiifh4xtm42i5v3nuyqxzxtehxsqvcq __init__.py: bafybeigrtedqzlq5mtql2ssjsdriw76ml3666m4e2c3fay6vmyzofl6v6e behaviours.py: bafybeicfoszavcyrzahe6qaydlaf27mpbwui7a6wgdbstydbzxmdisxhju - bets.py: bafybeiajcbn6wx76guw76htahep6rvndlj4rlofjo2g3bsiegcwv5syv3a + bets.py: bafybeicdooctlccj3nu44xefdwlcpfacaxvk3t7rjrupfokjkh5kxrs73a dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q graph_tooling/__init__.py: bafybeigzo7nhbzafyq3fuhrlewksjvmzttiuk4vonrggtjtph4rw4ncpk4 diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 558dfd781..4cb4dec70 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -11,7 +11,7 @@ fingerprint: behaviours.py: bafybeigc6hszbu66ccajny5eh7thfgsrlr36je4mzziwp4mupgvtaeu6aa composition.py: bafybeifxerfvssuhodqmtvkz6umlmrmdqjv5ptpszhnwlavzxaavdpdyly dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeiea2w6rhdxwc2ogvdnoxw2wbklnlspsoxyzhpz6h6x6dnctqurnoi + fsm_specification.yaml: bafybeidmvysaytecqg6e75qwl3x2badc2j33pzrqjpvzn2qmpdvk24z6v4 handlers.py: bafybeibbxybbi66em63ad33cllymypr3za3f5xvor3m2krhuxoyxnqjnxu models.py: bafybeih2vkf4ln7n7ar27iemho7w7sdr4clmhbnhbcznmsri6mc2skkky4 tests/__init__.py: bafybeiadatapyjh3e7ucg2ehz77oms3ihrbutwb2cs2tkjehy54utwvuyi @@ -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:bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi -- valory/decision_maker_abci:0.1.0:bafybeifineeaqixdqafihy5ch2gmuq2pyb7xdcxychfbypfpz344nc3j4e -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeie433saaj7gn6ronam3eaaneqnr6fjcjnpchkswqjye2jfv5rntfi +- valory/market_manager_abci:0.1.0:bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie +- valory/decision_maker_abci:0.1.0:bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgs7q5gttstxb25th27nncieku3etmmab4ewtdkozuaswz67k3w4 - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 c80d53888..833950ae4 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -10,10 +10,10 @@ fingerprint: __init__.py: bafybeide6k22zk4f3hyzhpapaoddsnxpw5elqcfvrxxj4nfvpzctv6jqhu behaviours.py: bafybeictumcqn2pgo7y2duemvzoaafognfhl6s6il3tv53hq66tf7xgpsu dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeicd7us5ffvsrxm7ybaanyzojbhmo7xtsfd3swtdem4dfsxkidxw7a + fsm_specification.yaml: bafybeieoyrx3nt3qsvd5n2bkryzq6twvrphmbqn3fs4gts6eoy2tvksxoy handlers.py: bafybeiafbqr7ojfcbwohvee7x4zzswad3ymfrrbjlfz7uuuttmn3qdfs6q models.py: bafybeigtmxoecoow663hgqnyinxarlrttyyt5ghpbdamdv4tc4kikcfx3a - rounds.py: bafybeig3dhhrf5tkj63b3bk2mqfprcwzk3galz2ukzvdenz4g2femaixku + rounds.py: bafybeihbxi4m7eyvkmenhcdzy3ijzajaxqrcyts3asvqe36l2til7kngzy tests/__init__.py: bafybeiat74pbtmxvylsz7karp57qp2v7y6wtrsz572jkrghbcssoudgjay tests/test_handlers.py: bafybeiayuktfupylm3p3ygufjb66swzxhpbmioqoffwuauakfgbkwrv7ma fingerprint_ignore_patterns: [] @@ -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:bafybeifineeaqixdqafihy5ch2gmuq2pyb7xdcxychfbypfpz344nc3j4e +- valory/decision_maker_abci:0.1.0:bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From a3aae14f6a2960333c27c6df1a8f1cbdedce795a Mon Sep 17 00:00:00 2001 From: Adamantios Date: Fri, 6 Dec 2024 21:03:58 +0200 Subject: [PATCH 17/29] feat: update the bets so that we store investments per vote --- .../decision_maker_abci/behaviours/base.py | 10 ++-- .../behaviours/decision_receive.py | 2 - .../valory/skills/market_manager_abci/bets.py | 60 ++++++++++++++++++- 3 files changed, 63 insertions(+), 9 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/base.py b/packages/valory/skills/decision_maker_abci/behaviours/base.py index 12b5f9215..e2ea9c280 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/base.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/base.py @@ -355,12 +355,14 @@ def check_balance(self) -> WaitableConditionType: def update_bet_transaction_information(self) -> None: """Get whether the bet's invested amount should be updated.""" sampled_bet = self.sampled_bet - # Update the bet's invested amount, the new bet amount is added to previously invested amount - sampled_bet.invested_amount += self.synchronized_data.bet_amount + + # Update the bet's invested amount + updated = sampled_bet.update_investments(self.synchronized_data.bet_amount) + if not updated: + self.context.logger.error("Could not update the investments!") + # Update bet transaction timestamp sampled_bet.processed_timestamp = self.synced_timestamp - # update no of bets made - sampled_bet.n_bets += 1 # Update Queue number for priority logic sampled_bet.queue_status = sampled_bet.queue_status.next_status() diff --git a/packages/valory/skills/decision_maker_abci/behaviours/decision_receive.py b/packages/valory/skills/decision_maker_abci/behaviours/decision_receive.py index 5ad86dec8..596e63e3f 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/decision_receive.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/decision_receive.py @@ -518,8 +518,6 @@ def _update_selected_bet( self.context.logger.info( f"with the timestamp:{datetime.fromtimestamp(active_sampled_bet.processed_timestamp)}" ) - if prediction_response is not None: - active_sampled_bet.n_bets += 1 self.store_bets() diff --git a/packages/valory/skills/market_manager_abci/bets.py b/packages/valory/skills/market_manager_abci/bets.py index df19d2064..5bf14ebb0 100644 --- a/packages/valory/skills/market_manager_abci/bets.py +++ b/packages/valory/skills/market_manager_abci/bets.py @@ -28,6 +28,8 @@ from typing import Any, Dict, List, Optional, Union +YES = "yes" +NO = "no" P_YES_FIELD = "p_yes" P_NO_FIELD = "p_no" CONFIDENCE_FIELD = "confidence" @@ -136,18 +138,59 @@ class Bet: prediction_response: PredictionResponse = dataclasses.field( default_factory=get_default_prediction_response ) - invested_amount: int = 0 position_liquidity: int = 0 potential_net_profit: int = 0 processed_timestamp: int = 0 - n_bets: int = 0 queue_status: QueueStatus = QueueStatus.FRESH + # a mapping from vote to investment amounts + investments: Dict[str, List[int]] = dataclasses.field(default_factory=dict) + + @property + def yes_investments(self) -> List[int]: + """Get the yes investments.""" + return self.investments[self.yes] + + @property + def no_investments(self) -> List[int]: + """Get the no investments.""" + return self.investments[self.no] + + @property + def n_yes_bets(self) -> int: + """Get the number of yes bets.""" + return len(self.yes_investments) + + @property + def n_no_bets(self) -> int: + """Get the number of no bets.""" + return len(self.no_investments) + + @property + def n_bets(self) -> int: + """Get the number of bets.""" + return self.n_yes_bets + self.n_no_bets + + @property + def invested_amount_yes(self) -> int: + """Get the amount invested in yes bets.""" + return sum(self.yes_investments) + + @property + def invested_amount_no(self) -> int: + """Get the amount invested in no bets.""" + return sum(self.no_investments) + + @property + def invested_amount(self) -> int: + """Get the amount invested in bets.""" + return self.invested_amount_yes + self.invested_amount_no def __post_init__(self) -> None: """Post initialization to adjust the values.""" self._validate() self._cast() self._check_usefulness() + self.investments = {self.yes: [], self.no: []} def __lt__(self, other: "Bet") -> bool: """Implements less than operator.""" @@ -225,7 +268,7 @@ def _get_binary_outcome(self, no: bool) -> str: """Get an outcome only if it is binary.""" if self.outcomeSlotCount == BINARY_N_SLOTS: return self.get_outcome(int(no)) - requested_outcome = "no" if no else "yes" + requested_outcome = NO if no else YES error = ( f"A {requested_outcome!r} outcome is only available for binary questions." ) @@ -241,6 +284,17 @@ def no(self) -> str: """Return the "no" outcome.""" return self._get_binary_outcome(True) + def update_investments(self, amount: int) -> bool: + """Get the investments for the current vote type.""" + vote = self.prediction_response.vote + if vote is None: + return False + + vote_name = self.get_outcome(vote) + to_update = self.investments[vote_name] + to_update.append(amount) + return True + def update_market_info(self, bet: "Bet") -> None: """Update the bet's market information.""" if ( From 89cd038320ec4da1bc72840e5572b97befdc6bde Mon Sep 17 00:00:00 2001 From: Adamantios Date: Fri, 6 Dec 2024 21:05:01 +0200 Subject: [PATCH 18/29] chore: create an action to enforce a merge rule for `main` Do not allow merging on `main` from any branch other than `develop`. [no ci] --- .github/workflows/merge_rules.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/merge_rules.yaml diff --git a/.github/workflows/merge_rules.yaml b/.github/workflows/merge_rules.yaml new file mode 100644 index 000000000..187009101 --- /dev/null +++ b/.github/workflows/merge_rules.yaml @@ -0,0 +1,14 @@ +name: 'Check Branch' + +on: + pull_request: + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.base_ref == 'main' && github.head_ref != 'develop' + run: | + echo "ERROR: You can only merge to main from develop." + exit 1 From 2709c8c851be41cb106fbe817c064bfb9aa09f75 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 10:32:20 +0000 Subject: [PATCH 19/29] fix: approval tx status --- .../decision_maker_abci/behaviours/sell_outcome_token.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index 6b2920306..d4d0a5bde 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -62,12 +62,12 @@ def outcome_index(self) -> int: def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" - approval_tx = yield from self.build_approval_tx( + status = yield from self.build_approval_tx( self.return_amount, self.market_maker_contract_address, self.market_maker_contract_address, ) - return approval_tx + return status def _calc_sell_amount(self) -> WaitableConditionType: """Calculate the sell amount of the conditional token.""" From f919d2e19401dbbbfb907e6f876743a11ce93df9 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 14:18:10 +0000 Subject: [PATCH 20/29] fix: build approval tx --- .../valory/skills/decision_maker_abci/behaviours/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/base.py b/packages/valory/skills/decision_maker_abci/behaviours/base.py index e2ea9c280..bfef348b7 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/base.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/base.py @@ -723,7 +723,7 @@ def finish_behaviour(self, payload: BaseTxPayload) -> Generator: self.set_done() def build_approval_tx( - self, amount: int, market_maker_contract_address: str, to_address: str + self, amount: int, spender: str, token: str ) -> WaitableConditionType: """Build an ERC20 approve transaction.""" response_msg = yield from self.get_contract_api_response( @@ -731,7 +731,7 @@ def build_approval_tx( contract_address=self.collateral_token, contract_id=str(ERC20.contract_id), contract_callable="build_approval_tx", - spender=market_maker_contract_address, + spender=spender, amount=amount, ) @@ -745,7 +745,7 @@ def build_approval_tx( return False batch = MultisendBatch( - to=to_address, + to=token, data=HexBytes(approval_data), ) self.multisend_batches.append(batch) From 0a5fc2c75cab33cca7d2c08bd9ef273daf09741b Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 14:19:00 +0000 Subject: [PATCH 21/29] fix: make return amount property --- .../behaviours/sell_outcome_token.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index d4d0a5bde..bf0273017 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -48,7 +48,6 @@ def __init__(self, **kwargs: Any) -> None: """Initialize the sell token behaviour.""" super().__init__(**kwargs) self.sell_amount: float = 0.0 - self.return_amount: int = 0 @property def market_maker_contract_address(self) -> str: @@ -58,7 +57,20 @@ def market_maker_contract_address(self) -> str: @property def outcome_index(self) -> int: """Get the index of the outcome for which the service is going to sell token.""" - return cast(int, self.synchronized_data.vote) + return cast(int, self.synchronized_data.previous_vote) + + @property + def return_amount(self) -> int: + """Get the amount expected to be returned after the sell tx. """ + previous_vote = self.synchronized_data.previous_vote + + if previous_vote == 0: + return self.sampled_bet.invested_amount_yes + + else: + return self.sampled_bet.invested_amount_no + + def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" From d0e3497758aa1d6f7c93d18f63cb3a4250c36f1f Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 14:19:30 +0000 Subject: [PATCH 22/29] fix: build approval tx token --- .../skills/decision_maker_abci/behaviours/sell_outcome_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index bf0273017..cf2b5b1d6 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -77,7 +77,7 @@ def _build_approval_tx(self) -> WaitableConditionType: status = yield from self.build_approval_tx( self.return_amount, self.market_maker_contract_address, - self.market_maker_contract_address, + self.sampled_bet.get_outcome(self.outcome_index), ) return status From 2f0afa2d524ca35d4268e19cc93c040e9e19612d Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 14:19:54 +0000 Subject: [PATCH 23/29] fix: remove is wxdai check --- .../decision_maker_abci/behaviours/sell_outcome_token.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index cf2b5b1d6..6eade3bf8 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -178,13 +178,8 @@ def async_act(self) -> Generator: yield from self.finish_behaviour(payload) - self.return_amount = self.bets[ - self.synchronized_data.sampled_bet_index - ].invested_amount - - if self.is_wxdai: - tx_submitter = self.matching_round.auto_round_id() - betting_tx_hex = yield from self._prepare_safe_tx() + tx_submitter = self.matching_round.auto_round_id() + betting_tx_hex = yield from self._prepare_safe_tx() payload = MultisigTxPayload( agent, tx_submitter, betting_tx_hex, mocking_mode From 87d1205ade9c8bd51d81813d6f0f28f63304cc5c Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 14:42:35 +0000 Subject: [PATCH 24/29] 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 +- .../behaviours/sell_outcome_token.py | 4 +--- .../valory/skills/decision_maker_abci/skill.yaml | 11 ++++++----- .../valory/skills/market_manager_abci/skill.yaml | 3 ++- packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index f83f1e0f9..26ba9d5dc 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": "bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie", - "skill/valory/decision_maker_abci/0.1.0": "bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha", - "skill/valory/trader_abci/0.1.0": "bafybeib4rakcrqp47grlhgcswi6q2zo5rha5nuskidpfgfvitdbotar2j4", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicgs7q5gttstxb25th27nncieku3etmmab4ewtdkozuaswz67k3w4", + "skill/valory/market_manager_abci/0.1.0": "bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4", + "skill/valory/decision_maker_abci/0.1.0": "bafybeiga5dsxat3l6m6sjmek3db5ypr56qgp3b4hnbptihmdzbgamk3nye", + "skill/valory/trader_abci/0.1.0": "bafybeic2abjdywugakexa2r5xvp6va73zx2yawnlo6wknqwfru5jkobqou", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeihhznv3wi6flvwrxsj36b7obkbl3nd44lqrg2hs55d3q45mi7ep6y", "skill/valory/staking_abci/0.1.0": "bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni", - "agent/valory/trader/0.1.0": "bafybeietht7fwg2gvwtbwmtwny2haobearktv42xyjencolxregostynba", - "service/valory/trader/0.1.0": "bafybeifka4fszmveucfuefdp7lzttlb5iad5s5u34cao3bllzmdgdjhoay", - "service/valory/trader_pearl/0.1.0": "bafybeidwhdkyilx4ub4pzme2l5w5v4nhafrttk7n4b74jyil4a57j3kjnq" + "agent/valory/trader/0.1.0": "bafybeid6smnj3vd5sh6zpc5u6athk7wqhk5vac3podwhnzudwxpogmaega", + "service/valory/trader/0.1.0": "bafybeiebd5t5r7jv24p7mbc4zw3rcgpsmn63elpld2wo2fzzunvvttrium", + "service/valory/trader_pearl/0.1.0": "bafybeih3tnpowbwjbnvzcpq4dwt6qavgnnhbj4e2tar6ick2fglmge6np4" }, "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 13ce91229..99899de29 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -45,10 +45,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:bafybeicgs7q5gttstxb25th27nncieku3etmmab4ewtdkozuaswz67k3w4 -- valory/market_manager_abci:0.1.0:bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie -- valory/decision_maker_abci:0.1.0:bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha -- valory/trader_abci:0.1.0:bafybeib4rakcrqp47grlhgcswi6q2zo5rha5nuskidpfgfvitdbotar2j4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihhznv3wi6flvwrxsj36b7obkbl3nd44lqrg2hs55d3q45mi7ep6y +- valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 +- valory/decision_maker_abci:0.1.0:bafybeiga5dsxat3l6m6sjmek3db5ypr56qgp3b4hnbptihmdzbgamk3nye +- valory/trader_abci:0.1.0:bafybeic2abjdywugakexa2r5xvp6va73zx2yawnlo6wknqwfru5jkobqou - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 4910b6e33..e11e9048b 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:bafybeietht7fwg2gvwtbwmtwny2haobearktv42xyjencolxregostynba +agent: valory/trader:0.1.0:bafybeid6smnj3vd5sh6zpc5u6athk7wqhk5vac3podwhnzudwxpogmaega 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 7d4c599f8..8c4443848 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:bafybeietht7fwg2gvwtbwmtwny2haobearktv42xyjencolxregostynba +agent: valory/trader:0.1.0:bafybeid6smnj3vd5sh6zpc5u6athk7wqhk5vac3podwhnzudwxpogmaega number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index 6eade3bf8..1521039d9 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -61,7 +61,7 @@ def outcome_index(self) -> int: @property def return_amount(self) -> int: - """Get the amount expected to be returned after the sell tx. """ + """Get the amount expected to be returned after the sell tx.""" previous_vote = self.synchronized_data.previous_vote if previous_vote == 0: @@ -70,8 +70,6 @@ def return_amount(self) -> int: else: return self.sampled_bet.invested_amount_no - - def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" status = yield from self.build_approval_tx( diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 4b6f3279f..77afb80ee 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,15 +9,16 @@ 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: bafybeifc365wikrz5pej4xv6snztyn3hbrfrxeql6rtcr7swn35yn4hxsi + behaviours/base.py: bafybeibgmle4ggpuocvpmexoofln6bu6bxtf4csusigr4d7yaobmn452vu behaviours/bet_placement.py: bafybeihq4z2jhzzk4qrufydnedk5iplkfshexq3ktzfn65te4g6qpp346m behaviours/blacklisting.py: bafybeicah7vcruhbakrhpsxdmw3ftq72o5e3plfhhqsnvhk3vk6iud6og4 behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e - behaviours/decision_receive.py: bafybeifrsnxref7yyl4hq4nmh4xa4rden4wygv5y5ugvqb5ji7zgj7mv5m + behaviours/decision_receive.py: bafybeidoyo6f5oxw2jpimt2vse3xaz6nhzhg4l4thzl6kmb2f7jkr3y5im behaviours/decision_request.py: bafybeia22omb7tvocyfe3z2ucn5au5mcas7dg37ha42u7znefzrewjpk7y behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm behaviours/order_subscription.py: bafybeib3maqohhx35wzryy4otdcjp5thkr4sbp27ksvwidy3pwm444itra @@ -25,7 +26,7 @@ fingerprint: behaviours/reedem.py: bafybeiga4dmqeftkkrt6cvbtr2eciiykm2b54bjk2pc5eilm6ftdri4lxu behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeihe2waj53xrhonw4mgipagsgl3xoorcwzuqzyxwhn3mw7mjyeewfa - behaviours/sell_outcome_token.py: bafybeia33ou7v7clovaeezy4fwvlsbsfquiwaz4twixnjs5gxpyrxyihra + behaviours/sell_outcome_token.py: bafybeigdqptpafcse7qemq4u72ofcfwdzonyj437fhtu5krhjvrif6cmqu behaviours/storage_manager.py: bafybeiez6daaj2bufxdcsghtmqybyrzdh74z26cc4ajsqsiy5krgjo2tla behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -52,7 +53,7 @@ fingerprint: states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe states/sampling.py: bafybeif2yuwl5swelp7oh5nfuupdf3vg2ijjzapk2xqht7e6i6ggcsl2zy - states/sell_outcome_token.py: bafybeifxzswza6sdk6cx6ccsdseynfmaupn2dnk3vt5dtbyklameaxyn7u + states/sell_outcome_token.py: bafybeievk4w3zbi4buicml7nivhpepsoed6dsayauqhyk2bkkyqxdil2xm states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -103,7 +104,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie +- valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i diff --git a/packages/valory/skills/market_manager_abci/skill.yaml b/packages/valory/skills/market_manager_abci/skill.yaml index 170b0ccd3..109c15b96 100644 --- a/packages/valory/skills/market_manager_abci/skill.yaml +++ b/packages/valory/skills/market_manager_abci/skill.yaml @@ -6,10 +6,11 @@ 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: bafybeicfoszavcyrzahe6qaydlaf27mpbwui7a6wgdbstydbzxmdisxhju - bets.py: bafybeicdooctlccj3nu44xefdwlcpfacaxvk3t7rjrupfokjkh5kxrs73a + bets.py: bafybeiaajxu2e7a2gsvtqpggh7mzthyowhd6ukf47vmv2lcq3so4ih5tze dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeic5cvwfbiu5pywyp3h5s2elvu7jqdrcwayay7o3v3ow47vu2jw53q graph_tooling/__init__.py: bafybeigzo7nhbzafyq3fuhrlewksjvmzttiuk4vonrggtjtph4rw4ncpk4 diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 4cb4dec70..6aeec9277 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:bafybeiflzhfmpma7upnfas7faesmbeahack2gqnz6tvyx3hd7ggrk6c7ie -- valory/decision_maker_abci:0.1.0:bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicgs7q5gttstxb25th27nncieku3etmmab4ewtdkozuaswz67k3w4 +- valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 +- valory/decision_maker_abci:0.1.0:bafybeiga5dsxat3l6m6sjmek3db5ypr56qgp3b4hnbptihmdzbgamk3nye +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeihhznv3wi6flvwrxsj36b7obkbl3nd44lqrg2hs55d3q45mi7ep6y - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 833950ae4..d8353446e 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:bafybeicxivbaudftt5pyjinxxcyfol2cjqxfzphl6qaolgyf55dflzcxha +- valory/decision_maker_abci:0.1.0:bafybeiga5dsxat3l6m6sjmek3db5ypr56qgp3b4hnbptihmdzbgamk3nye - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From 2e90b9e4c9d1d908484da3fc333d0cb4c6bdc27f Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 14:45:00 +0000 Subject: [PATCH 25/29] 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/decision_maker_abci/skill.yaml | 17 ++++++++++------- packages/valory/skills/trader_abci/skill.yaml | 8 ++++---- .../tx_settlement_multiplexer_abci/skill.yaml | 6 +++--- 7 files changed, 32 insertions(+), 29 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 1722fb49f..db672d00e 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -5,7 +5,7 @@ "custom/jhehemann/kelly_criterion/0.1.0": "bafybeif55cu7cf6znyma7kxus4wxa2doarhau2xmndo57iegshxorivwmq", "custom/w1kke/always_blue/0.1.0": "bafybeieshu32h3es2fslduuhr7nimuvh2vuibyeqdunzrcggaeohekg3jm", "custom/valory/kelly_criterion_no_conf/0.1.0": "bafybeibxfp27rzrfnp7sxq62vwv32pdvrijxi7vzg7ihukkaka3bwzrgae", - "contract/valory/market_maker/0.1.0": "bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi", + "contract/valory/market_maker/0.1.0": "bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq", "contract/valory/realitio/0.1.0": "bafybeietgux6kkhdquspy35qera7gjwwqwrremmoeatjzwwokjb2lzsata", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", @@ -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": "bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi", - "skill/valory/decision_maker_abci/0.1.0": "bafybeiczxtmesnkxtcm55bkjcsuyg7qllywdioonefr2fovripwv27yozm", - "skill/valory/trader_abci/0.1.0": "bafybeiahjgvfeq3b6c5fq3hkvooermantgqv5tbpn5we5fumsnsyipe5jy", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeid6nvwb4e2tllkft252vaqtf24xmrfgd4inf44vzzounp4ms4xn4m", + "skill/valory/market_manager_abci/0.1.0": "bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4", + "skill/valory/decision_maker_abci/0.1.0": "bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye", + "skill/valory/trader_abci/0.1.0": "bafybeietnfgxhyb5zan2hdeagwvwjm2sg2cqsyzz627wka66a6m3xfn3di", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidh2heva4vzg5o6mlhwfnsrfudjiemuhjislb7whxp3khn3mcaxgu", "skill/valory/staking_abci/0.1.0": "bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni", - "agent/valory/trader/0.1.0": "bafybeihwgq4znzidrzin3fq2bgyk7avn43z67cuxqunnev7vayfhilotdi", - "service/valory/trader/0.1.0": "bafybeibvzb24iz34faipmhvmux65vav6xfvh7ytydc2oxo3yupjxlam7ce", - "service/valory/trader_pearl/0.1.0": "bafybeiexnbofsonvfsuftx5jzrcdgp475yd4nnrvtlqs6utqdeq4scwwpu" + "agent/valory/trader/0.1.0": "bafybeihqurhq4qwcktjnfd42zjk5ttoqmxjvh3hha4mfm56jhxkpqzgy3m", + "service/valory/trader/0.1.0": "bafybeigursffn4rvw567p4oba5eqawkkltxx62xgjafm2gsirrldcnhgam", + "service/valory/trader_pearl/0.1.0": "bafybeienkcy4cp2prwohmfuvswo6mk2sgjqm3bu3pmbewy5s57dm2g2fza" }, "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 4fa1e7b53..2eb91b62a 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -19,7 +19,7 @@ contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge - valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au - valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe @@ -45,10 +45,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:bafybeid6nvwb4e2tllkft252vaqtf24xmrfgd4inf44vzzounp4ms4xn4m -- valory/market_manager_abci:0.1.0:bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi -- valory/decision_maker_abci:0.1.0:bafybeiczxtmesnkxtcm55bkjcsuyg7qllywdioonefr2fovripwv27yozm -- valory/trader_abci:0.1.0:bafybeiahjgvfeq3b6c5fq3hkvooermantgqv5tbpn5we5fumsnsyipe5jy +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh2heva4vzg5o6mlhwfnsrfudjiemuhjislb7whxp3khn3mcaxgu +- valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 +- valory/decision_maker_abci:0.1.0:bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye +- valory/trader_abci:0.1.0:bafybeietnfgxhyb5zan2hdeagwvwjm2sg2cqsyzz627wka66a6m3xfn3di - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 cc32ec182..086d599fd 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:bafybeihwgq4znzidrzin3fq2bgyk7avn43z67cuxqunnev7vayfhilotdi +agent: valory/trader:0.1.0:bafybeihqurhq4qwcktjnfd42zjk5ttoqmxjvh3hha4mfm56jhxkpqzgy3m 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 36d6d6d52..6a5bab659 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:bafybeihwgq4znzidrzin3fq2bgyk7avn43z67cuxqunnev7vayfhilotdi +agent: valory/trader:0.1.0:bafybeihqurhq4qwcktjnfd42zjk5ttoqmxjvh3hha4mfm56jhxkpqzgy3m 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 dac0ec1d2..8b577be7f 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -9,15 +9,16 @@ 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/base.py: bafybeibgmle4ggpuocvpmexoofln6bu6bxtf4csusigr4d7yaobmn452vu + behaviours/bet_placement.py: bafybeihq4z2jhzzk4qrufydnedk5iplkfshexq3ktzfn65te4g6qpp346m behaviours/blacklisting.py: bafybeicah7vcruhbakrhpsxdmw3ftq72o5e3plfhhqsnvhk3vk6iud6og4 behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e - behaviours/decision_receive.py: bafybeifrsnxref7yyl4hq4nmh4xa4rden4wygv5y5ugvqb5ji7zgj7mv5m + behaviours/decision_receive.py: bafybeidoyo6f5oxw2jpimt2vse3xaz6nhzhg4l4thzl6kmb2f7jkr3y5im behaviours/decision_request.py: bafybeia22omb7tvocyfe3z2ucn5au5mcas7dg37ha42u7znefzrewjpk7y behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm behaviours/order_subscription.py: bafybeib3maqohhx35wzryy4otdcjp5thkr4sbp27ksvwidy3pwm444itra @@ -25,6 +26,7 @@ fingerprint: behaviours/reedem.py: bafybeidjmhh6c6shbg25d7exmc4nnp4heqbqselwuxj7rp2ss665lrytxe behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeihe2waj53xrhonw4mgipagsgl3xoorcwzuqzyxwhn3mw7mjyeewfa + behaviours/sell_outcome_token.py: bafybeigdqptpafcse7qemq4u72ofcfwdzonyj437fhtu5krhjvrif6cmqu behaviours/storage_manager.py: bafybeiez6daaj2bufxdcsghtmqybyrzdh74z26cc4ajsqsiy5krgjo2tla behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm @@ -38,12 +40,12 @@ fingerprint: redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm rounds.py: bafybeiazjcsukgefair52aw37hhvxzlopnzqqmi4ntqrinakljlcm4kt4a states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy - states/base.py: bafybeiatr6cqa3juxkhm6p4h7dhol7tfmxh2fo6nr2gtc6wuwyrtu3k3xm + states/base.py: bafybeibav3grn7qyr5herrq2idhd3h3pprlu6ntth2gzeebz6tpkmnus5q states/bet_placement.py: bafybeih5eopyxubczys5u5t3bdxbxpc7mmfdyqrpqsbm2uha5jc2phza4i states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni states/claim_subscription.py: bafybeiampifhdoztggwj6gthl2hfzecmjcwnm6nic2o47q4je7j4x3ujne - states/decision_receive.py: bafybeib3eahaehvmcrdojnlrz34q2crdb3ao6qun2wohokdf3t3ywwfa4y + states/decision_receive.py: bafybeigydiheb5a7l65vrtahnwtoj2yjgcxmxkpdtgxl4n56tptxlarhfy states/decision_request.py: bafybeiarv3r5j7cfvxmudki2llbdl2pvf24p5mvsva6bdgrylnwdyag5xy states/final_states.py: bafybeicjrrojo3gmfaxzicwloyorlnqgzl6a2avevo4nvhoh424zwzmbti states/handle_failed_tx.py: bafybeihewm2vernvhktuorljdupjqcg2p5vs6wvsira2d62wkoyo5xlzjm @@ -51,6 +53,7 @@ fingerprint: states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe states/sampling.py: bafybeif2yuwl5swelp7oh5nfuupdf3vg2ijjzapk2xqht7e6i6ggcsl2zy + states/sell_outcome_token.py: bafybeievk4w3zbi4buicml7nivhpepsoed6dsayauqhyk2bkkyqxdil2xm states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4 @@ -85,7 +88,7 @@ connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/market_maker:0.1.0:bafybeihrz4q5ia7jnflsv2myg6kkung2dfiogqrevuy7xlmqws7tr27rdi +- valory/market_maker:0.1.0:bafybeibevdc5trbi2qgt2tvwbsr2h5xvonfhcjwfmozftzvef575fdvbjq - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm @@ -101,7 +104,7 @@ protocols: - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: - valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/market_manager_abci:0.1.0:bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi +- valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 - valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 95ba76b79..0e1c2fdce 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -11,7 +11,7 @@ fingerprint: behaviours.py: bafybeigc6hszbu66ccajny5eh7thfgsrlr36je4mzziwp4mupgvtaeu6aa composition.py: bafybeifxerfvssuhodqmtvkz6umlmrmdqjv5ptpszhnwlavzxaavdpdyly dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeiea2w6rhdxwc2ogvdnoxw2wbklnlspsoxyzhpz6h6x6dnctqurnoi + fsm_specification.yaml: bafybeidmvysaytecqg6e75qwl3x2badc2j33pzrqjpvzn2qmpdvk24z6v4 handlers.py: bafybeibbxybbi66em63ad33cllymypr3za3f5xvor3m2krhuxoyxnqjnxu models.py: bafybeih2vkf4ln7n7ar27iemho7w7sdr4clmhbnhbcznmsri6mc2skkky4 tests/__init__.py: bafybeiadatapyjh3e7ucg2ehz77oms3ihrbutwb2cs2tkjehy54utwvuyi @@ -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:bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi -- valory/decision_maker_abci:0.1.0:bafybeiczxtmesnkxtcm55bkjcsuyg7qllywdioonefr2fovripwv27yozm -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeid6nvwb4e2tllkft252vaqtf24xmrfgd4inf44vzzounp4ms4xn4m +- valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 +- valory/decision_maker_abci:0.1.0:bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh2heva4vzg5o6mlhwfnsrfudjiemuhjislb7whxp3khn3mcaxgu - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 a884fb930..8d2a76234 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -10,10 +10,10 @@ fingerprint: __init__.py: bafybeide6k22zk4f3hyzhpapaoddsnxpw5elqcfvrxxj4nfvpzctv6jqhu behaviours.py: bafybeictumcqn2pgo7y2duemvzoaafognfhl6s6il3tv53hq66tf7xgpsu dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm - fsm_specification.yaml: bafybeicd7us5ffvsrxm7ybaanyzojbhmo7xtsfd3swtdem4dfsxkidxw7a + fsm_specification.yaml: bafybeieoyrx3nt3qsvd5n2bkryzq6twvrphmbqn3fs4gts6eoy2tvksxoy handlers.py: bafybeiafbqr7ojfcbwohvee7x4zzswad3ymfrrbjlfz7uuuttmn3qdfs6q models.py: bafybeigtmxoecoow663hgqnyinxarlrttyyt5ghpbdamdv4tc4kikcfx3a - rounds.py: bafybeig3dhhrf5tkj63b3bk2mqfprcwzk3galz2ukzvdenz4g2femaixku + rounds.py: bafybeihbxi4m7eyvkmenhcdzy3ijzajaxqrcyts3asvqe36l2til7kngzy tests/__init__.py: bafybeiat74pbtmxvylsz7karp57qp2v7y6wtrsz572jkrghbcssoudgjay tests/test_handlers.py: bafybeiayuktfupylm3p3ygufjb66swzxhpbmioqoffwuauakfgbkwrv7ma fingerprint_ignore_patterns: [] @@ -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:bafybeiczxtmesnkxtcm55bkjcsuyg7qllywdioonefr2fovripwv27yozm +- valory/decision_maker_abci:0.1.0:bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From cdfa138076d649354d235d9b57a48554d62d0975 Mon Sep 17 00:00:00 2001 From: Anna Sambrook Date: Mon, 9 Dec 2024 15:07:31 +0000 Subject: [PATCH 26/29] 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 +- .../behaviours/sell_outcome_token.py | 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 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index db672d00e..1809f6b85 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": "bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4", - "skill/valory/decision_maker_abci/0.1.0": "bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye", - "skill/valory/trader_abci/0.1.0": "bafybeietnfgxhyb5zan2hdeagwvwjm2sg2cqsyzz627wka66a6m3xfn3di", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidh2heva4vzg5o6mlhwfnsrfudjiemuhjislb7whxp3khn3mcaxgu", + "skill/valory/decision_maker_abci/0.1.0": "bafybeie3hsdpcbsz7njcjz6ntld5t5jdb6c2usgtg6q4zfibmsux3qrq3m", + "skill/valory/trader_abci/0.1.0": "bafybeics7hoohukzjnbazs7puelzuhm6qsstaoe32nuvcfjy7whlsra654", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigaw742u3t4vrrdmc4dbqszfexuaxifr4i5ent5nfayaalzj6pely", "skill/valory/staking_abci/0.1.0": "bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i", "skill/valory/check_stop_trading_abci/0.1.0": "bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni", - "agent/valory/trader/0.1.0": "bafybeihqurhq4qwcktjnfd42zjk5ttoqmxjvh3hha4mfm56jhxkpqzgy3m", - "service/valory/trader/0.1.0": "bafybeigursffn4rvw567p4oba5eqawkkltxx62xgjafm2gsirrldcnhgam", - "service/valory/trader_pearl/0.1.0": "bafybeienkcy4cp2prwohmfuvswo6mk2sgjqm3bu3pmbewy5s57dm2g2fza" + "agent/valory/trader/0.1.0": "bafybeigtfcgbgheepqwy2csg6mv6zn6elred2qvsmfdtdn7z66n7d2ashq", + "service/valory/trader/0.1.0": "bafybeigmpalhtvjzowehvrjwpo7whyhwnkyih3eqywvhharbcge3qgnwma", + "service/valory/trader_pearl/0.1.0": "bafybeiajduerdhztmreyv5ziyf6kuqr54ykfnkxb4ed7dufgm64muor2we" }, "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 2eb91b62a..f495cc95b 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -45,10 +45,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:bafybeidh2heva4vzg5o6mlhwfnsrfudjiemuhjislb7whxp3khn3mcaxgu +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigaw742u3t4vrrdmc4dbqszfexuaxifr4i5ent5nfayaalzj6pely - valory/market_manager_abci:0.1.0:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 -- valory/decision_maker_abci:0.1.0:bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye -- valory/trader_abci:0.1.0:bafybeietnfgxhyb5zan2hdeagwvwjm2sg2cqsyzz627wka66a6m3xfn3di +- valory/decision_maker_abci:0.1.0:bafybeie3hsdpcbsz7njcjz6ntld5t5jdb6c2usgtg6q4zfibmsux3qrq3m +- valory/trader_abci:0.1.0:bafybeics7hoohukzjnbazs7puelzuhm6qsstaoe32nuvcfjy7whlsra654 - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 086d599fd..c1157dfe3 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:bafybeihqurhq4qwcktjnfd42zjk5ttoqmxjvh3hha4mfm56jhxkpqzgy3m +agent: valory/trader:0.1.0:bafybeigtfcgbgheepqwy2csg6mv6zn6elred2qvsmfdtdn7z66n7d2ashq 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 6a5bab659..a4b2b5893 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:bafybeihqurhq4qwcktjnfd42zjk5ttoqmxjvh3hha4mfm56jhxkpqzgy3m +agent: valory/trader:0.1.0:bafybeigtfcgbgheepqwy2csg6mv6zn6elred2qvsmfdtdn7z66n7d2ashq number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py index 1521039d9..0bf228d07 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/sell_outcome_token.py @@ -61,7 +61,7 @@ def outcome_index(self) -> int: @property def return_amount(self) -> int: - """Get the amount expected to be returned after the sell tx.""" + """Get the amount expected to be returned after the sell tx is completed.""" previous_vote = self.synchronized_data.previous_vote if previous_vote == 0: diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 8b577be7f..b58ef666a 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -26,7 +26,7 @@ fingerprint: behaviours/reedem.py: bafybeidjmhh6c6shbg25d7exmc4nnp4heqbqselwuxj7rp2ss665lrytxe behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i behaviours/sampling.py: bafybeihe2waj53xrhonw4mgipagsgl3xoorcwzuqzyxwhn3mw7mjyeewfa - behaviours/sell_outcome_token.py: bafybeigdqptpafcse7qemq4u72ofcfwdzonyj437fhtu5krhjvrif6cmqu + behaviours/sell_outcome_token.py: bafybeicjpqnukexia457s73yp34yvgefpkgaikainmjf3sxgdk5c4kfqba behaviours/storage_manager.py: bafybeiez6daaj2bufxdcsghtmqybyrzdh74z26cc4ajsqsiy5krgjo2tla behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 0e1c2fdce..50f5e22fc 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:bafybeidjcrfbucn2tcv5hhkubsj3rg23aelcwustirnlikrp5tmtpz3wf4 -- valory/decision_maker_abci:0.1.0:bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeidh2heva4vzg5o6mlhwfnsrfudjiemuhjislb7whxp3khn3mcaxgu +- valory/decision_maker_abci:0.1.0:bafybeie3hsdpcbsz7njcjz6ntld5t5jdb6c2usgtg6q4zfibmsux3qrq3m +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigaw742u3t4vrrdmc4dbqszfexuaxifr4i5ent5nfayaalzj6pely - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni - 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 8d2a76234..29eec48a5 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:bafybeif6bzsne6sb7j5ghm33r2krxn2q65pqtavxynboimowrd22e6ikye +- valory/decision_maker_abci:0.1.0:bafybeie3hsdpcbsz7njcjz6ntld5t5jdb6c2usgtg6q4zfibmsux3qrq3m - valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i - valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm behaviours: From d234b5e8d9c23cd33247e50528a3ef86072c9560 Mon Sep 17 00:00:00 2001 From: Anna Sambrook <83281726+annasambrook@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:46:02 +0000 Subject: [PATCH 27/29] Update packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py fix: replace approval tx with status Co-authored-by: Adamantios Zaras --- .../skills/decision_maker_abci/behaviours/bet_placement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c8038cbaf..92a78df03 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py @@ -99,7 +99,7 @@ def _build_exchange_tx(self) -> WaitableConditionType: def _build_approval_tx(self) -> WaitableConditionType: """Build an ERC20 approve transaction.""" - approval_tx = yield from self.build_approval_tx( + status = yield from self.build_approval_tx( self.investment_amount, self.market_maker_contract_address, self.collateral_token, From 235881bc1d8bb1b56ddaa177a926a23b3665116a Mon Sep 17 00:00:00 2001 From: Anna Sambrook <83281726+annasambrook@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:46:39 +0000 Subject: [PATCH 28/29] Update packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py Co-authored-by: Adamantios Zaras --- .../skills/decision_maker_abci/behaviours/bet_placement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 92a78df03..96b59ac87 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py @@ -104,7 +104,7 @@ def _build_approval_tx(self) -> WaitableConditionType: self.market_maker_contract_address, self.collateral_token, ) - return approval_tx + return status def _calc_buy_amount(self) -> WaitableConditionType: """Calculate the buy amount of the conditional token.""" From be112ad59188873fb99f5b0d5e99239374802738 Mon Sep 17 00:00:00 2001 From: Anna Sambrook <83281726+annasambrook@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:09:46 +0000 Subject: [PATCH 29/29] Update packages/valory/skills/market_manager_abci/bets.py Co-authored-by: Keshav Mishra --- packages/valory/skills/market_manager_abci/bets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/valory/skills/market_manager_abci/bets.py b/packages/valory/skills/market_manager_abci/bets.py index 5bf14ebb0..7bca18498 100644 --- a/packages/valory/skills/market_manager_abci/bets.py +++ b/packages/valory/skills/market_manager_abci/bets.py @@ -190,7 +190,10 @@ def __post_init__(self) -> None: self._validate() self._cast() self._check_usefulness() - self.investments = {self.yes: [], self.no: []} + if self.outcomes: + self.investments = {self.yes: [], self.no: []} + else: + self.investments = {} def __lt__(self, other: "Bet") -> bool: """Implements less than operator."""