diff --git a/README.md b/README.md index 361565b..445794c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Next, prepare the [Safe](https://safe.global/). The trader agent runs as part of which is an [autonomous service](https://docs.autonolas.network/open-autonomy/get_started/what_is_an_agent_service/) represented on-chain in the [Autonolas Protocol](https://docs.autonolas.network/protocol/) by a [Safe](https://safe.global/) multisig. Follow the next steps to obtain a **Safe address** corresponding to your agent address: -1. Visit https://registry.olas.network/services/mint and connect to the Gnosis network. We recommend connecting using a wallet with a Gnosis EOA account that you own. +1. Visit https://registry.olas.network/gnosis/services/mint and connect to the Gnosis network. We recommend connecting using a wallet with a Gnosis EOA account that you own. 2. Fill in the following fields: - *"Owner address"*: a Gnosis address for which you will be able to sign later using a supported wallet. If you want to use the address you are connected to, click on *"Prefill Address"*. - Click on *"Generate Hash & File"* and enter the value corresponding to the `service/valory/trader/0.1.0` key in [`packages.json`](https://github.com/valory-xyz/trader/blob/main/packages/packages.json) diff --git a/packages/packages.json b/packages/packages.json index 6689b26..b1603fa 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -3,10 +3,10 @@ "contract/valory/fpmm_deterministic_factory/0.1.0": "bafybeigjfuahxhb2y4q5ueayry55boaojcryoamwr6fshgayf5s762vpl4", "contract/valory/wxdai/0.1.0": "bafybeidalocwbhmbto6ii6adldtpcughtdt6j3v4tv36utevjk2wrdyqie", "contract/valory/fpmm/0.1.0": "bafybeiai2ruj27nnglvn7yc5atojyojo3fkmofw6wrjgz2ybps2uwdizx4", - "skill/valory/market_creation_manager_abci/0.1.0": "bafybeidzxfrtwdd65c5uqbcwj5csw6dnrmdcoi7lb2w4hc5rwouwtzh6ee", - "skill/valory/market_maker_abci/0.1.0": "bafybeiguuoyykob2kxrnvvqkxl64vs37of6r3hrevc2qfbmtw5yjhliohi", - "agent/valory/market_maker/0.1.0": "bafybeidstcny2k2brq3e7wnsr72lugj3rq3nzy7pjwswnf5evknc2i2ht4", - "service/valory/market_maker/0.1.0": "bafybeibtlh3bglhpuivnkpmpxxzul5sbv6xuaspfdakm5smhpv47bl644m" + "skill/valory/market_creation_manager_abci/0.1.0": "bafybeigopmjddoomz57pkeafpjvssvvbemgtl6zitjvvjgj2y2dbyazf5e", + "skill/valory/market_maker_abci/0.1.0": "bafybeih7cs656swz6l33cdw43njf5dqro3lu2rbkr362jtkw3ixahll2ya", + "agent/valory/market_maker/0.1.0": "bafybeih4jazyeuw7w3npc36eujvkrdc4yk5yt33iep2jhj6rjzmpgyjj6e", + "service/valory/market_maker/0.1.0": "bafybeie3ibdzqzpiycrrbc6g6gx2hkhz57cb3tc2gz5toh7qovaotcektm" }, "third_party": { "protocol/valory/contract_api/1.0.0": "bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i", diff --git a/packages/valory/agents/market_maker/aea-config.yaml b/packages/valory/agents/market_maker/aea-config.yaml index 2e5b76d..5ac3d12 100644 --- a/packages/valory/agents/market_maker/aea-config.yaml +++ b/packages/valory/agents/market_maker/aea-config.yaml @@ -37,9 +37,9 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeieh4ei3qdelmacnm7vwq57phoewgumr3udvxt6pybmuggwc3yk65q - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui -- valory/market_maker_abci:0.1.0:bafybeiguuoyykob2kxrnvvqkxl64vs37of6r3hrevc2qfbmtw5yjhliohi +- valory/market_maker_abci:0.1.0:bafybeih7cs656swz6l33cdw43njf5dqro3lu2rbkr362jtkw3ixahll2ya - valory/registration_abci:0.1.0:bafybeieu7vq3pyns4t5ty6u3sbmpkd7yznpg3rmqifoz3jhy7pmqyg3w6q -- valory/market_creation_manager_abci:0.1.0:bafybeidzxfrtwdd65c5uqbcwj5csw6dnrmdcoi7lb2w4hc5rwouwtzh6ee +- valory/market_creation_manager_abci:0.1.0:bafybeigopmjddoomz57pkeafpjvssvvbemgtl6zitjvvjgj2y2dbyazf5e - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote @@ -207,7 +207,8 @@ models: use_termination: ${bool:false} use_slashing: ${bool:false} slash_cooldown_hours: ${int:3} - close_question_bond: ${int:1000000000000000} + realitio_answer_question_bond: ${int:1000000000000000} + realitio_answer_question_bounty: ${int:0} questions_to_close_batch_size: ${int:1} slash_threshold_amount: ${int:10000000000000000} light_slash_unit_amount: ${int:5000000000000000} @@ -217,6 +218,7 @@ models: google_engine_id: ${str:google_engine_id} openai_api_key: ${str:openai_api_key} mech_contract_address: ${str:0x77af31de935740567cf4ff1986d04b2c964a786a} + mech_tool_resolve_market: ${str:resolve-market-reasoning-gpt-4} answer_retry_intervals: ${list:[0, 86400, 259200, 604800, 1209600]} randomness_api: args: diff --git a/packages/valory/services/market_maker/service.yaml b/packages/valory/services/market_maker/service.yaml index 7fd6570..6ec104f 100644 --- a/packages/valory/services/market_maker/service.yaml +++ b/packages/valory/services/market_maker/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibwz3af6326msp4h3kqehijvmyhaytvyfbo3o2npc2w4b6zrg6pfq fingerprint_ignore_patterns: [] -agent: valory/market_maker:0.1.0:bafybeidstcny2k2brq3e7wnsr72lugj3rq3nzy7pjwswnf5evknc2i2ht4 +agent: valory/market_maker:0.1.0:bafybeih4jazyeuw7w3npc36eujvkrdc4yk5yt33iep2jhj6rjzmpgyjj6e number_of_agents: 1 deployment: agent: @@ -70,6 +70,7 @@ models: multisend_batch_size: ${MULTISEND_BATCH_SIZE:int:1} ipfs_address: ${IPFS_ADDRESS:str:https://gateway.autonolas.tech/ipfs/} mech_contract_address: ${MECH_CONTRACT_ADDRESS:str:0x77af31de935740567cf4ff1986d04b2c964a786a} + mech_tool_resolve_market: ${MECH_TOOL_RESOLVE_MARKET:str:resolve-market-reasoning-gpt-4} answer_retry_intervals: ${ANSWER_RETRY_INTERVALS:list:[0, 86400, 259200, 604800, 1209600]} on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null} @@ -86,7 +87,8 @@ models: tendermint_check_sleep_delay: ${TENDERMINT_CHECK_SLEEP_DELAY:int:3} tendermint_com_url: ${TENDERMINT_COM_URL:str:http://localhost:8080} tendermint_max_retries: ${TENDERMINT_MAX_RETRIES:int:5} - close_question_bond: ${CLOSE_QUESTION_BOND:int:1000000000000000} + realitio_answer_question_bond: ${REALITIO_ANSWER_QUESTION_BOND:int:1000000000000000} + realitio_answer_question_bounty: ${REALITIO_ANSWER_QUESTION_BOUNTY:int:0} questions_to_close_batch_size: ${QUESTIONS_TO_CLOSE_BATCH_SIZE:int:1} tendermint_url: ${TENDERMINT_URL:str:http://localhost:26657} tendermint_p2p_url: ${TENDERMINT_P2P_URL:str:localhost:26656} diff --git a/packages/valory/skills/market_creation_manager_abci/behaviours.py b/packages/valory/skills/market_creation_manager_abci/behaviours.py index 223ad74..3347280 100644 --- a/packages/valory/skills/market_creation_manager_abci/behaviours.py +++ b/packages/valory/skills/market_creation_manager_abci/behaviours.py @@ -1932,7 +1932,7 @@ def _prepare_ask_question_mstx( return { "to": self.params.realitio_contract, "data": response.state.body["data"], - "value": ETHER_VALUE, + "value": self.params.realitio_answer_question_bounty, } def _prepare_prepare_condition_mstx( @@ -2369,7 +2369,7 @@ def get_payload(self) -> Generator[None, None, str]: max_num_questions = min( len(eligible_questions_id), self.params.questions_to_close_batch_size ) - bond_required = self.params.close_question_bond * max_num_questions + bond_required = self.params.realitio_answer_question_bond * max_num_questions # TODO uncomment if balance < bond_required: @@ -2398,7 +2398,7 @@ def get_payload(self) -> Generator[None, None, str]: asdict( MechMetadata( nonce=question_id, - tool="resolve-market-reasoning-gpt-4", + tool=self.params.mech_tool_resolve_market, prompt=question["title"], ) ) @@ -2561,7 +2561,7 @@ def _get_answer_tx( data = cast(bytes, response.state.body["data"]) return { "to": self.params.realitio_contract, - "value": self.params.close_question_bond, + "value": self.params.realitio_answer_question_bond, "data": data, } diff --git a/packages/valory/skills/market_creation_manager_abci/fsm_specification.yaml b/packages/valory/skills/market_creation_manager_abci/fsm_specification.yaml index 9959329..7d49a31 100644 --- a/packages/valory/skills/market_creation_manager_abci/fsm_specification.yaml +++ b/packages/valory/skills/market_creation_manager_abci/fsm_specification.yaml @@ -99,7 +99,7 @@ transition_func: (MarketProposalRound, ERROR): RetrieveApprovedMarketRound (MarketProposalRound, MARKET_PROPOSAL_ROUND_TIMEOUT): RetrieveApprovedMarketRound (MarketProposalRound, NO_MAJORITY): RetrieveApprovedMarketRound - (PostTransactionRound, ANSWER_QUESTION_DONE): GetPendingQuestionsRound + (PostTransactionRound, ANSWER_QUESTION_DONE): CollectRandomnessRound (PostTransactionRound, DEPOSIT_DAI_DONE): GetPendingQuestionsRound (PostTransactionRound, DONE): RetrieveApprovedMarketRound (PostTransactionRound, ERROR): DepositDaiRound diff --git a/packages/valory/skills/market_creation_manager_abci/models.py b/packages/valory/skills/market_creation_manager_abci/models.py index cfe2ddf..e21e606 100644 --- a/packages/valory/skills/market_creation_manager_abci/models.py +++ b/packages/valory/skills/market_creation_manager_abci/models.py @@ -94,8 +94,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.questions_to_close_batch_size = self._ensure( "questions_to_close_batch_size", kwargs, type_=int ) - self.close_question_bond = self._ensure( - "close_question_bond", kwargs, type_=int + self.realitio_answer_question_bond = self._ensure( + "realitio_answer_question_bond", kwargs, type_=int + ) + self.realitio_answer_question_bounty = self._ensure( + "realitio_answer_question_bounty", kwargs, type_=int ) self.min_approve_markets_epoch_seconds = self._ensure( "min_approve_markets_epoch_seconds", kwargs, type_=int @@ -133,6 +136,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: kwargs=kwargs, type_=str, ) + self.mech_tool_resolve_market = self._ensure( + key="mech_tool_resolve_market", + kwargs=kwargs, + type_=str, + ) self.market_fee = self._ensure("market_fee", kwargs, type_=float) self.market_timeout = self._ensure("market_timeout", kwargs, type_=int) self.event_offset_start_days = self._ensure( diff --git a/packages/valory/skills/market_creation_manager_abci/rounds.py b/packages/valory/skills/market_creation_manager_abci/rounds.py index 15e4cfb..d9435ec 100644 --- a/packages/valory/skills/market_creation_manager_abci/rounds.py +++ b/packages/valory/skills/market_creation_manager_abci/rounds.py @@ -934,7 +934,7 @@ class MarketCreationManagerAbciApp(AbciApp[Event]): Event.NO_MAJORITY: PostTransactionRound, Event.DEPOSIT_DAI_DONE: GetPendingQuestionsRound, Event.MECH_REQUEST_DONE: FinishedWithMechRequestRound, - Event.ANSWER_QUESTION_DONE: GetPendingQuestionsRound, + Event.ANSWER_QUESTION_DONE: CollectRandomnessRound, Event.REDEEM_BOND_DONE: CollectProposedMarketsRound, Event.REMOVE_FUNDING_DONE: DepositDaiRound, }, diff --git a/packages/valory/skills/market_creation_manager_abci/skill.yaml b/packages/valory/skills/market_creation_manager_abci/skill.yaml index 5d37100..62687fc 100644 --- a/packages/valory/skills/market_creation_manager_abci/skill.yaml +++ b/packages/valory/skills/market_creation_manager_abci/skill.yaml @@ -10,13 +10,13 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: .gitignore: bafybeihdfdezgtr3s2lzq5y3oaitfrdy4u4pehionju2bdez35wcjgqx6y __init__.py: bafybeibkyjt4covc4yhd22aw7kav45zozk3exdv344emt3lilln64soaxm - behaviours.py: bafybeie6loksrlhrmidncajfautwsanw47nf43yavxz6kcuol3utipsa5e + behaviours.py: bafybeibaeqww3qnhiqck3pi7t276azxv7jt4tzscex25onaoobtrakqnoi dialogues.py: bafybeicmaufkl7vdomnfciv7lw4536ssld7x4uemdapuhsyvfpd4ncibza - fsm_specification.yaml: bafybeicps5t2anm7fv35fwnw7oolaxxmpmjio6mdw4sc6rzpnsolph5xlm + fsm_specification.yaml: bafybeiebwzp5jirrwo475r2hzwrirx45jlxtp5duo4275phypqfkueybtq handlers.py: bafybeietxjfli2i57kb7heoy772rcq2znusl36gg7jjj5g3pddw7egny3q - models.py: bafybeidwkm77ozr2x7qpxpvyiuerz6ih2k4bd5p25hqzzbrvhkyknwcrue + models.py: bafybeic2w6gyk3hhn4ksea3nte4c6mron6f2zojxjgo6u5kyvkfnx2g6ie payloads.py: bafybeibu7sptf43adazxpyzwtfpph7bgfhtwiotg5sdlcwjt6iw3idqn7a - rounds.py: bafybeie6rgwfulbu5xkuvxgrujbvenioyfggtzlmt23pbm6auzj3w4se44 + rounds.py: bafybeifnezj3cw323fj5xnieuucfqarznzlpesaj75huylfkpeyuunqkvy tests/__init__.py: bafybeihfxvqnyfly72tbxnnnglshcilm2kanihqnjiasvcz3ec3csw32ti fingerprint_ignore_patterns: [] connections: @@ -205,7 +205,8 @@ models: tendermint_p2p_url: localhost:26656 tendermint_url: http://localhost:26657 tx_timeout: 10.0 - close_question_bond: 1000000000000000 + realitio_answer_question_bond: 1000000000000000 + realitio_answer_question_bounty: 0 questions_to_close_batch_size: 1 validate_timeout: 1205 use_termination: false @@ -216,6 +217,7 @@ models: light_slash_unit_amount: 5000000000000000 serious_slash_unit_amount: 8000000000000000 mech_contract_address: '0x77af31de935740567cf4ff1986d04b2c964a786a' + mech_tool_resolve_market: resolve-market-reasoning-gpt-4 answer_retry_intervals: - 0 - 86400 diff --git a/packages/valory/skills/market_maker_abci/fsm_specification.yaml b/packages/valory/skills/market_maker_abci/fsm_specification.yaml index 3a63a88..e313eff 100644 --- a/packages/valory/skills/market_maker_abci/fsm_specification.yaml +++ b/packages/valory/skills/market_maker_abci/fsm_specification.yaml @@ -137,7 +137,7 @@ transition_func: (MechResponseRound, DONE): AnswerQuestionsRound (MechResponseRound, NO_MAJORITY): MechResponseRound (MechResponseRound, ROUND_TIMEOUT): CollectRandomnessRound - (PostTransactionRound, ANSWER_QUESTION_DONE): GetPendingQuestionsRound + (PostTransactionRound, ANSWER_QUESTION_DONE): CollectRandomnessRound (PostTransactionRound, DEPOSIT_DAI_DONE): GetPendingQuestionsRound (PostTransactionRound, DONE): RetrieveApprovedMarketRound (PostTransactionRound, ERROR): DepositDaiRound diff --git a/packages/valory/skills/market_maker_abci/skill.yaml b/packages/valory/skills/market_maker_abci/skill.yaml index 188454f..5c36a20 100644 --- a/packages/valory/skills/market_maker_abci/skill.yaml +++ b/packages/valory/skills/market_maker_abci/skill.yaml @@ -12,7 +12,7 @@ fingerprint: behaviours.py: bafybeidajmnltkvswbtn6zay3lxcx5pp2k4ys5jnmjdgutada6hkmay5tu composition.py: bafybeibags3bapzxlvsbjsxhlyxpd6ypnvwggu6jijktm4qfe4sn5ugfky dialogues.py: bafybeicintyylxt4nd5gcufh3rehbxr5jvdn6un7wvaoel7hvj3dmurlpy - fsm_specification.yaml: bafybeia3xga3f3kjawfl5v5ck3ymg5n5mpxbxszpsbpuvxkrbqvn6ifnka + fsm_specification.yaml: bafybeicsotlxzvvpw2jk7assimkvrsgtogfvlirkmpg2rxqseg3j6qqbem handlers.py: bafybeidlgouig5odju36dkjl5vdqx6mqrukaoyn2chnl5dv2ca6owqlecm models.py: bafybeigyrb6tcpebn7gecgnkcerqmbembat4xdg2wvfybwg6op3rsee2sq tests/__init__.py: bafybeig7noiiz2y2b2scjeaalby56ft24eqj4o433blm2oze2pu3lljp44 @@ -24,7 +24,7 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui - valory/registration_abci:0.1.0:bafybeieu7vq3pyns4t5ty6u3sbmpkd7yznpg3rmqifoz3jhy7pmqyg3w6q - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie -- valory/market_creation_manager_abci:0.1.0:bafybeidzxfrtwdd65c5uqbcwj5csw6dnrmdcoi7lb2w4hc5rwouwtzh6ee +- valory/market_creation_manager_abci:0.1.0:bafybeigopmjddoomz57pkeafpjvssvvbemgtl6zitjvvjgj2y2dbyazf5e - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote - valory/mech_interact_abci:0.1.0:bafybeieryw7rk2tspyxx46loqqqimr2l5vvhtshiyg2mmdxijzb7pdoi6a @@ -207,11 +207,13 @@ models: google_engine_id: google_engine_id openai_api_key: openai_api_key xdai_threshold: 1000000000000000000 - close_question_bond: 1000000000000000 + realitio_answer_question_bond: 1000000000000000 + realitio_answer_question_bounty: 0 slash_threshold_amount: 10000000000000000 light_slash_unit_amount: 5000000000000000 serious_slash_unit_amount: 8000000000000000 mech_contract_address: '0x77af31de935740567cf4ff1986d04b2c964a786a' + mech_tool_resolve_market: resolve-market-reasoning-gpt-4 answer_retry_intervals: - 0 - 86400