Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reality.eth answer question bounty #112

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "bafybeigxyy2mr2skgkthqu5qmtkrhid7dwgdn4hylhpkoeex3g6zfgua3m",
"skill/valory/market_maker_abci/0.1.0": "bafybeieb7ar4k6axttw5czigtbkzilzbavpa7rilkdfj42itlxsjmmdijq",
"agent/valory/market_maker/0.1.0": "bafybeia3aoiq4w5v73ys5xi4lzbz7fgwtnhlxpmr2r5t62wuugm4slgkze",
"service/valory/market_maker/0.1.0": "bafybeig6aakuowznozsfmz3fy77uvqjm2jtj7tj2wqmkfwhiusuxvvucmm"
},
"third_party": {
"protocol/valory/contract_api/1.0.0": "bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i",
Expand Down
7 changes: 4 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:bafybeieb7ar4k6axttw5czigtbkzilzbavpa7rilkdfj42itlxsjmmdijq
- valory/registration_abci:0.1.0:bafybeieu7vq3pyns4t5ty6u3sbmpkd7yznpg3rmqifoz3jhy7pmqyg3w6q
- valory/market_creation_manager_abci:0.1.0:bafybeidzxfrtwdd65c5uqbcwj5csw6dnrmdcoi7lb2w4hc5rwouwtzh6ee
- valory/market_creation_manager_abci:0.1.0:bafybeigxyy2mr2skgkthqu5qmtkrhid7dwgdn4hylhpkoeex3g6zfgua3m
- 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 Down
5 changes: 3 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:bafybeia3aoiq4w5v73ys5xi4lzbz7fgwtnhlxpmr2r5t62wuugm4slgkze
number_of_agents: 1
deployment:
agent:
Expand Down Expand Up @@ -86,7 +86,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,
jmoreira-valory marked this conversation as resolved.
Show resolved Hide resolved
}

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 @@ -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
7 changes: 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ aea_version: '>=1.0.0, <2.0.0'
fingerprint:
.gitignore: bafybeihdfdezgtr3s2lzq5y3oaitfrdy4u4pehionju2bdez35wcjgqx6y
__init__.py: bafybeibkyjt4covc4yhd22aw7kav45zozk3exdv344emt3lilln64soaxm
behaviours.py: bafybeie6loksrlhrmidncajfautwsanw47nf43yavxz6kcuol3utipsa5e
behaviours.py: bafybeieq7lwoujmsyevbhv3vwz3d6f3ysj6a2yxq57wf4fmhzpad3vgpjm
dialogues.py: bafybeicmaufkl7vdomnfciv7lw4536ssld7x4uemdapuhsyvfpd4ncibza
fsm_specification.yaml: bafybeicps5t2anm7fv35fwnw7oolaxxmpmjio6mdw4sc6rzpnsolph5xlm
handlers.py: bafybeietxjfli2i57kb7heoy772rcq2znusl36gg7jjj5g3pddw7egny3q
models.py: bafybeidwkm77ozr2x7qpxpvyiuerz6ih2k4bd5p25hqzzbrvhkyknwcrue
models.py: bafybeib6zsvkkqszeg3zhzuiirkuwxkfzniiyauwaggn7elaw33bnen2lu
payloads.py: bafybeibu7sptf43adazxpyzwtfpph7bgfhtwiotg5sdlcwjt6iw3idqn7a
rounds.py: bafybeie6rgwfulbu5xkuvxgrujbvenioyfggtzlmt23pbm6auzj3w4se44
tests/__init__.py: bafybeihfxvqnyfly72tbxnnnglshcilm2kanihqnjiasvcz3ec3csw32ti
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 Down
5 changes: 3 additions & 2 deletions packages/valory/skills/market_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeigxyy2mr2skgkthqu5qmtkrhid7dwgdn4hylhpkoeex3g6zfgua3m
- 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,7 +207,8 @@ 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
Expand Down
Loading