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

Fix/redeeming #166

Merged
merged 7 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 5 additions & 5 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"dev": {
"skill/valory/market_manager_abci/0.1.0": "bafybeic7o4pclkhnugyn7js5g3asxuqhkxpvunlp3mpup7aovhg2fto22i",
"skill/valory/decision_maker_abci/0.1.0": "bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4",
"skill/valory/trader_abci/0.1.0": "bafybeihqqz7yvn33iirooeqk7e6iz4dr5grwrfbkavamis6bnfoz6yj5pu",
"skill/valory/decision_maker_abci/0.1.0": "bafybeifn34taf4mp7jau2z3m3b4hfr2imqra2vk66ewqqatjefug4sxpoe",
"skill/valory/trader_abci/0.1.0": "bafybeiccym5e5narmwz2nj27mb3west35jdyemw5tbb62vsci3qf7q2qfe",
"contract/valory/market_maker/0.1.0": "bafybeid5jnetbsusgxkpqzwyiqlwut55xktfbeloipxcemcuu5oopmqtl4",
"agent/valory/trader/0.1.0": "bafybeigt6hd5cwuusdbu4u3ieqzvs4v4vihlr344rz55pb6neys55cwlre",
"service/valory/trader/0.1.0": "bafybeiaabwa7whlwpep5j2gpidnfvqgkgyo2vrw655t6epwtbh67umsb5m",
"agent/valory/trader/0.1.0": "bafybeicilkow7wxpql2u2rvpxhsd4sx7k5zaoecczji4uh5yx63tij7v2m",
"service/valory/trader/0.1.0": "bafybeifysuljpf3f2xh6dptbu4rynlgfkltxqe3uxuvcpjz5kvgvox34g4",
"contract/valory/erc20/0.1.0": "bafybeiepg5ymxhtylgijs3mf3lezz6cwcsougbrv2gr4xcq3bp5wxusi64",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaqh4pujl2o2ginl5lbe7p7en7t2ncs25gohysxdks5kd4lmqav3q",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeifz3acwidaspctweisz3u4ytd7qi3iwdgr7cypa3xozmd5pltp5tu",
"contract/valory/mech/0.1.0": "bafybeieo65rtidzgrx22la7z7azoqbisd35hnoqfw7l3xxctotvctjlkju",
"contract/valory/realitio/0.1.0": "bafybeieoily22pasgkzzcyawhqyrsko7b52lghnvwuskhomavb7tlb6pxa",
"contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4",
Expand Down
7 changes: 4 additions & 3 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeiencz2uytz6fqj5wg7mcunevxjh4xg5gd6pqcgkshgqywhcimweyi
- valory/termination_abci:0.1.0:bafybeigainmpy37gb33ogbrpggjbkuasodhthh5oz4vbzjdfjozerpf224
- valory/transaction_settlement_abci:0.1.0:bafybeigk3debp6dswutqsuls2lqfvyj4ghe6kwjc2zfinnsvj6hujynxtq
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaqh4pujl2o2ginl5lbe7p7en7t2ncs25gohysxdks5kd4lmqav3q
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifz3acwidaspctweisz3u4ytd7qi3iwdgr7cypa3xozmd5pltp5tu
- valory/market_manager_abci:0.1.0:bafybeic7o4pclkhnugyn7js5g3asxuqhkxpvunlp3mpup7aovhg2fto22i
- valory/decision_maker_abci:0.1.0:bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4
- valory/trader_abci:0.1.0:bafybeihqqz7yvn33iirooeqk7e6iz4dr5grwrfbkavamis6bnfoz6yj5pu
- valory/decision_maker_abci:0.1.0:bafybeifn34taf4mp7jau2z3m3b4hfr2imqra2vk66ewqqatjefug4sxpoe
- valory/trader_abci:0.1.0:bafybeiccym5e5narmwz2nj27mb3west35jdyemw5tbb62vsci3qf7q2qfe
- valory/staking_abci:0.1.0:bafybeia3acxumkjg566dvgagv3swz7htf5xpvwq6ovmecvp5j2zdxdoabe
default_ledger: ethereum
required_ledgers:
Expand Down Expand Up @@ -192,6 +192,7 @@ models:
realitio_address: ${str:0x79e32aE03fb27B07C89c0c568F80287C01ca2E57}
event_filtering_batch_size: ${int:5000}
reduce_factor: ${float:0.25}
minimum_batch_size: ${int:500}
max_filtering_retries: ${int:6}
redeeming_batch_size: ${int:5}
slippage: ${float:0.01}
Expand Down
6 changes: 5 additions & 1 deletion packages/valory/services/trader/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: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq
fingerprint_ignore_patterns: []
agent: valory/trader:0.1.0:bafybeigt6hd5cwuusdbu4u3ieqzvs4v4vihlr344rz55pb6neys55cwlre
agent: valory/trader:0.1.0:bafybeicilkow7wxpql2u2rvpxhsd4sx7k5zaoecczji4uh5yx63tij7v2m
number_of_agents: 4
deployment: {}
---
Expand Down Expand Up @@ -107,6 +107,7 @@ type: skill
event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000}
reduce_factor: ${REDUCE_FACTOR:float:0.25}
max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6}
minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500}
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
policy_epsilon: ${POLICY_EPSILON:float:0.1}
Expand Down Expand Up @@ -186,6 +187,7 @@ type: skill
event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000}
reduce_factor: ${REDUCE_FACTOR:float:0.25}
max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6}
minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500}
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
policy_epsilon: ${POLICY_EPSILON:float:0.1}
Expand Down Expand Up @@ -263,6 +265,7 @@ type: skill
event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000}
reduce_factor: ${REDUCE_FACTOR:float:0.25}
max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6}
minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500}
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
policy_epsilon: ${POLICY_EPSILON:float:0.1}
Expand Down Expand Up @@ -340,6 +343,7 @@ type: skill
event_filtering_batch_size: ${EVENT_FILTERING_BATCH_SIZE:int:5000}
reduce_factor: ${REDUCE_FACTOR:float:0.25}
max_filtering_retries: ${MAX_FILTERING_RETRIES:int:6}
minimum_batch_size: ${MINIMUM_BATCH_SIZE:int:500}
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
policy_epsilon: ${POLICY_EPSILON:float:0.1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,14 @@ def _check_already_redeemed(self) -> WaitableConditionType:
if not result:
n_retries += 1
keep_fraction = 1 - self.params.reduce_factor
batch_size = int(batch_size * keep_fraction)
reduced_batch_size = int(batch_size * keep_fraction)
# ensure that the batch size is at least the minimum batch size
batch_size = max(reduced_batch_size, self.params.minimum_batch_size)
self.redeeming_progress.event_filtering_batch_size = batch_size
self.context.logger.warning(
f"Repeating this call with a decreased batch size of {batch_size}."
)

continue

self.redeeming_progress.payouts.update(self.payouts_batch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ transition_func:
(RedeemRound, NONE): ImpossibleRound
(RedeemRound, NO_MAJORITY): RedeemRound
(RedeemRound, NO_REDEEMING): FinishedWithoutRedeemingRound
(RedeemRound, ROUND_TIMEOUT): RedeemRound
(RedeemRound, ROUND_TIMEOUT): FinishedWithoutRedeemingRound
(SamplingRound, DONE): ToolSelectionRound
(SamplingRound, NONE): FinishedWithoutDecisionRound
(SamplingRound, NO_MAJORITY): SamplingRound
Expand Down
2 changes: 2 additions & 0 deletions packages/valory/skills/decision_maker_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"event_filtering_batch_size", kwargs, int
)
self.reduce_factor: float = self._ensure("reduce_factor", kwargs, float)
# the minimum batch size for redeeming operations, this is added to avoid the batch size to be too small
self.minimum_batch_size: int = self._ensure("minimum_batch_size", kwargs, int)
self.max_filtering_retries: int = self._ensure(
"max_filtering_retries", kwargs, int
)
Expand Down
4 changes: 3 additions & 1 deletion packages/valory/skills/decision_maker_abci/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ class DecisionMakerAbciApp(AbciApp[Event]):
Event.DONE: FinishedDecisionMakerRound,
Event.NO_REDEEMING: FinishedWithoutRedeemingRound,
Event.NO_MAJORITY: RedeemRound,
Event.ROUND_TIMEOUT: RedeemRound,
# in case of a round timeout, there likely is something wrong with redeeming
# it could be the RPC, or some other issue. We don't want to be stuck trying to redeem.
Event.ROUND_TIMEOUT: FinishedWithoutRedeemingRound,
Adamantios marked this conversation as resolved.
Show resolved Hide resolved
# this is here because of `autonomy analyse fsm-specs` falsely reporting it as missing from the transition
Event.NONE: ImpossibleRound,
},
Expand Down
9 changes: 5 additions & 4 deletions packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ fingerprint:
behaviours/decision_receive.py: bafybeifacce2ke7oltnwnpdjdqfd74eaaw5wxnjfzk6c5tqdsxsmbzjj3m
behaviours/decision_request.py: bafybeievr7vae43e7jr4eqqhwe3emvgiih7ysa66jcb5g2oz5lbxua232q
behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm
behaviours/reedem.py: bafybeiekq77eatvf7xczbnyd4s6met4ci57ethwwoyxf5mhrcq7vuwiaxu
behaviours/reedem.py: bafybeihhphnm3p47fweedutfrwcgtcd62hywxlscsnvlk2gsvpgmmb7m3a
behaviours/round_behaviour.py: bafybeig4tdktyu6hapoqymnxh2bgpds547st6a44heue657wkctwe4gjvm
behaviours/sampling.py: bafybeifzhm4sspdvt227ksl5hjn26offgqpwempgbcwbr6dq7gyi2a46sm
behaviours/tool_selection.py: bafybeifpvrrbftlkjsoiysnasihzttousk6hxnukzrln6z2d33e3zexkje
dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm
fsm_specification.yaml: bafybeifnob3ceim2mj7lqagtnpwqjqqxs5eg3oiwc73gwm6x5i2dvvlcya
fsm_specification.yaml: bafybeiefakgrltqy5grptkymrdscli7ergicqkaxef42okv2l7krjqd6iq
handlers.py: bafybeihj33szgrcxnpd73s4nvluyxwwsvhjum2cuq3ilhhe6vfola3k7vy
models.py: bafybeihmqhxixmklpp656o7i27fas2afabusmar2heyfnx5e3kgzdcvkji
models.py: bafybeictrsjmxflyo7ryveu6bbpm7xut23tex2xjbb7ftmcrhuotam7xgu
payloads.py: bafybeigcic4vewdglakzpyqevhfwsolh4ywnbvxo5bgned7gl5uo3jif7m
policy.py: bafybeidpmx4ek3qze63zpuwixyf6t7bdv62ewgkzt3ljrzadiwdw64cueq
redeem_info.py: bafybeibddfxwp3577c3dl2utaowwltquu5fg6crezpumoebw563wxpbfrm
rounds.py: bafybeibbpiqyifu3bxldmxv3ebwwymwhkqid7eglf4gz7g6mmtcxtconle
rounds.py: bafybeih45c2wmncdqs7jiyuw6h4vyh5e46uz5dyxkmzfeefnncrkogbwnu
states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy
states/base.py: bafybeid265zag7ivlc6fng5croomwds2r43ozzcmom7yp4kzfz7o5bav6a
states/bet_placement.py: bafybeibalhxhp2c4oljmiwqi6ds3g36fgtabmf42mb5sgq6z22znrcbhda
Expand Down Expand Up @@ -193,6 +193,7 @@ models:
event_filtering_batch_size: 5000
reduce_factor: 0.25
max_filtering_retries: 6
minimum_batch_size: 500
redeeming_batch_size: 5
policy_store_path: /data/
slippage: 0.01
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/trader_abci/fsm_specification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ transition_func:
(RedeemRound, NONE): ImpossibleRound
(RedeemRound, NO_MAJORITY): RedeemRound
(RedeemRound, NO_REDEEMING): CallCheckpointRound
(RedeemRound, ROUND_TIMEOUT): RedeemRound
(RedeemRound, ROUND_TIMEOUT): CallCheckpointRound
(RegistrationRound, DONE): UpdateBetsRound
(RegistrationRound, NO_MAJORITY): RegistrationRound
(RegistrationStartupRound, DONE): UpdateBetsRound
Expand Down
7 changes: 4 additions & 3 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fingerprint:
behaviours.py: bafybeieesrefrpo5c5upzztgm5fwfrmxeagilacuau5nacobhsfvgpbzby
composition.py: bafybeiajga2m7pv7v4bxsjsnncavdns6gujg7qg7opfjyznlzip3gbd3nm
dialogues.py: bafybeiebofyykseqp3fmif36cqmmyf3k7d2zbocpl6t6wnlpv4szghrxbm
fsm_specification.yaml: bafybeihlhdsmmihnvwtggc2t2neqkm5uduw5krpgcxpz7m7xp5kjkf6jsm
fsm_specification.yaml: bafybeiecxat37q634mgmv3hwgevulr726k3cc6ild3kylititnf3w7gl5m
handlers.py: bafybeicamc6vmozij5dwvkxmbxjazsgf3sacojhstbjtq7vfggszxugvey
models.py: bafybeifxiptjrnv4hbw5l3mfxvb7hksmxf726kvab5lcms5btuc3vaahem
fingerprint_ignore_patterns: []
Expand All @@ -25,8 +25,8 @@ skills:
- valory/transaction_settlement_abci:0.1.0:bafybeigk3debp6dswutqsuls2lqfvyj4ghe6kwjc2zfinnsvj6hujynxtq
- valory/termination_abci:0.1.0:bafybeigainmpy37gb33ogbrpggjbkuasodhthh5oz4vbzjdfjozerpf224
- valory/market_manager_abci:0.1.0:bafybeic7o4pclkhnugyn7js5g3asxuqhkxpvunlp3mpup7aovhg2fto22i
- valory/decision_maker_abci:0.1.0:bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaqh4pujl2o2ginl5lbe7p7en7t2ncs25gohysxdks5kd4lmqav3q
- valory/decision_maker_abci:0.1.0:bafybeifn34taf4mp7jau2z3m3b4hfr2imqra2vk66ewqqatjefug4sxpoe
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifz3acwidaspctweisz3u4ytd7qi3iwdgr7cypa3xozmd5pltp5tu
- valory/staking_abci:0.1.0:bafybeia3acxumkjg566dvgagv3swz7htf5xpvwq6ovmecvp5j2zdxdoabe
behaviours:
main:
Expand Down Expand Up @@ -173,6 +173,7 @@ models:
event_filtering_batch_size: 5000
reduce_factor: 0.25
max_filtering_retries: 6
minimum_batch_size: 500
redeeming_batch_size: 5
slippage: 0.01
policy_epsilon: 0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protocols:
- valory/ledger_api:1.0.0:bafybeige5agrztgzfevyglf7mb4o7pzfttmq4f6zi765y4g2zvftbyowru
skills:
- valory/abstract_round_abci:0.1.0:bafybeidau7loztcfy3mxvoqrv7otbpciemd2wf3lsxyjraq4dcvuvib25e
- valory/decision_maker_abci:0.1.0:bafybeihnjjfzoiihujnjd2gzbvmayz7avo5myslvl24wvyqj7zq4ufkvw4
- valory/decision_maker_abci:0.1.0:bafybeifn34taf4mp7jau2z3m3b4hfr2imqra2vk66ewqqatjefug4sxpoe
- valory/staking_abci:0.1.0:bafybeia3acxumkjg566dvgagv3swz7htf5xpvwq6ovmecvp5j2zdxdoabe
behaviours:
main:
Expand Down
Loading