Skip to content

Commit

Permalink
Merge branch 'main' into chore/analysis_invalid_markets
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Sep 7, 2024
2 parents 56d4263 + 2d7af26 commit 203b37e
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions packages/valory/agents/market_maker/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions packages/valory/services/market_maker/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"],
)
)
Expand Down Expand Up @@ -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,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions packages/valory/skills/market_creation_manager_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
12 changes: 7 additions & 5 deletions packages/valory/skills/market_creation_manager_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions packages/valory/skills/market_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 203b37e

Please sign in to comment.