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

Feat/multibet benchmarking #347

Merged
merged 71 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3235d9d
default value for sample bet index
cyberosa Oct 29, 2024
65bab35
initial commit
cyberosa Nov 6, 2024
fe7334c
updating hashes of packages
cyberosa Nov 6, 2024
76e3f98
preparing decisionreceive behaviour for sampled_bet
cyberosa Nov 6, 2024
546fd93
fix a parameter in compute scaledLiqudityMeasure
cyberosa Nov 7, 2024
9739692
update: fsm for benchmarking multi bet
keshav1998 Nov 7, 2024
550593c
update: transitions for decision maker abci
keshav1998 Nov 7, 2024
51713f1
add: read bets functionality for benchmarking
keshav1998 Nov 7, 2024
875c490
add: transition for benchmarking mode
keshav1998 Nov 7, 2024
17ecc9f
add: bet id manager state
keshav1998 Nov 7, 2024
2e8fa39
add: bet id row extraction for benchmarkin
keshav1998 Nov 7, 2024
1ad0d75
update: benchamrking for multi market
keshav1998 Nov 7, 2024
9380e0f
update: packages for benchmarking
keshav1998 Nov 7, 2024
408f956
edit: revert outcomes benchmarking variables
keshav1998 Nov 7, 2024
0c2a45a
update: hashes for benchmarking
keshav1998 Nov 7, 2024
27b81df
fix: benchmarking fixes for decision rounds
keshav1998 Nov 7, 2024
41b0849
latest status working but bets.json not updated
cyberosa Nov 7, 2024
8df465b
fix: empty list popping in bets manager
keshav1998 Nov 8, 2024
c0a4f2d
mergeof hotfixes
cyberosa Nov 8, 2024
747fbc3
updating hashes
cyberosa Nov 8, 2024
ee1b2fa
cleaning, several fixes and adding blacklisting
cyberosa Nov 8, 2024
61fb6b1
Fixing the n_bets wrong update
cyberosa Nov 11, 2024
551431c
fixing packages hashes
cyberosa Nov 12, 2024
deac394
merge with main
cyberosa Nov 14, 2024
6f67953
fix: blacklisting round transitions for benchmarking
keshav1998 Nov 14, 2024
6c1922e
Finishing benchmarking from SamplingRound
cyberosa Nov 15, 2024
cc62c3d
bending time and fixed randomness in benchmarking
cyberosa Nov 18, 2024
a940e0f
merge with main
cyberosa Nov 20, 2024
c164516
Update packages/valory/agents/trader/aea-config.yaml
cyberosa Nov 21, 2024
5b03068
Update packages/valory/skills/decision_maker_abci/behaviours/decision…
cyberosa Nov 21, 2024
8845f9c
Comments from PR review
cyberosa Nov 21, 2024
719e562
Merge branch 'feat/multibet_benchmarking' of https://github.com/valor…
cyberosa Nov 21, 2024
14f67c1
merging more comments
cyberosa Nov 21, 2024
becb37f
removed old benchmarking params not used anymore
cyberosa Nov 22, 2024
099beaa
removed old benchmarking params not used anymore
cyberosa Nov 22, 2024
7ed4d2a
using question_id_field
cyberosa Nov 22, 2024
83e9843
new PR comments
cyberosa Nov 22, 2024
8fa9722
Update packages/valory/skills/decision_maker_abci/behaviours/decision…
cyberosa Nov 22, 2024
69511d5
Update packages/valory/skills/decision_maker_abci/behaviours/decision…
cyberosa Nov 22, 2024
1ad3178
Update packages/valory/skills/decision_maker_abci/behaviours/sampling.py
cyberosa Nov 22, 2024
ca67f79
Update packages/valory/skills/decision_maker_abci/behaviours/sampling.py
cyberosa Nov 22, 2024
e22734a
more PR comments
cyberosa Nov 22, 2024
41d4c02
Merge branch 'feat/multibet_benchmarking' of https://github.com/valor…
cyberosa Nov 22, 2024
b34b48a
Update packages/valory/skills/decision_maker_abci/behaviours/sampling.py
cyberosa Nov 22, 2024
8ede944
Merge branch 'feat/multibet_benchmarking' of https://github.com/valor…
cyberosa Nov 22, 2024
d20cedf
restoring init in skills
cyberosa Nov 22, 2024
03c91dc
restoring init file in valory folder
cyberosa Nov 22, 2024
95d9d95
merge with main
cyberosa Nov 27, 2024
359e238
Updating hashes
cyberosa Nov 27, 2024
d157b3c
new try to fix hashes
cyberosa Nov 27, 2024
5d3b93c
fixing code checks
cyberosa Nov 27, 2024
1ee0ae6
fixing last linter check
cyberosa Nov 27, 2024
e236a6c
adding precision to token prices
cyberosa Nov 27, 2024
530b815
Update packages/valory/skills/decision_maker_abci/behaviours/base.py
cyberosa Nov 27, 2024
2838a0c
Update packages/valory/skills/decision_maker_abci/behaviours/decision…
cyberosa Nov 27, 2024
e53dbb0
updating hashes
cyberosa Nov 27, 2024
d72e4b9
fixing linter checks
cyberosa Nov 27, 2024
f1a2c02
fixing black formatting
cyberosa Nov 27, 2024
b55ff80
Fixing docstrings
cyberosa Nov 27, 2024
9f772a3
fix: create a new event for the resampling
Adamantios Nov 27, 2024
9560768
refactor: convert the token precision to a constant
Adamantios Nov 27, 2024
889025b
fix: remove `BENCHMARKING_FINISHED` event
Adamantios Nov 27, 2024
7029d78
updating hashes after last PR comments
cyberosa Nov 27, 2024
1922032
black formatting
cyberosa Nov 27, 2024
e4d438b
fixing docstrings
cyberosa Nov 27, 2024
ac570c7
fixing docstrings
cyberosa Nov 27, 2024
73ae01b
fixing fsm spec errors
cyberosa Nov 27, 2024
6294e84
fixing loop
cyberosa Nov 27, 2024
8de81f5
black formatting
cyberosa Nov 27, 2024
1944fe4
trying to fix tests
cyberosa Nov 27, 2024
fd089f4
fixing test payload
cyberosa Nov 28, 2024
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
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy",
"contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4",
"skill/valory/market_manager_abci/0.1.0": "bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa",
"skill/valory/decision_maker_abci/0.1.0": "bafybeiffnd7vlryxtfenwcbbvx7qzszkko4oop2n2e6jg2ahdm3zholxsq",
"skill/valory/trader_abci/0.1.0": "bafybeigygq76epkhl67uuvrjlrall65r4ilcwna2jokgjunrzg45gf2ihy",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeie4rfme364fp2m3oo447622mc75tfk4hqftiebau2tpycftd5iffe",
"skill/valory/decision_maker_abci/0.1.0": "bafybeicx3vjswhjzgfa2ddl7zxqzncuqbvej3m2unseje5lsajdhio7mji",
"skill/valory/trader_abci/0.1.0": "bafybeiapf3qng7wczem3t7s5cysdlhzc3xign4sqkhyopro3p7x33hdugu",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeic7wcls7yvvnpqrl7vfrab3dt37vyoytu2hef7emmc5556puqjpri",
"skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini",
"agent/valory/trader/0.1.0": "bafybeibhv5pummw2ngrag6sk6a7phnffp2dfsswhvtxayzizqthea52kru",
"service/valory/trader/0.1.0": "bafybeiey356lnc35rxky3gvikcpcwerdjycyb6nmrw4qlpucar3ykd2jmm",
"service/valory/trader_pearl/0.1.0": "bafybeiezfz7h5g26qimscimnawyeeo3qwgm6smszc7jgwrxest7bgqoq5q"
"agent/valory/trader/0.1.0": "bafybeieoklf7wjrnupyv4egny5hfn6mbxtrjwwtrqyznjoxodiy72cj3na",
"service/valory/trader/0.1.0": "bafybeidzaf6gytftigur646mo4fw2p5urq4cpvbf5t2gbw3fz5v6sseppq",
"service/valory/trader_pearl/0.1.0": "bafybeieqyhrucksqrxxhy2ad4blgsjd3iwhg4m6q3lgm2wlj2wlhz52xjq"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
8 changes: 3 additions & 5 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba
- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm
- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeie4rfme364fp2m3oo447622mc75tfk4hqftiebau2tpycftd5iffe
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic7wcls7yvvnpqrl7vfrab3dt37vyoytu2hef7emmc5556puqjpri
- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa
- valory/decision_maker_abci:0.1.0:bafybeiffnd7vlryxtfenwcbbvx7qzszkko4oop2n2e6jg2ahdm3zholxsq
- valory/trader_abci:0.1.0:bafybeigygq76epkhl67uuvrjlrall65r4ilcwna2jokgjunrzg45gf2ihy
- valory/decision_maker_abci:0.1.0:bafybeicx3vjswhjzgfa2ddl7zxqzncuqbvej3m2unseje5lsajdhio7mji
- valory/trader_abci:0.1.0:bafybeiapf3qng7wczem3t7s5cysdlhzc3xign4sqkhyopro3p7x33hdugu
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
Expand Down Expand Up @@ -252,8 +252,6 @@ models:
collateral_balance: ${int:10000000000000000000}
mech_cost: ${int:10000000000000000}
pool_fee: ${int:20000000000000000}
outcome_token_amounts: ${list:[11000000000000000000,9000000000000000000]}
outcome_token_marginal_prices: ${list:[0.4,0.6]}
sep: ${str:,}
dataset_filename: ${str:benchmark_data.csv}
question_field: ${str:question}
Expand Down
4 changes: 1 addition & 3 deletions 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:bafybeibhv5pummw2ngrag6sk6a7phnffp2dfsswhvtxayzizqthea52kru
agent: valory/trader:0.1.0:bafybeieoklf7wjrnupyv4egny5hfn6mbxtrjwwtrqyznjoxodiy72cj3na
number_of_agents: 4
deployment:
agent:
Expand Down Expand Up @@ -155,8 +155,6 @@ type: skill
collateral_balance: ${BENCHMARKING_MODE_COLLATERAL_BALANCE:int:10000000000000000000}
mech_cost: ${BENCHMARKING_MODE_MECH_COST:int:10000000000000000}
pool_fee: ${BENCHMARKING_MODE_POOL_FEE:int:20000000000000000}
outcome_token_amounts: ${OUTCOME_TOKEN_AMOUNTS:list:[11000000000000000000,9000000000000000000]}
outcome_token_marginal_prices: ${OUTCOME_TOKEN_MARGINAL_PRICES:list:[0.55,0.45]}
sep: ${BENCHMARKING_MODE_SEP:str:,}
dataset_filename: ${BENCHMARKING_MODE_DATASET_FILENAME:str:benchmark_data.csv}
question_field: ${BENCHMARKING_MODE_QUESTION_FIELD:str:question}
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/trader_pearl/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e
fingerprint_ignore_patterns: []
agent: valory/trader:0.1.0:bafybeibhv5pummw2ngrag6sk6a7phnffp2dfsswhvtxayzizqthea52kru
agent: valory/trader:0.1.0:bafybeieoklf7wjrnupyv4egny5hfn6mbxtrjwwtrqyznjoxodiy72cj3na
number_of_agents: 1
deployment:
agent:
Expand Down
15 changes: 13 additions & 2 deletions packages/valory/skills/decision_maker_abci/behaviours/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,10 @@ def is_first_period(self) -> bool:

