Skip to content

Commit

Permalink
Finishing benchmarking from SamplingRound
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberosa committed Nov 15, 2024
1 parent 6f67953 commit 6c1922e
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 38 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": "bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka",
"skill/valory/decision_maker_abci/0.1.0": "bafybeiaizbnlz46lba6tcwmajpo2z37cpxuobeqmlgdqbdxnt65jr6rely",
"skill/valory/trader_abci/0.1.0": "bafybeido4dpfcvpyrobs2veoliuwaz2ltuzvo2gqfbsqxgd5tdr7zllyru",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeieszb6lxyy5gt4m4f75fjicuzf3ewsxgxcc5dh4l2tjjau7wcrgxe",
"skill/valory/market_manager_abci/0.1.0": "bafybeid42tfvzicskpdxeppatzvghj2i2bqdtkgs4wobgadwgtp3jr5rme",
"skill/valory/decision_maker_abci/0.1.0": "bafybeibwwruz3ivtmfzgvdp6x5u4xju2xgzowyr7bcaetdwwujaccxccwa",
"skill/valory/trader_abci/0.1.0": "bafybeic42a6pqlbzboldym3vdmbaqntyxrdffbd3jxeomb357va2xkf2iq",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiatdmznskbmr7wxsipv7vqmdagkg2qtdulkyylxdqemkna7hvtqke",
"skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini",
"agent/valory/trader/0.1.0": "bafybeifaw3dk5uklcgj5iftcdhj4p2ymkidoli3uxibq4olddd3eboey7e",
"service/valory/trader/0.1.0": "bafybeiaqqlwqjiofrezpnk4hq6doiccbquzgmd6pcgtfx7akmfhhvyoipi",
"service/valory/trader_pearl/0.1.0": "bafybeidzv544ive2oozjk2szmengrcszea7ai54qts7ehdjdkwevwtwfba"
"agent/valory/trader/0.1.0": "bafybeiddrqpwljunbl5abjtkmfmrhqsvlbokocxqqcnlerdx34iek56pxu",
"service/valory/trader/0.1.0": "bafybeifge5kwtoomw7py3id7zvezs7bwmxoi2s7n6hwl2epkpmcxgbpnyy",
"service/valory/trader_pearl/0.1.0": "bafybeigfonh6ktksn6so63qgxqw5xkk33th353nglaeuoznqtmjelar6j4"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
8 changes: 4 additions & 4 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:bafybeieszb6lxyy5gt4m4f75fjicuzf3ewsxgxcc5dh4l2tjjau7wcrgxe
- valory/market_manager_abci:0.1.0:bafybeicia7itulcrxlwbmhfzxppgo5i33tb2nmcycwizftw7gps4dareka
- valory/decision_maker_abci:0.1.0:bafybeiaizbnlz46lba6tcwmajpo2z37cpxuobeqmlgdqbdxnt65jr6rely
- valory/trader_abci:0.1.0:bafybeido4dpfcvpyrobs2veoliuwaz2ltuzvo2gqfbsqxgd5tdr7zllyru
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiatdmznskbmr7wxsipv7vqmdagkg2qtdulkyylxdqemkna7hvtqke
- valory/market_manager_abci:0.1.0:bafybeid42tfvzicskpdxeppatzvghj2i2bqdtkgs4wobgadwgtp3jr5rme
- valory/decision_maker_abci:0.1.0:bafybeibwwruz3ivtmfzgvdp6x5u4xju2xgzowyr7bcaetdwwujaccxccwa
- valory/trader_abci:0.1.0:bafybeic42a6pqlbzboldym3vdmbaqntyxrdffbd3jxeomb357va2xkf2iq
- 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
2 changes: 1 addition & 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:bafybeifaw3dk5uklcgj5iftcdhj4p2ymkidoli3uxibq4olddd3eboey7e
agent: valory/trader:0.1.0:bafybeiddrqpwljunbl5abjtkmfmrhqsvlbokocxqqcnlerdx34iek56pxu
number_of_agents: 4
deployment:
agent:
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:bafybeifaw3dk5uklcgj5iftcdhj4p2ymkidoli3uxibq4olddd3eboey7e
agent: valory/trader:0.1.0:bafybeiddrqpwljunbl5abjtkmfmrhqsvlbokocxqqcnlerdx34iek56pxu
number_of_agents: 1
deployment:
agent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def _next_dataset_row(self) -> Optional[Dict[str, str]]:
if available_rows_for_market:
next_mock_data_row = self.shared_state.bet_id_row_manager[sampled_bet_id][0]
else:
# no more bets available for this market
msg = f"No more mock responses for the market with id: {sampled_bet_id}"
self.context.logger.info(msg)
self.shared_state.last_benchmarking_has_run = True
self._rows_exceeded = True
return None
Expand Down Expand Up @@ -184,6 +187,8 @@ def _get_decision(
self._get_response()

if self._mech_response is None:
# TODO this use-case should never happened.
# no more trades for this market
self.context.logger.info("The benchmarking has finished!")
return None

Expand Down Expand Up @@ -511,7 +516,11 @@ def _update_selected_bet(
# update the bet's timestamp of processing and its number of bets for the given id
if self.benchmarking_mode.enabled:
active_sampled_bet = self.get_active_sampled_bet()
active_sampled_bet.processed_timestamp = self.synced_timestamp
active_sampled_bet.processed_timestamp = (
self.shared_state.get_simulated_now_timestamp(
self.bets, self.params.safe_voting_range
)
)
if prediction_response is not None:
active_sampled_bet.n_bets += 1

Expand Down
43 changes: 38 additions & 5 deletions packages/valory/skills/decision_maker_abci/behaviours/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,24 @@ def has_liquidity_changed(self, bet: Bet) -> bool:
previous_bet_liquidity = self.shared_state.liquidity_cache.get(bet.id, None)
return bet.scaledLiquidityMeasure != previous_bet_liquidity

def processable_bet(self, bet: Bet) -> bool:
def processable_bet(self, bet: Bet, now: int) -> bool:
"""Whether we can process the given bet."""
now = self.synced_timestamp

self.context.logger.info(f"Analyzing bet: {bet}")
# Note: `openingTimestamp` is the timestamp when a question stops being available for voting.
within_opening_range = bet.openingTimestamp <= (
now + self.params.sample_bets_closing_days * UNIX_DAY
)
self.context.logger.info(f"within_opening_range ={within_opening_range}")
within_safe_range = now < bet.openingTimestamp + self.params.safe_voting_range
self.context.logger.info(f"within_safe_range ={within_safe_range}")
within_ranges = within_opening_range and within_safe_range

# if we should not rebet, we have all the information we need
if not self.should_rebet:
self.context.logger.info(
f"should rebet is False and has_liquidity_changed is: {self.has_liquidity_changed(bet)}"
)
# the `has_liquidity_changed` check is dangerous; this can result in a bet never being processed
# e.g.:
# 1. a market is selected
Expand Down Expand Up @@ -105,7 +111,16 @@ def _sampled_bet_idx(self, bets: List[Bet]) -> int:

def _sample(self) -> Optional[int]:
"""Sample a bet, mark it as processed, and return its index."""
available_bets = list(filter(self.processable_bet, self.bets))
# modify time "NOW" in benchmarking mode
if self.benchmarking_mode.enabled:
now = self.shared_state.get_simulated_now_timestamp(
self.bets, self.params.safe_voting_range
)
else:
now = self.synced_timestamp
available_bets = list(
filter(lambda bet: self.processable_bet(bet, now=now), self.bets)
)

if len(available_bets) == 0:
msg = "There were no unprocessed bets available to sample from!"
Expand All @@ -128,13 +143,31 @@ def _sample(self) -> Optional[int]:
def async_act(self) -> Generator:
"""Do the action."""
with self.context.benchmark_tool.measure(self.behaviour_id).local():

idx = self._sample()
benchmarking_finished = False
if self.benchmarking_mode.enabled:
if idx == None:
self.context.logger.info(
f"No more markets to bet in the simulated day"
)
self.shared_state.increase_one_day_simulation()
if self.shared_state.check_benchmarking_finished():
self.context.logger.info(
f"No more days to simulate in benchmarking mode"
)
# HERE IS the point we need to change the Payload somehow to trigger the END
# then we should force this round to trigger event.NONE and then benchmarking finished.
benchmarking_finished = True
else:
# try sampling again
idx = self._sample()
self.store_bets()
if idx is None:
bets_hash = None
else:
bets_hash = self.hash_stored_bets()
payload = SamplingPayload(self.context.agent_address, bets_hash, idx)
payload = SamplingPayload(
self.context.agent_address, bets_hash, idx, benchmarking_finished
)

yield from self.finish_behaviour(payload)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ transition_func:
(ClaimRound, NO_MAJORITY): ClaimRound
(ClaimRound, ROUND_TIMEOUT): ClaimRound
(ClaimRound, SUBSCRIPTION_ERROR): ClaimRound
(DecisionReceiveRound, BENCHMARKING_FINISHED): BenchmarkingDoneRound
(DecisionReceiveRound, MOCK_TX): FinishedWithoutDecisionRound
(DecisionReceiveRound, DONE): BetPlacementRound
(DecisionReceiveRound, MECH_RESPONSE_ERROR): BlacklistingRound
(DecisionReceiveRound, NO_MAJORITY): DecisionReceiveRound
Expand Down Expand Up @@ -118,6 +118,7 @@ transition_func:
(SamplingRound, NO_MAJORITY): SamplingRound
(SamplingRound, ROUND_TIMEOUT): SamplingRound
(SamplingRound, BENCHMARK_ENABLED): ToolSelectionRound
(SamplingRound, BENCHMARKING_FINISHED): BenchmarkingDoneRound
(SubscriptionRound, DONE): FinishedSubscriptionRound
(SubscriptionRound, MOCK_TX): ToolSelectionRound
(SubscriptionRound, NONE): SubscriptionRound
Expand Down
47 changes: 47 additions & 0 deletions packages/valory/skills/decision_maker_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
"""This module contains the models for the skill."""

import os
import time
import re
from dataclasses import dataclass, field
from datetime import datetime, timedelta
from pathlib import Path
from string import Template
from typing import (
Expand Down Expand Up @@ -60,6 +62,7 @@
MarketManagerParams,
Subgraph,
)
from packages.valory.skills.market_manager_abci.bets import Bet
from packages.valory.skills.mech_interact_abci.models import (
Params as MechInteractParams,
)
Expand Down Expand Up @@ -211,6 +214,9 @@ def __init__(self, *args: Any, skill_context: SkillContext, **kwargs: Any) -> No
# a mapping from market id to scaled liquidity measure
# also used for the benchmarking mode
self.liquidity_cache: Dict[str, float] = {}
# list with the simulated timestamps for the benchmarking mode
self.simulated_now_timestamps: List[int] = []
self.simulated_now_timestamps_idx: int = 0
# latest liquidity information (only relevant to the benchmarking mode)
self.liquidity_amounts: Dict[str, List[int]] = {}
self.liquidity_prices: Dict[str, List[float]] = {}
Expand Down Expand Up @@ -270,6 +276,47 @@ def bet_id_row_manager(self, mapping: Dict[str, List[int]]) -> None:
"""Set the next_mock_data_row."""
self._bet_id_row_manager = mapping

def _initialize_simulated_now_timestamps(
self, bets: List[Bet], safe_voting_range: int
) -> None:
self.simulated_now_timestamps_idx = 0
# Find the maximum timestamp from openingTimestamp field
max_timestamp = max(bet.openingTimestamp for bet in bets)
# adding range to allow voting (it has to be <)
max_timestamp = max_timestamp - safe_voting_range - 1

# Get current timestamp
now_timestamp = int(time.time())
# Convert timestamps to datetime objects
max_date = datetime.fromtimestamp(max_timestamp)
now_date = datetime.fromtimestamp(now_timestamp)
self.context.logger.info(
f"Simulating timestamps between {now_date} and {max_date}"
)
# Generate list of timestamps with one day intervals
timestamps = []
current_date = now_date

while current_date <= max_date:
timestamps.append(int(current_date.timestamp()))
current_date += timedelta(days=1)
self.context.logger.info(f"Simulated timestamps: {timestamps}")
self.simulated_now_timestamps = timestamps

def increase_one_day_simulation(self) -> None:
self.simulated_now_timestamps_idx += 1

def check_benchmarking_finished(self) -> bool:
return self.simulated_now_timestamps_idx >= len(self.simulated_now_timestamps)

def get_simulated_now_timestamp(
self, bets: List[Bet], safe_voting_range: int
) -> int:
if len(self.simulated_now_timestamps) == 0:
self._initialize_simulated_now_timestamps(bets, safe_voting_range)

return self.simulated_now_timestamps[self.simulated_now_timestamps_idx]

def setup(self) -> None:
"""Set up the model."""
super().setup()
Expand Down
1 change: 1 addition & 0 deletions packages/valory/skills/decision_maker_abci/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class SamplingPayload(UpdateBetsPayload):
"""Represents a transaction payload for the sampling of a bet."""

index: Optional[int]
benchmarking_finished: Optional[bool]


@dataclass(frozen=True)
Expand Down
3 changes: 2 additions & 1 deletion packages/valory/skills/decision_maker_abci/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class DecisionMakerAbciApp(AbciApp[Event]):
Event.NO_MAJORITY: SamplingRound,
Event.ROUND_TIMEOUT: SamplingRound,
Event.BENCHMARKING_ENABLED: ToolSelectionRound,
Event.BENCHMARKING_FINISHED: BenchmarkingDoneRound,
# this is here because of `autonomy analyse fsm-specs` falsely reporting it as missing from the transition
MarketManagerEvent.FETCH_ERROR: ImpossibleRound,
},
Expand Down Expand Up @@ -257,7 +258,7 @@ class DecisionMakerAbciApp(AbciApp[Event]):
Event.NO_MAJORITY: DecisionReceiveRound,
Event.TIE: BlacklistingRound,
Event.UNPROFITABLE: BlacklistingRound,
Event.BENCHMARKING_FINISHED: BenchmarkingDoneRound,
Event.MOCK_TX: FinishedWithoutDecisionRound,
Event.ROUND_TIMEOUT: DecisionReceiveRound, # loop on the same state until Mech deliver is received
},
BlacklistingRound: {
Expand Down
20 changes: 10 additions & 10 deletions packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ fingerprint:
behaviours/blacklisting.py: bafybeifitqx2omj5qdwokizhqjkxvybtsyxo22dxkucbtxaocafzgbseku
behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci
behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e
behaviours/decision_receive.py: bafybeifb7aeu6g4xzmiyfc5ltipigsikfot3foux55gw5oaz2o5u5a4ume
behaviours/decision_request.py: bafybeiabjzzcwcfbfmtoftjhewmkgbhxfnigbc5cwmmxl6cob5gv64jwwa
behaviours/decision_receive.py: bafybeibm7org6gaglndwdsuetrtisik6yil2hi56imwousu52oafma7z5u
behaviours/decision_request.py: bafybeifc5kmafyjae3nrydqytpn5nbjabvfxdliwlisl6ejlqk76hmcr6y
behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm
behaviours/order_subscription.py: bafybeicrmdvhci5prfldvuf3bclbbqi6j7lpv6hmphw3qwgmkmwat3od44
behaviours/randomness.py: bafybeiaoj3awyyg2onhpsdsn3dyczs23gr4smuzqcbw3e5ocljwxswjkce
behaviours/reedem.py: bafybeiaxwp4lx62owcaqfp6xcqh6567f5yvwnl4rage2f5hmq4nltkzjjy
behaviours/round_behaviour.py: bafybeih63hpia2bwwzu563hxs5yd3t5ycvxvkfnhvxbzghbyy3mw3xjl3i
behaviours/sampling.py: bafybeiekxzublnsvgjb2y2uvtye4zkethvmsxh4itonnwmb3sbviyyhsgq
behaviours/storage_manager.py: bafybeif7mrnmhrarndx225e26jseuieosdja4jnlewnv2mtxqdydevxuze
behaviours/sampling.py: bafybeih4lqdqhf5ip6tmtlmxbttyikjcxdey7jfgujcthkyih245pvs7je
behaviours/storage_manager.py: bafybeic7c23rtp3dvgstcusmyxkcm22bpf2bfydljiam2nf55tleym5j3u
behaviours/tool_selection.py: bafybeienlxcgjs3ogyofli3d7q3p5rst3mcxxcnwqf7qolqjeefjtixeke
dialogues.py: bafybeigpwuzku3we7axmxeamg7vn656maww6emuztau5pg3ebsoquyfdqm
fsm_specification.yaml: bafybeier5p5vvk5a44jnewxbuf23zvkudyioygimnzakbqnm7sce3fueki
fsm_specification.yaml: bafybeid5d47zwe7zegrmgzswdkjr6to4veequs43uqxgcs7lol6unadary
handlers.py: bafybeigod6gbjrxy4mbmulbzsbokeaoycoqys64vqtxnumishfukzf73za
io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq
io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa
models.py: bafybeiamwncnjlck2wekswn2czhqtmd4zkzqnf5oqnx6psq5lh2skant5y
payloads.py: bafybeicloiy4ax7dlipwp4czlueflgjgtlev4a6vhn2m7ztoehnemiiko4
models.py: bafybeid7tjyr2sat4spvex2ea2zskxxt42iermpfzraqzoria75s7bs54y
payloads.py: bafybeiehb4dsntwpzalz3ikx2mf3fxdhe7gbntonigibdir4iwu4b4aphu
policy.py: bafybeihcltocxg7zsmvjtx44ilal4zir4fz2rupgmhacktzv5neb2lmas4
redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm
rounds.py: bafybeid725s64adnl2iaoapjwrnsqg5j7u5nhxwwolwexwwjjjtelyanpy
rounds.py: bafybeiaf7fh6b5th2vcjtzhayp4jblxuiyaxoe5fli2rg76eg6jdyi4qrq
states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy
states/base.py: bafybeibyebyeskjnuem3rfwqqkcbqojqfed5ah2nkakfvcstdlstnumlmq
states/base.py: bafybeibdo7xkufqa3ki6wy4xkidk3ffwwfr2vomlxngkztjk3mcvkme6ku
states/bet_placement.py: bafybeibalhxhp2c4oljmiwqi6ds3g36fgtabmf42mb5sgq6z22znrcbhda
states/blacklisting.py: bafybeiapelgjhbjjn4uq4z5gspyirqzwzgccg5anktrp5kxdwamfnfw5mi
states/check_benchmarking.py: bafybeiabv6pq7q45jd3nkor5afmlycqgec5ctuwcfbdukkjjm4imesv4ni
Expand All @@ -50,7 +50,7 @@ fingerprint:
states/order_subscription.py: bafybeidrcef2op3nhq4tjgri3ct5hfhmc22xw2ep6dk4ro6tg7ob6cmioa
states/randomness.py: bafybeiceoo4nx3t4dofpwczw3v5mclramwmzpwjs6hv7l56arodrjx4l5u
states/redeem.py: bafybeica6cn4xg7shea2wjhbqnddgxe5zao2hkmceltze7qknxdhtsoaxe
states/sampling.py: bafybeiep54qm442c7dc7ajfrcs76fa65qh4wnhg6mo44urwjwlmdkm4thy
states/sampling.py: bafybeig3katlffomj4scvhbfgnk64iqnhtkxpoghc4dhiqtploqzqr2psu
states/tool_selection.py: bafybeiak5ihuie4nxh3sguiea6pcdgyxr4k4xyzvq6o2uj5xpf7urocawy
tests/__init__.py: bafybeiakpi3k3kc7wrjj7hrluvjcj36lu2gezpmrctwiz5yg2fe7ggnf3i
tests/behaviours/__init__.py: bafybeic7icz7lfhfepdkqkase7y7zn3a6pwdw6fx4ah2hajmgejawpolc4
Expand Down
5 changes: 5 additions & 0 deletions packages/valory/skills/decision_maker_abci/states/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def sampled_bet_index(self) -> int:
"""Get the sampled bet."""
return int(self.db.get_strict("sampled_bet_index"))

@property
def benchmarking_finished(self) -> int:
"""Get the flag of benchmarking finished."""
return int(self.db.get_strict("benchmarking_finished"))

@property
def is_mech_price_set(self) -> bool:
"""Get whether mech's price is known."""
Expand Down
Loading

0 comments on commit 6c1922e

Please sign in to comment.