diff --git a/packages/packages.json b/packages/packages.json index 4208a3840..b79376665 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,17 +1,17 @@ { "dev": { "skill/valory/market_manager_abci/0.1.0": "bafybeidropskas24c4lcekzdbwoflhnzaglmeqxvpyuoa7cf7q2rf2yex4", - "skill/valory/decision_maker_abci/0.1.0": "bafybeihcwzgpl5cgxmbi2ttqum5khnryxnp3cdrxm64q6dgerjr7weqk2m", - "skill/valory/trader_abci/0.1.0": "bafybeic7ztyme3wlzdykvnnpxvaxxpy4byqjxt6uunoalbz7etzo6uhfza", + "skill/valory/decision_maker_abci/0.1.0": "bafybeigwmf5lrwsq4rvwmcmvdejbwcwb6zkndx5tcpljf4vvvb7fvz7nwe", + "skill/valory/trader_abci/0.1.0": "bafybeidw6qlawxhfjgvoul2lmgxx6c5hx6ehkxa6isy5fjtif4akkrskta", "contract/valory/market_maker/0.1.0": "bafybeif4mm2s3gxtvp227yypkcnna5ftec7vajcftvtbdmqddh7nprah5m", - "agent/valory/trader/0.1.0": "bafybeid2e66zg5gx33xskdxmfcw7vtluvy4bwnoda3ouchu6rsmhtlkgsi", - "service/valory/trader/0.1.0": "bafybeicdmgkvyefq4fn4amoqhtfi4h5bgbidwt57fwerlpziaon3rsvmzi", + "agent/valory/trader/0.1.0": "bafybeibq5he4r5okaleh7ysnoeusbmaxu7obcxiwb4obaoks6s3ai6jaea", + "service/valory/trader/0.1.0": "bafybeifgp6ml5xsjzyeehi6737fiulcupkbyjimlyfmnfg6s6nsrljol64", "contract/valory/erc20/0.1.0": "bafybeibysifjwhlcn7nntsjkowdmja53ed6urfzypi6sxfc7chtheecvpi", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeif22r6jg3lptvm2jwyxpozr4wdk63j52rpnmkq7fepst4s4dt4auq", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeica2fsr66v7q4emhfrjsy5olplnb6asty6y4wzq76jgsvjqjii7fe", "contract/valory/mech/0.1.0": "bafybeifaavuqr2bz7nypapjwkufc5c6vwxm5ifucmtd3w7sh42tne35nga", - "contract/valory/realitio/0.1.0": "bafybeic3wihpzz4deguslpzlnsgrlrabclq3njwuagyaiiv6rzqujfrs6e", + "contract/valory/realitio/0.1.0": "bafybeid6kh4tiqswpeufkr7eowmq7seoyhkssnedgzw6pe4h7wswui6dlm", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", - "contract/valory/conditional_tokens/0.1.0": "bafybeicbkivacygycd26mqwvsp4c7velo2lpbxzwmrsgxg65prnvri6yoi", + "contract/valory/conditional_tokens/0.1.0": "bafybeifov35k2ifwagzyfvl7km6je6tmyvcqgrccldob3zmbx2af2wzque", "contract/valory/agent_registry/0.1.0": "bafybeifwdtwxdc2jdlhzdyxctqdmoz6zroxf5o4nhuok5l4luvnofqavty" }, "third_party": { diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 5ee3372b2..0719f954d 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -22,9 +22,10 @@ contracts: - valory/erc20:0.1.0:bafybeibysifjwhlcn7nntsjkowdmja53ed6urfzypi6sxfc7chtheecvpi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeifaavuqr2bz7nypapjwkufc5c6vwxm5ifucmtd3w7sh42tne35nga -- valory/conditional_tokens:0.1.0:bafybeicbkivacygycd26mqwvsp4c7velo2lpbxzwmrsgxg65prnvri6yoi -- valory/realitio:0.1.0:bafybeic3wihpzz4deguslpzlnsgrlrabclq3njwuagyaiiv6rzqujfrs6e +- valory/conditional_tokens:0.1.0:bafybeifov35k2ifwagzyfvl7km6je6tmyvcqgrccldob3zmbx2af2wzque +- valory/realitio:0.1.0:bafybeid6kh4tiqswpeufkr7eowmq7seoyhkssnedgzw6pe4h7wswui6dlm - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 +- valory/agent_registry:0.1.0:bafybeifwdtwxdc2jdlhzdyxctqdmoz6zroxf5o4nhuok5l4luvnofqavty protocols: - open_aea/signing:1.0.0:bafybeie7xyems76v5b4wc2lmaidcujizpxfzjnnwdeokmhje53g7ym25ii - valory/abci:0.1.0:bafybeihmzlmmb4pdo3zkhg6ehuyaa4lhw7bfpclln2o2z7v3o6fcep26iu @@ -41,10 +42,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeicpxn2khtaesuf4cq6ypwdmdmonlqroj2q2i6cxvpizc2y4cw66pe - valory/termination_abci:0.1.0:bafybeieqm46zuccaagnko3qlw6p3nvoohdrfgvpmw467r5lyil2dqrzjsy - valory/transaction_settlement_abci:0.1.0:bafybeia6cdxdlqrcwk2maw25fo7dafzd2p3rs7syropvufophk2pitzbwy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif22r6jg3lptvm2jwyxpozr4wdk63j52rpnmkq7fepst4s4dt4auq +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeica2fsr66v7q4emhfrjsy5olplnb6asty6y4wzq76jgsvjqjii7fe - valory/market_manager_abci:0.1.0:bafybeidropskas24c4lcekzdbwoflhnzaglmeqxvpyuoa7cf7q2rf2yex4 -- valory/decision_maker_abci:0.1.0:bafybeihcwzgpl5cgxmbi2ttqum5khnryxnp3cdrxm64q6dgerjr7weqk2m -- valory/trader_abci:0.1.0:bafybeic7ztyme3wlzdykvnnpxvaxxpy4byqjxt6uunoalbz7etzo6uhfza +- valory/decision_maker_abci:0.1.0:bafybeigwmf5lrwsq4rvwmcmvdejbwcwb6zkndx5tcpljf4vvvb7fvz7nwe +- valory/trader_abci:0.1.0:bafybeidw6qlawxhfjgvoul2lmgxx6c5hx6ehkxa6isy5fjtif4akkrskta default_ledger: ethereum required_ledgers: - ethereum @@ -184,6 +185,7 @@ models: conditional_tokens_address: ${str:0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce} realitio_proxy_address: ${str:0xAB16D643bA051C11962DA645f74632d3130c81E2} realitio_address: ${str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57} + event_filtering_batch_size: ${int:5000} redeeming_batch_size: ${int:5} slippage: ${float:0.01} policy_epsilon: ${float:0.1} diff --git a/packages/valory/contracts/conditional_tokens/contract.py b/packages/valory/contracts/conditional_tokens/contract.py index a4d5c39d0..157f72dbe 100644 --- a/packages/valory/contracts/conditional_tokens/contract.py +++ b/packages/valory/contracts/conditional_tokens/contract.py @@ -19,7 +19,7 @@ """This module contains the conditional tokens contract definition.""" -from typing import List, Dict +from typing import List from requests.exceptions import ReadTimeout as RequestsReadTimeoutError from urllib3.exceptions import ReadTimeoutError as Urllib3ReadTimeoutError @@ -28,11 +28,6 @@ from aea.contracts.base import Contract from aea.crypto.base import LedgerApi from hexbytes import HexBytes -from web3.types import BlockIdentifier - - -DEFAULT_FROM_BLOCK = "earliest" -DEFAULT_TO_BLOCK = "latest" class ConditionalTokensContract(Contract): @@ -46,51 +41,35 @@ def check_redeemed( ledger_api: LedgerApi, contract_address: str, redeemer: str, + from_block: int, + to_block: int, collateral_tokens: List[str], parent_collection_ids: List[bytes], condition_ids: List[HexBytes], index_sets: List[List[int]], - from_block_numbers: Dict[HexBytes, BlockIdentifier], - chunk_size: int = 5_000, ) -> JSONLike: """Filter to find out whether a position has already been redeemed.""" - earliest_block = DEFAULT_FROM_BLOCK - - for condition_id, from_block in from_block_numbers.items(): - if ( - isinstance(earliest_block, int) - and earliest_block > from_block - or earliest_block == DEFAULT_FROM_BLOCK - ): - earliest_block = from_block - contract_instance = cls.get_instance(ledger_api, contract_address) to_checksum = ledger_api.api.to_checksum_address redeemer_checksummed = to_checksum(redeemer) collateral_tokens_checksummed = [ to_checksum(token) for token in collateral_tokens ] - latest_block = ledger_api.api.eth.block_number try: - redeemed = [] - for from_block in range(earliest_block, latest_block, chunk_size): - to_block = min(from_block + chunk_size, latest_block) - payout_filter = contract_instance.events.PayoutRedemption.build_filter() - payout_filter.args.redeemer.match_single(redeemer_checksummed) - payout_filter.args.collateralToken.match_any(*collateral_tokens_checksummed) - payout_filter.args.parentCollectionId.match_any(*parent_collection_ids) - payout_filter.args.conditionId.match_any(*condition_ids) - payout_filter.args.indexSets.match_any(*index_sets) - payout_filter.fromBlock = from_block - payout_filter.toBlock = to_block - redeemed_chunk = list(payout_filter.deploy(ledger_api.api).get_all_entries()) - redeemed.extend(redeemed_chunk) + payout_filter = contract_instance.events.PayoutRedemption.build_filter() + payout_filter.args.redeemer.match_single(redeemer_checksummed) + payout_filter.args.collateralToken.match_any(*collateral_tokens_checksummed) + payout_filter.args.parentCollectionId.match_any(*parent_collection_ids) + payout_filter.args.conditionId.match_any(*condition_ids) + payout_filter.args.indexSets.match_any(*index_sets) + payout_filter.fromBlock = from_block + payout_filter.toBlock = to_block + redeemed = list(payout_filter.deploy(ledger_api.api).get_all_entries()) except (Urllib3ReadTimeoutError, RequestsReadTimeoutError): msg = ( "The RPC timed out! This usually happens if the filtering is too wide. " - f"The service tried to filter from block {earliest_block} to latest, with a step {chunk_size}," - f"as the earliest market creation transaction took place at block {earliest_block}. " - f"If this issue persists, please try lowering the step size!" + f"The service tried to filter from block {from_block} to {to_block}." + f"If this issue persists, please try lowering the `EVENT_FILTERING_BATCH_SIZE`!" ) return dict(error=msg) diff --git a/packages/valory/contracts/conditional_tokens/contract.yaml b/packages/valory/contracts/conditional_tokens/contract.yaml index 03acd85ac..638425b19 100644 --- a/packages/valory/contracts/conditional_tokens/contract.yaml +++ b/packages/valory/contracts/conditional_tokens/contract.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeidhdxio3oq5gqdnxmngumvt3fcd6zyiyrpk5f2k4dwhflbg4e5iky build/ConditionalTokens.json: bafybeia2ahis7zx2yhhf23kpkcxu56hto6fwg6ptjg5ld46lp4dgz7cz3e - contract.py: bafybeie73lgxfuhqhksqqm6mthwqyw3rau2h2eul6mp7vyswpv37vgyz2a + contract.py: bafybeigzlqbxka2fxjt2ho26ppryvf2lcxecorwtcmfybu4bhqnmpfgqri fingerprint_ignore_patterns: [] class_name: ConditionalTokensContract contract_interface_paths: diff --git a/packages/valory/contracts/realitio/contract.py b/packages/valory/contracts/realitio/contract.py index d3cdc772c..cbf501ae6 100644 --- a/packages/valory/contracts/realitio/contract.py +++ b/packages/valory/contracts/realitio/contract.py @@ -19,20 +19,19 @@ """This module contains the Realitio_v2_1 contract definition.""" -from typing import List, Tuple, Union +from typing import List, Tuple, Union, Dict -from requests.exceptions import ReadTimeout as RequestsReadTimeoutError -from urllib3.exceptions import ReadTimeoutError as Urllib3ReadTimeoutError from aea.common import JSONLike from aea.configurations.base import PublicId from aea.contracts.base import Contract from aea.crypto.base import LedgerApi from eth_typing import ChecksumAddress -from web3.constants import HASH_ZERO -from web3.types import BlockIdentifier +from requests.exceptions import ReadTimeout as RequestsReadTimeoutError +from urllib3.exceptions import ReadTimeoutError as Urllib3ReadTimeoutError -ZERO_HEX = HASH_ZERO[2:] -ZERO_BYTES = bytes.fromhex(ZERO_HEX) +ClaimParamsType = Tuple[ + List[bytes], List[ChecksumAddress], List[int], List[bytes] +] class RealitioContract(Contract): @@ -53,82 +52,53 @@ def check_finalized( return dict(finalized=is_finalized) @classmethod - def _get_claim_params( + def get_claim_params( cls, ledger_api: LedgerApi, contract_address: str, - from_block: BlockIdentifier, + from_block: int, + to_block: int, question_id: bytes, - chunk_size: int = 5_000, - ) -> Union[str, Tuple[bytes, List[bytes], List[ChecksumAddress], List[int], List[bytes]]]: + ) -> Dict[str, Union[str, list]]: """Filters the `LogNewAnswer` event by question id to calculate the history hashes.""" contract_instance = cls.get_instance(ledger_api, contract_address) - to_block = ledger_api.api.eth.block_number try: - answered = [] - for chunk in range(from_block, to_block, chunk_size): - answer_filter = contract_instance.events.LogNewAnswer.build_filter() - answer_filter.fromBlock = chunk - answer_filter.toBlock = min(chunk + chunk_size, to_block) - answer_filter.args.question_id.match_single(question_id) - answered.extend(list(answer_filter.deploy(ledger_api.api).get_all_entries())) + answer_filter = contract_instance.events.LogNewAnswer.build_filter() + answer_filter.fromBlock = from_block + answer_filter.toBlock = to_block + answer_filter.args.question_id.match_single(question_id) + answered = list(answer_filter.deploy(ledger_api.api).get_all_entries()) except (Urllib3ReadTimeoutError, RequestsReadTimeoutError): msg = ( "The RPC timed out! This usually happens if the filtering is too wide. " - f"The service tried to filter from block {from_block} to latest, " - "as the market was created at this time. Did the market get created too long in the past?\n" - "Please consider manually redeeming for the market with question id " - f"{question_id!r} if this issue persists." + f"The service tried to filter from block {from_block} to {to_block}." + f"If this issue persists, please try lowering the `EVENT_FILTERING_BATCH_SIZE`!" ) - return msg - else: - n_answered = len(answered) - - if n_answered == 0: - msg = f"No answers have been given for question with id {question_id.hex()}!" - return msg + return dict(error=msg) - history_hashes = [] - addresses = [] - bonds = [] - answers = [] - for i, answer in enumerate(reversed(answered)): - # history_hashes second-last-to-first, the hash of each history entry, calculated as described here: - # https://realitio.github.io/docs/html/contract_explanation.html#answer-history-entries. - if i == n_answered - 1: - history_hashes.append(ZERO_BYTES) - else: - history_hashes.append(answered[i + 1]["args"]["history_hash"]) - - # last-to-first, the address of each answerer or commitment sender - addresses.append(answer["args"]["user"]) - # last-to-first, the bond supplied with each answer or commitment - bonds.append(answer["args"]["bond"]) - # last-to-first, each answer supplied, or commitment ID if the answer was supplied with commit->reveal - answers.append(answer["args"]["answer"]) + if len(answered) == 0: + msg = ( + f"No answers have been given for question with id {question_id.hex()} " + f"between blocks {from_block} and {to_block}." + ) + return dict(info=msg) - return question_id, history_hashes, addresses, bonds, answers + return dict(answered=answered) @classmethod def build_claim_winnings( cls, ledger_api: LedgerApi, contract_address: str, - from_block: BlockIdentifier, question_id: bytes, + claim_params: ClaimParamsType, ) -> JSONLike: """Build `claimWinnings` transaction.""" contract = cls.get_instance(ledger_api, contract_address) - claim_params = cls._get_claim_params( - ledger_api, contract_address, from_block, question_id - ) - if isinstance(claim_params, str): - return dict(error=claim_params) - data = contract.encodeABI( fn_name="claimWinnings", - args=claim_params, + args=(question_id, *claim_params), ) return dict(data=data) diff --git a/packages/valory/contracts/realitio/contract.yaml b/packages/valory/contracts/realitio/contract.yaml index 3ec5122b9..bf6f146b4 100644 --- a/packages/valory/contracts/realitio/contract.yaml +++ b/packages/valory/contracts/realitio/contract.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeictahkgfmlqv5kksvj6klmxtmjdpeq4sp3x7dp2yr5x4kmzbcihse build/Realitio.json: bafybeiagi7zoeoy5s7duhg4oeuekj2s6z5mad2z6g2pn3n5elsvze25qiu - contract.py: bafybeibkmmgybvqu7tf6angouhrqmqzf6cu5piwu7jt5l4ddlren7fhkdy + contract.py: bafybeiawjv5qeouf6wac5adqzeudl5loaya3mszhc65whb22shsvivjwxm fingerprint_ignore_patterns: [] class_name: RealitioContract contract_interface_paths: diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index dc1830eb6..747b2cc2b 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:bafybeid2e66zg5gx33xskdxmfcw7vtluvy4bwnoda3ouchu6rsmhtlkgsi +agent: valory/trader:0.1.0:bafybeibq5he4r5okaleh7ysnoeusbmaxu7obcxiwb4obaoks6s3ai6jaea number_of_agents: 4 deployment: {} --- @@ -101,6 +101,7 @@ type: skill conditional_tokens_address: ${CONDITIONAL_TOKENS_ADDRESS:str:0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce} realitio_proxy_address: ${REALITIO_PROXY_ADDRESS:str:0xAB16D643bA051C11962DA645f74632d3130c81E2} realitio_address: ${REALITIO_ADDRESS:str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57} + event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -170,6 +171,7 @@ type: skill conditional_tokens_address: ${CONDITIONAL_TOKENS_ADDRESS:str:0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce} realitio_proxy_address: ${REALITIO_PROXY_ADDRESS:str:0xAB16D643bA051C11962DA645f74632d3130c81E2} realitio_address: ${REALITIO_ADDRESS:str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57} + event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -237,6 +239,7 @@ type: skill conditional_tokens_address: ${CONDITIONAL_TOKENS_ADDRESS:str:0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce} realitio_proxy_address: ${REALITIO_PROXY_ADDRESS:str:0xAB16D643bA051C11962DA645f74632d3130c81E2} realitio_address: ${REALITIO_ADDRESS:str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57} + event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} @@ -304,6 +307,7 @@ type: skill conditional_tokens_address: ${CONDITIONAL_TOKENS_ADDRESS:str:0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce} realitio_proxy_address: ${REALITIO_PROXY_ADDRESS:str:0xAB16D643bA051C11962DA645f74632d3130c81E2} realitio_address: ${REALITIO_ADDRESS:str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57} + event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000} redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1} slippage: ${SLIPPAGE:float:0.01} policy_epsilon: ${POLICY_EPSILON:float:0.1} diff --git a/packages/valory/skills/decision_maker_abci/behaviours/base.py b/packages/valory/skills/decision_maker_abci/behaviours/base.py index ed7cebcea..0f6d5f669 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/base.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/base.py @@ -42,6 +42,7 @@ from packages.valory.skills.decision_maker_abci.models import ( DecisionMakerParams, MultisendBatch, + SharedState, ) from packages.valory.skills.decision_maker_abci.policy import EGreedyPolicy from packages.valory.skills.decision_maker_abci.states.base import SynchronizedData @@ -88,6 +89,11 @@ def params(self) -> DecisionMakerParams: """Return the params.""" return cast(DecisionMakerParams, self.context.params) + @property + def shared_state(self) -> SharedState: + """Get the shared state.""" + return cast(SharedState, self.context.state) + @property def synchronized_data(self) -> SynchronizedData: """Return the synchronized data.""" diff --git a/packages/valory/skills/decision_maker_abci/behaviours/reedem.py b/packages/valory/skills/decision_maker_abci/behaviours/reedem.py index aee5073bd..5e4732233 100644 --- a/packages/valory/skills/decision_maker_abci/behaviours/reedem.py +++ b/packages/valory/skills/decision_maker_abci/behaviours/reedem.py @@ -21,7 +21,6 @@ import json from abc import ABC -from collections import defaultdict from sys import maxsize from typing import Any, Dict, Generator, Iterator, List, Optional, Set, Union @@ -34,12 +33,16 @@ from packages.valory.contracts.realitio.contract import RealitioContract from packages.valory.contracts.realitio_proxy.contract import RealitioProxyContract from packages.valory.protocols.contract_api import ContractApiMessage -from packages.valory.skills.abstract_round_abci.base import get_name +from packages.valory.protocols.ledger_api import LedgerApiMessage +from packages.valory.skills.abstract_round_abci.base import BaseTxPayload, get_name from packages.valory.skills.decision_maker_abci.behaviours.base import ( DecisionMakerBaseBehaviour, WaitableConditionType, ) -from packages.valory.skills.decision_maker_abci.models import MultisendBatch +from packages.valory.skills.decision_maker_abci.models import ( + MultisendBatch, + RedeemingProgress, +) from packages.valory.skills.decision_maker_abci.payloads import RedeemPayload from packages.valory.skills.decision_maker_abci.redeem_info import ( Condition, @@ -55,10 +58,8 @@ ZERO_HEX = HASH_ZERO[2:] ZERO_BYTES = bytes.fromhex(ZERO_HEX) -DEFAULT_FROM_BLOCK = "earliest" - - -FromBlockMappingType = Dict[HexBytes, Union[int, str]] +BLOCK_NUMBER_KEY = "number" +DEFAULT_TO_BLOCK = "latest" class RedeemInfoBehaviour(DecisionMakerBaseBehaviour, QueryingBehaviour, ABC): @@ -69,11 +70,7 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) self.utilized_tools: Dict[str, int] = {} self.trades: Set[Trade] = set() - - # blocks in which the markets were created mapped to the corresponding condition ids - self.from_block_mapping: FromBlockMappingType = defaultdict( - lambda: DEFAULT_FROM_BLOCK - ) + self.earliest_block_number: int = 0 # this is a mapping from condition id to amount # the purpose of this attribute is to rectify the claimable amount within a redeeming information object. @@ -102,14 +99,13 @@ def _set_block_number(self, trade: Trade) -> Generator: if self._fetch_status != FetchStatus.IN_PROGRESS: break - condition_id = trade.fpmm.condition.id if self._fetch_status == FetchStatus.SUCCESS: block_number = block.get("id", "") if block_number.isdigit(): - self.from_block_mapping[condition_id] = int(block_number) + self.earliest_block_number = int(block_number) self.context.logger.info( - f"Chose block number {self.from_block_mapping[condition_id]!r} as closest to timestamp {timestamp!r}" + f"Chose block number {self.earliest_block_number!r} as closest to timestamp {timestamp!r}" ) def _update_policy(self, update: Trade) -> None: @@ -147,6 +143,7 @@ def update_redeem_info(self, chunk: list) -> Generator: <= self.synced_timestamp ) + is_first_update = True for update in trades_updates: self._update_policy(update) @@ -154,11 +151,14 @@ def update_redeem_info(self, chunk: list) -> Generator: if not update.is_winning: continue + if is_first_update: + yield from self._set_block_number(update) + is_first_update = False + condition_id = update.fpmm.condition.id - # If not in the trades, add it as is, along with its corresponding block number and claimable amount + # If not in the trades, add it as is, along with its claimable amount if update not in self.trades: self.trades.add(update) - yield from self._set_block_number(update) self.claimable_amounts[condition_id] = update.claimable_amount continue @@ -181,6 +181,8 @@ class RedeemBehaviour(RedeemInfoBehaviour): def __init__(self, **kwargs: Any) -> None: """Initialize `RedeemBehaviour`.""" super().__init__(**kwargs) + self._claim_params_batch: list = [] + self._latest_block_number: Optional[int] = None self._finalized: bool = False self._already_resolved: bool = False self._payouts: Dict[str, int] = {} @@ -189,6 +191,33 @@ def __init__(self, **kwargs: Any) -> None: self._expected_winnings: int = 0 self._history_hash: bytes = ZERO_BYTES + @property + def redeeming_progress(self) -> RedeemingProgress: + """Get the redeeming check progress from the shared state.""" + return self.shared_state.redeeming_progress + + @redeeming_progress.setter + def redeeming_progress(self, payouts: RedeemingProgress) -> None: + """Set the redeeming check progress in the shared state.""" + self.shared_state.redeeming_progress = payouts + + @property + def latest_block_number(self) -> int: + """Get the latest block number.""" + if self._latest_block_number is None: + error = "Attempting to retrieve the latest block number, but it hasn't been set yet." + raise ValueError(error) + return self._latest_block_number + + @latest_block_number.setter + def latest_block_number(self, latest_block_number: str) -> None: + """Set the latest block number.""" + try: + self._latest_block_number = int(latest_block_number) + except (TypeError, ValueError) as exc: + error = f"{latest_block_number=} cannot be converted to a valid integer." + raise ValueError(error) from exc + @property def current_redeem_info(self) -> Trade: """Get the current redeem info.""" @@ -237,12 +266,12 @@ def is_dust(self) -> bool: return self.current_claimable_amount < self.params.dust_threshold @property - def payouts(self) -> Dict[str, int]: + def payouts_batch(self) -> Dict[str, int]: """Get the trades' transaction hashes mapped to payouts for the current market.""" return self._payouts - @payouts.setter - def payouts(self, payouts: Dict[str, int]) -> None: + @payouts_batch.setter + def payouts_batch(self, payouts: Dict[str, int]) -> None: """Set the trades' transaction hashes mapped to payouts for the current market.""" self._payouts = payouts @@ -281,6 +310,16 @@ def already_resolved(self, flag: bool) -> None: """Set whether the current market has already been resolved.""" self._already_resolved = flag + @property + def claim_params_batch(self) -> list: + """Get the current batch of the claim parameters.""" + return self._claim_params_batch + + @claim_params_batch.setter + def claim_params_batch(self, claim_params_batch: list) -> None: + """Set the current batch of the claim parameters.""" + self._claim_params_batch = claim_params_batch + @property def built_data(self) -> HexBytes: """Get the built transaction's data.""" @@ -291,6 +330,22 @@ def built_data(self, built_data: Union[str, bytes]) -> None: """Set the built transaction's data.""" self._built_data = HexBytes(built_data) + def _store_progress(self) -> None: + """Store the redeeming progress.""" + self.redeeming_progress.trades = self.trades + self.redeeming_progress.utilized_tools = self.utilized_tools + self.redeeming_progress.policy = self.policy + self.redeeming_progress.claimable_amounts = self.claimable_amounts + self.redeeming_progress.earliest_block_number = self.earliest_block_number + + def _load_progress(self) -> None: + """Load the redeeming progress.""" + self.trades = self.redeeming_progress.trades + self.utilized_tools = self.redeeming_progress.utilized_tools + self._policy = self.redeeming_progress.policy + self.claimable_amounts = self.redeeming_progress.claimable_amounts + self.earliest_block_number = self.redeeming_progress.earliest_block_number + def _get_redeem_info( self, ) -> Generator: @@ -321,11 +376,25 @@ def _conditional_tokens_interact( ) return status + def _get_latest_block(self) -> WaitableConditionType: + """Get the latest block's timestamp.""" + ledger_api_response = yield from self.get_ledger_api_response( + performative=LedgerApiMessage.Performative.GET_STATE, # type: ignore + ledger_callable="get_block", + block_identifier=DEFAULT_TO_BLOCK, + ) + if ledger_api_response.performative != LedgerApiMessage.Performative.STATE: + self.context.logger.error(f"Failed to get block: {ledger_api_response}") + return False + self.latest_block_number = ledger_api_response.state.body.get(BLOCK_NUMBER_KEY) + return True + def _check_already_redeemed(self) -> WaitableConditionType: """Check whether we have already redeemed for this bet.""" if len(self.trades) == 0: return True + safe_address_lower = self.synchronized_data.safe_contract_address.lower() kwargs: Dict[str, Any] = { key: [] for key in ( @@ -333,7 +402,6 @@ def _check_already_redeemed(self) -> WaitableConditionType: "parent_collection_ids", "condition_ids", "index_sets", - "from_block_numbers", ) } for trade in self.trades: @@ -342,28 +410,47 @@ def _check_already_redeemed(self) -> WaitableConditionType: kwargs["condition_ids"].append(trade.fpmm.condition.id) kwargs["index_sets"].append(trade.fpmm.condition.index_sets) - kwargs["from_block_numbers"] = self.from_block_mapping + if not self.redeeming_progress.check_started: + self.redeeming_progress.check_from_block = self.earliest_block_number + yield from self.wait_for_condition_with_sleep(self._get_latest_block) + self.redeeming_progress.check_to_block = self.latest_block_number + self.redeeming_progress.check_started = True + + batch_size = self.params.event_filtering_batch_size + for from_block in range( + self.redeeming_progress.check_from_block, + self.redeeming_progress.check_to_block, + batch_size, + ): + max_to_block = from_block + batch_size + to_block = min(max_to_block, self.redeeming_progress.check_to_block) + result = yield from self._conditional_tokens_interact( + contract_callable="check_redeemed", + data_key="payouts", + placeholder=get_name(RedeemBehaviour.payouts_batch), + redeemer=safe_address_lower, + from_block=from_block, + to_block=to_block, + **kwargs, + ) + if not result: + return False + self.redeeming_progress.payouts.update(self.payouts_batch) + self.redeeming_progress.check_from_block = to_block - safe_address_lower = self.synchronized_data.safe_contract_address.lower() - result = yield from self._conditional_tokens_interact( - contract_callable="check_redeemed", - data_key="payouts", - placeholder=get_name(RedeemBehaviour.payouts), - redeemer=safe_address_lower, - **kwargs, - ) - return result + return True def _clean_redeem_info(self) -> Generator: """Clean the redeeming information based on whether any positions have already been redeemed.""" yield from self.wait_for_condition_with_sleep(self._check_already_redeemed) - payout_so_far = sum(self.payouts.values()) + payout_so_far = sum(self.redeeming_progress.payouts.values()) if payout_so_far > 0: self.trades = { trade for trade in self.trades - if trade.fpmm.condition.id not in self.payouts.keys() + if trade.fpmm.condition.id not in self.redeeming_progress.payouts.keys() } + self.redeeming_progress.trades = self.trades msg = f"The total payout so far has been {self.wei_to_native(payout_so_far)} wxDAI." self.context.logger.info(msg) @@ -437,14 +524,49 @@ def _build_resolve_data(self) -> WaitableConditionType: self.multisend_batches.append(batch) return True + def get_claim_params(self) -> WaitableConditionType: + """Get the claim parameters using batches for the filtering events.""" + if not self.redeeming_progress.claim_started: + self.redeeming_progress.claim_from_block = self.earliest_block_number + self.redeeming_progress.claim_to_block = ( + self.redeeming_progress.check_to_block + ) + self.redeeming_progress.claim_started = True + + batch_size = self.params.event_filtering_batch_size + for from_block in range( + self.redeeming_progress.claim_from_block, + self.redeeming_progress.claim_to_block, + batch_size, + ): + max_to_block = from_block + batch_size + to_block = min(max_to_block, self.redeeming_progress.claim_to_block) + result = yield from self._conditional_tokens_interact( + contract_callable="get_claim_params", + data_key="claim_params", + placeholder=get_name(RedeemBehaviour.claim_params_batch), + from_block=from_block, + to_block=to_block, + question_id=self.current_question_id, + ) + if not result: + return False + self.redeeming_progress.answered.extend(self.claim_params_batch) + self.redeeming_progress.claim_from_block = to_block + + return True + def _build_claim_data(self) -> WaitableConditionType: """Prepare the safe tx to claim the winnings.""" + if not self.redeeming_progress.claim_finished: + yield from self.wait_for_condition_with_sleep(self.get_claim_params) + result = yield from self._realitio_interact( contract_callable="build_claim_winnings", data_key="data", placeholder=get_name(RedeemBehaviour.built_data), - from_block=self.from_block_mapping[self.current_condition_id], question_id=self.current_question_id, + claim_params=self.redeeming_progress.claim_params, ) if not result: @@ -593,11 +715,26 @@ def _store_utilized_tools(self) -> None: with path.open("w") as f: json.dump(self.utilized_tools, f) + def finish_behaviour(self, payload: BaseTxPayload) -> Generator: + """Finish the behaviour.""" + self.redeeming_progress = RedeemingProgress() + self._store_utilized_tools() + yield from super().finish_behaviour(payload) + def async_act(self) -> Generator: """Do the action.""" with self.context.benchmark_tool.measure(self.behaviour_id).local(): - yield from self._get_redeem_info() - yield from self._clean_redeem_info() + if not self.redeeming_progress.check_started: + yield from self._get_redeem_info() + self._store_progress() + else: + msg = "Picking up progress from where it was left off before the timeout occurred." + self.context.logger.info(msg) + self._load_progress() + + if not self.redeeming_progress.check_finished: + yield from self._clean_redeem_info() + agent = self.context.agent_address redeem_tx_hex = yield from self._prepare_safe_tx() tx_submitter = policy = utilized_tools = None @@ -609,5 +746,5 @@ def async_act(self) -> Generator: payload = RedeemPayload( agent, tx_submitter, redeem_tx_hex, policy, utilized_tools ) - self._store_utilized_tools() + yield from self.finish_behaviour(payload) diff --git a/packages/valory/skills/decision_maker_abci/models.py b/packages/valory/skills/decision_maker_abci/models.py index 059ca3135..2ea38d3ca 100644 --- a/packages/valory/skills/decision_maker_abci/models.py +++ b/packages/valory/skills/decision_maker_abci/models.py @@ -22,15 +22,19 @@ import json import os import re -from dataclasses import dataclass +from dataclasses import dataclass, field from pathlib import Path from string import Template -from typing import Any, Dict, Optional, Set +from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union from aea.exceptions import enforce +from aea.skills.base import SkillContext from hexbytes import HexBytes +from web3.constants import HASH_ZERO +from web3.types import BlockIdentifier from packages.valory.contracts.multisend.contract import MultiSendOperation +from packages.valory.skills.abstract_round_abci.base import AbciApp from packages.valory.skills.abstract_round_abci.models import ApiSpecs from packages.valory.skills.abstract_round_abci.models import ( BenchmarkTool as BaseBenchmarkTool, @@ -39,12 +43,21 @@ from packages.valory.skills.abstract_round_abci.models import ( SharedState as BaseSharedState, ) +from packages.valory.skills.decision_maker_abci.policy import EGreedyPolicy +from packages.valory.skills.decision_maker_abci.redeem_info import Trade from packages.valory.skills.decision_maker_abci.rounds import DecisionMakerAbciApp from packages.valory.skills.market_manager_abci.models import MarketManagerParams +FromBlockMappingType = Dict[HexBytes, Union[int, str]] +ClaimParamsType = Tuple[List[bytes], List[str], List[int], List[bytes]] + + RE_CONTENT_IN_BRACKETS = r"\{([^}]*)\}" REQUIRED_BET_TEMPLATE_KEYS = {"yes", "no", "question"} +DEFAULT_FROM_BLOCK = "earliest" +ZERO_HEX = HASH_ZERO[2:] +ZERO_BYTES = bytes.fromhex(ZERO_HEX) class PromptTemplate(Template): @@ -57,10 +70,68 @@ class PromptTemplate(Template): BenchmarkTool = BaseBenchmarkTool +@dataclass +class RedeemingProgress: + """A structure to keep track of the redeeming check progress.""" + + trades: Set[Trade] = field(default_factory=lambda: set()) + utilized_tools: Dict[str, int] = field(default_factory=lambda: {}) + policy: Optional[EGreedyPolicy] = None + claimable_amounts: Dict[HexBytes, int] = field(default_factory=lambda: {}) + earliest_block_number: int = 0 + check_started: bool = False + check_from_block: BlockIdentifier = "earliest" + check_to_block: BlockIdentifier = "latest" + payouts: Dict[str, int] = field(default_factory=lambda: {}) + claim_started: bool = False + claim_from_block: BlockIdentifier = "earliest" + claim_to_block: BlockIdentifier = "latest" + answered: list = field(default_factory=lambda: []) + + @property + def check_finished(self) -> bool: + """Whether the check has finished.""" + return self.check_started and self.check_from_block == self.check_to_block + + @property + def claim_finished(self) -> bool: + """Whether the claiming has finished.""" + return self.claim_started and self.claim_from_block == self.claim_to_block + + @property + def claim_params(self) -> ClaimParamsType: + """The claim parameters, prepared for the `claimWinnings` call.""" + history_hashes = [] + addresses = [] + bonds = [] + answers = [] + for i, answer in enumerate(reversed(self.answered)): + # history_hashes second-last-to-first, the hash of each history entry, calculated as described here: + # https://realitio.github.io/docs/html/contract_explanation.html#answer-history-entries. + if i == len(self.answered) - 1: + history_hashes.append(ZERO_BYTES) + else: + history_hashes.append(self.answered[i + 1]["args"]["history_hash"]) + + # last-to-first, the address of each answerer or commitment sender + addresses.append(answer["args"]["user"]) + # last-to-first, the bond supplied with each answer or commitment + bonds.append(answer["args"]["bond"]) + # last-to-first, each answer supplied, or commitment ID if the answer was supplied with commit->reveal + answers.append(answer["args"]["answer"]) + + return history_hashes, addresses, bonds, answers + + class SharedState(BaseSharedState): """Keep the current shared state of the skill.""" - abci_app_cls = DecisionMakerAbciApp + abci_app_cls: Type[AbciApp] = DecisionMakerAbciApp + + def __init__(self, *args: Any, skill_context: SkillContext, **kwargs: Any) -> None: + """Initialize the state.""" + super().__init__(*args, skill_context=skill_context, **kwargs) + self.redeeming_progress: RedeemingProgress = RedeemingProgress() def extract_keys_from_template(delimiter: str, template: str) -> Set[str]: @@ -118,6 +189,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: "realitio_proxy_address", kwargs, str ) self.realitio_address = self._ensure("realitio_address", kwargs, str) + # this is the maximum batch size that will be used when filtering blocks for events. + # increasing this number allows for faster filtering operations, + # but also increases the chances of getting a timeout error from the RPC + self.event_filtering_batch_size = self._ensure( + "event_filtering_batch_size", kwargs, int + ) # this is the max number of redeeming operations that will be batched on a single multisend transaction. # increasing this number equals fewer fees but more chances for the transaction to fail self.redeeming_batch_size = self._ensure("redeeming_batch_size", kwargs, int) diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index e34c57b74..effa19f9f 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -12,20 +12,20 @@ fingerprint: README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i __init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky - behaviours/base.py: bafybeidny4y4w4jbjbp5d5qivur6jm37fnuik4mqzchzshiuvpozxe7vwy + behaviours/base.py: bafybeibt4fn3l52xwfat2vqn5nae2vm3ahjrddahjukkqxg33dcaumwcei behaviours/bet_placement.py: bafybeiauzdizqawjgzc3ugx33vuh726e25juhacqdr7c6uztpn6tra5dva behaviours/blacklisting.py: bafybeicl6b4hcmqmekta2mcuhkkydnzk7jmic6k44e6ns3u2ibad3awzvu behaviours/decision_receive.py: bafybeiesgn3gaj34n554apuxhq7jldtjgnir77fvnkr3tw5t4fprbvqhum behaviours/decision_request.py: bafybeibrk6jxalkgspinmjboqr3o6d6hl6mxtlkif74a5p32vp2zzhhzua behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm - behaviours/reedem.py: bafybeihywv5332ngbz4hhcwjbaglctblwjbfhdenppznnlxbsgnxdhrrim + behaviours/reedem.py: bafybeic7i5tfgsl2rwbfxxpukqe6nmnpk3o6koyw2rn3xv5t5lbnubmnrq behaviours/round_behaviour.py: bafybeig4tdktyu6hapoqymnxh2bgpds547st6a44heue657wkctwe4gjvm behaviours/sampling.py: bafybeiadikynvkaofbko72jc45xthhmmjfmlkpgramormhxwk5u47rnwdu behaviours/tool_selection.py: bafybeigfr2frkljrxyfxs5p3j42equzehgaqtkyuxk6eiujyudr6ajqakm dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm fsm_specification.yaml: bafybeifnob3ceim2mj7lqagtnpwqjqqxs5eg3oiwc73gwm6x5i2dvvlcya handlers.py: bafybeihj33szgrcxnpd73s4nvluyxwwsvhjum2cuq3ilhhe6vfola3k7vy - models.py: bafybeihy4igjg72xsgcntawxnzhimsrq2rlucmlbceeglqdgnihazoclxu + models.py: bafybeidd73nai777thcqsdofgt57hhinhxbkr6zeiypxaxa4oqjpgfyulu payloads.py: bafybeiawx6ix2ljvf545fe3wocdoh7frds6gjvzgv62b3w6huaolgvywqi policy.py: bafybeidpmx4ek3qze63zpuwixyf6t7bdv62ewgkzt3ljrzadiwdw64cueq redeem_info.py: bafybeibddfxwp3577c3dl2utaowwltquu5fg6crezpumoebw563wxpbfrm @@ -49,12 +49,13 @@ contracts: - valory/erc20:0.1.0:bafybeibysifjwhlcn7nntsjkowdmja53ed6urfzypi6sxfc7chtheecvpi - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeifaavuqr2bz7nypapjwkufc5c6vwxm5ifucmtd3w7sh42tne35nga -- valory/conditional_tokens:0.1.0:bafybeicbkivacygycd26mqwvsp4c7velo2lpbxzwmrsgxg65prnvri6yoi -- valory/realitio:0.1.0:bafybeic3wihpzz4deguslpzlnsgrlrabclq3njwuagyaiiv6rzqujfrs6e +- valory/conditional_tokens:0.1.0:bafybeifov35k2ifwagzyfvl7km6je6tmyvcqgrccldob3zmbx2af2wzque +- valory/realitio:0.1.0:bafybeid6kh4tiqswpeufkr7eowmq7seoyhkssnedgzw6pe4h7wswui6dlm - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 - valory/agent_registry:0.1.0:bafybeifwdtwxdc2jdlhzdyxctqdmoz6zroxf5o4nhuok5l4luvnofqavty protocols: - valory/contract_api:1.0.0:bafybeialhbjvwiwcnqq3ysxcyemobcbie7xza66gaofcvla5njezkvhcka +- valory/ledger_api:1.0.0:bafybeige5agrztgzfevyglf7mb4o7pzfttmq4f6zi765y4g2zvftbyowru skills: - valory/abstract_round_abci:0.1.0:bafybeid7neqpxxe4ualp23gxgrtpf6r5u3myr2mmc4uvwameyqshfdoydq - valory/market_manager_abci:0.1.0:bafybeidropskas24c4lcekzdbwoflhnzaglmeqxvpyuoa7cf7q2rf2yex4 @@ -183,6 +184,7 @@ models: conditional_tokens_address: '0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce' realitio_proxy_address: '0xAB16D643bA051C11962DA645f74632d3130c81E2' realitio_address: '0x79e32aE03fb27B07C89c0c568F80287C01ca2E57' + event_filtering_batch_size: 5000 redeeming_batch_size: 5 policy_store_path: /data/ slippage: 0.01 diff --git a/packages/valory/skills/trader_abci/models.py b/packages/valory/skills/trader_abci/models.py index 373113b77..9d95429c0 100644 --- a/packages/valory/skills/trader_abci/models.py +++ b/packages/valory/skills/trader_abci/models.py @@ -26,9 +26,6 @@ BenchmarkTool as BaseBenchmarkTool, ) from packages.valory.skills.abstract_round_abci.models import Requests as BaseRequests -from packages.valory.skills.abstract_round_abci.models import ( - SharedState as BaseSharedState, -) from packages.valory.skills.decision_maker_abci.models import ( AgentToolsSpecs as DecisionMakerAgentToolsSpecs, ) @@ -36,6 +33,9 @@ from packages.valory.skills.decision_maker_abci.models import ( MechResponseSpecs as DecisionMakerMechResponseSpecs, ) +from packages.valory.skills.decision_maker_abci.models import ( + SharedState as BaseSharedState, +) from packages.valory.skills.decision_maker_abci.rounds import ( Event as DecisionMakerEvent, ) diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index c0843949b..ad030eb13 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -13,7 +13,7 @@ fingerprint: dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm fsm_specification.yaml: bafybeiaomt3gscv4pvxczc4scu6q6laza6bqhpvfi2bfiq37vksuchhqiy handlers.py: bafybeicamc6vmozij5dwvkxmbxjazsgf3sacojhstbjtq7vfggszxugvey - models.py: bafybeifj5y7qcoac72woe53zaz2lopkqir2472bbey3ypsqmprjmljms7i + models.py: bafybeihdsszlbuvustazamlav3zvaupxnsmmdv4qo526m4d6lbedaverge fingerprint_ignore_patterns: [] connections: [] contracts: [] @@ -25,8 +25,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeia6cdxdlqrcwk2maw25fo7dafzd2p3rs7syropvufophk2pitzbwy - valory/termination_abci:0.1.0:bafybeieqm46zuccaagnko3qlw6p3nvoohdrfgvpmw467r5lyil2dqrzjsy - valory/market_manager_abci:0.1.0:bafybeidropskas24c4lcekzdbwoflhnzaglmeqxvpyuoa7cf7q2rf2yex4 -- valory/decision_maker_abci:0.1.0:bafybeihcwzgpl5cgxmbi2ttqum5khnryxnp3cdrxm64q6dgerjr7weqk2m -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeif22r6jg3lptvm2jwyxpozr4wdk63j52rpnmkq7fepst4s4dt4auq +- valory/decision_maker_abci:0.1.0:bafybeigwmf5lrwsq4rvwmcmvdejbwcwb6zkndx5tcpljf4vvvb7fvz7nwe +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeica2fsr66v7q4emhfrjsy5olplnb6asty6y4wzq76jgsvjqjii7fe behaviours: main: args: {} @@ -166,6 +166,7 @@ models: conditional_tokens_address: '0xCeAfDD6bc0bEF976fdCd1112955828E00543c0Ce' realitio_proxy_address: '0xAB16D643bA051C11962DA645f74632d3130c81E2' realitio_address: '0x79e32aE03fb27B07C89c0c568F80287C01ca2E57' + event_filtering_batch_size: 5000 redeeming_batch_size: 5 slippage: 0.01 policy_epsilon: 0.1 diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index fc3747311..083bdad82 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -20,7 +20,7 @@ contracts: [] protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeid7neqpxxe4ualp23gxgrtpf6r5u3myr2mmc4uvwameyqshfdoydq -- valory/decision_maker_abci:0.1.0:bafybeihcwzgpl5cgxmbi2ttqum5khnryxnp3cdrxm64q6dgerjr7weqk2m +- valory/decision_maker_abci:0.1.0:bafybeigwmf5lrwsq4rvwmcmvdejbwcwb6zkndx5tcpljf4vvvb7fvz7nwe behaviours: main: args: {}