@property
def sampled_bet(self) -> Bet:
"""Get the sampled bet."""
"""Get the sampled bet and reset the bets list."""
self.read_bets()
return self.bets[self.synchronized_data.sampled_bet_index]
bet_index = self.synchronized_data.sampled_bet_index
return self.bets[bet_index]

@property
def collateral_token(self) -> str:
Expand All @@ -286,6 +287,16 @@ def wei_to_native(wei: int) -> float:
"""Convert WEI to native token."""
return wei / 10**18

def get_active_sampled_bet(self) -> Bet:
"""Function to get the selected bet that is active without reseting self.bets."""
bet_index = self.synchronized_data.sampled_bet_index
if len(self.bets) == 0:
msg = "The length of self.bets is 0"
self.context.logger.info(msg)
self.read_bets()

return self.bets[bet_index]

def _collateral_amount_info(self, amount: int) -> str:
"""Get a description of the collateral token's amount."""
is_wxdai = True if self.benchmarking_mode.enabled else self.is_wxdai
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def async_act(self) -> Generator:

with self.context.benchmark_tool.measure(self.behaviour_id).local():
self.read_bets()
# skip blacklisting when benchmarking as we should be based solely on the input data of the simulation
if not self.benchmarking_mode.enabled:
self._blacklist()
self._blacklist()
self.store_bets()
bets_hash = (
None if self.benchmarking_mode.enabled else self.hash_stored_bets()
Expand Down
Loading
Loading