Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/staking-kpi-reachability
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav1998 committed Nov 28, 2024
2 parents c949ae2 + 59eadd4 commit 2f6beed
Show file tree
Hide file tree
Showing 23 changed files with 406 additions and 153 deletions.
14 changes: 7 additions & 7 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"contract/valory/mech_activity/0.1.0": "bafybeibmqmle5fnal3gxlpdmcos2kogzra4q3pr3o5nh7shplxuilji3t4",
"contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy",
"contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4",
"skill/valory/market_manager_abci/0.1.0": "bafybeieywounbmfkgzgskuv7hjdu4pybtdmekiroolvsnjnfkke3mnhfqy",
"skill/valory/decision_maker_abci/0.1.0": "bafybeib3vivs5lnfzk446iofma5ootkiabtadwtjc53jt4tbmbltfeaxxy",
"skill/valory/trader_abci/0.1.0": "bafybeidt7j5m53fo3u37lgf5rjko6gur3kuquqqzmyf5nuv4dw4ptkbadu",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiduqneptewxghxhcknygxb4vvufnb6teiogrjekcvlltqvnm7pqmm",
"skill/valory/market_manager_abci/0.1.0": "bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa",
"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": "bafybeifcid54fyx7pgxoqa6xgwjisqmtd6j6ba4tgqzzynclpic7cvd4oy",
"service/valory/trader/0.1.0": "bafybeif6hjpqzkplvpt2c2pbdw4dk5rq5axqwh4dtzbgxnnvr3fbmgq2vq",
"service/valory/trader_pearl/0.1.0": "bafybeiftqu2sqhl222dvsduvplzfxkn5ydw5zjzn6ctvk324k4jddoaqlu"
"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
10 changes: 4 additions & 6 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:bafybeiduqneptewxghxhcknygxb4vvufnb6teiogrjekcvlltqvnm7pqmm
- valory/market_manager_abci:0.1.0:bafybeieywounbmfkgzgskuv7hjdu4pybtdmekiroolvsnjnfkke3mnhfqy
- valory/decision_maker_abci:0.1.0:bafybeib3vivs5lnfzk446iofma5ootkiabtadwtjc53jt4tbmbltfeaxxy
- valory/trader_abci:0.1.0:bafybeidt7j5m53fo3u37lgf5rjko6gur3kuquqqzmyf5nuv4dw4ptkbadu
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic7wcls7yvvnpqrl7vfrab3dt37vyoytu2hef7emmc5556puqjpri
- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa
- 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:bafybeifcid54fyx7pgxoqa6xgwjisqmtd6j6ba4tgqzzynclpic7cvd4oy
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:bafybeifcid54fyx7pgxoqa6xgwjisqmtd6j6ba4tgqzzynclpic7cvd4oy
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

0 comments on commit 2f6beed

Please sign in to comment.