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

Hotfix/staking kpi reachability #358

Merged
merged 103 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
dc02d62
add: invested amount variable to Bets class
keshav1998 Nov 21, 2024
49661aa
fix: invested amount update fix
keshav1998 Nov 21, 2024
6504518
edit: change invested amount variable name
keshav1998 Nov 21, 2024
d547c82
update: bet sampling functionality
keshav1998 Nov 21, 2024
530f52c
add: invested amount updation functionality
keshav1998 Nov 21, 2024
a9f44ed
update(bets.py): encapsulate invested amount attribute
keshav1998 Nov 21, 2024
583e8ee
add: queue number attribute to Bet class
keshav1998 Nov 21, 2024
c9aa1af
add: functionality to give priority to older queue
keshav1998 Nov 21, 2024
f5ead30
add: queue number update method
keshav1998 Nov 21, 2024
262a361
add: transaction processed timestamp attribute
keshav1998 Nov 21, 2024
fa76565
add: bet transaction infromation updation
keshav1998 Nov 21, 2024
fb81156
fix: current queue number update methodology
keshav1998 Nov 21, 2024
dffd5df
edit: make private variables public for easy access
keshav1998 Nov 22, 2024
76c4ae0
edit: investment amount update functionality
keshav1998 Nov 22, 2024
54d1963
edit: extract betplacement round name from variable
keshav1998 Nov 22, 2024
97d436b
fix: typo in samplinhg
keshav1998 Nov 22, 2024
cfe3169
fix: typo
annasambrook Nov 22, 2024
fefba99
fix: sampled_bet on update_bet_transaction_information
annasambrook Nov 22, 2024
dd52873
fix: remove return from update_bet_transaction_information
annasambrook Nov 22, 2024
627f5d5
comment: add comment for update_bet_transaction_information
annasambrook Nov 22, 2024
e046f7c
fix: imports ordering
keshav1998 Nov 22, 2024
b0ccc9f
Merge remote-tracking branch 'origin/hotfix/staking-kpi-reachability'…
annasambrook Nov 22, 2024
8d3b9af
fix: only increase current queue number if the queue has been exhausted.
annasambrook Nov 22, 2024
6e58090
Revert "fix: only increase current queue number if the queue has been…
annasambrook Nov 22, 2024
c949ae2
chore: generators
annasambrook Nov 22, 2024
2f6beed
Merge branch 'main' into hotfix/staking-kpi-reachability
keshav1998 Nov 28, 2024
b0d63ab
add: comments for logic of bet transaction update
keshav1998 Nov 28, 2024
4a18889
update: queue no to -1 for blacklisted bets
keshav1998 Nov 28, 2024
423a082
update: bet queue process
keshav1998 Nov 28, 2024
5090305
update: bet sampling process
keshav1998 Nov 28, 2024
f5732a1
update: change transaction variable to previous
keshav1998 Nov 28, 2024
bbded75
remove: transaction timestamp updation
keshav1998 Nov 28, 2024
14283a0
edit: configure txn processed time variable
keshav1998 Nov 28, 2024
b942963
revert: additon of txn timestamp attribute
keshav1998 Nov 28, 2024
f5b6cfe
revert: queue organisation process
keshav1998 Nov 28, 2024
6e03c80
add: other max queue number possibilities
keshav1998 Nov 29, 2024
c2999c9
add: edge case for non processed bets
keshav1998 Nov 29, 2024
bc15710
update: package hashes
keshav1998 Nov 29, 2024
51ddcc1
update: tox changes
keshav1998 Nov 29, 2024
22fb5e6
update: packahe hases post tox changes
keshav1998 Nov 29, 2024
fb2e900
Merge branch 'main' into hotfix/staking-kpi-reachability
keshav1998 Nov 29, 2024
0285b22
update: hases post main sync
keshav1998 Nov 29, 2024
09ab75d
refactor: optimise and streamline act of sampling
keshav1998 Nov 30, 2024
b1b7ef6
edit: sampled bet updation process
keshav1998 Nov 30, 2024
9c64add
add: n_bets increment for sampled bet
keshav1998 Nov 30, 2024
70e146d
fix: update bet txn info call placement
keshav1998 Nov 30, 2024
ea96f2c
update: blacklisting behaviour logic
keshav1998 Dec 1, 2024
f70e884
update: bet filtering process for sampling
keshav1998 Dec 1, 2024
3dec787
add: queue no processing during update bets
keshav1998 Dec 1, 2024
b371f2e
edit: simplify sorting logic
keshav1998 Dec 1, 2024
7a7ce6c
remove: older method of sampling using randomness
keshav1998 Dec 1, 2024
2b8393e
remove: unused import
keshav1998 Dec 1, 2024
6d3422c
fix: Ensure _compute_stop_trading always behaves as a generator
keshav1998 Dec 1, 2024
5333fac
refactor: Simplify _compute_stop_trading by removing unnecessary list
keshav1998 Dec 1, 2024
f5d5567
refactor: sampling process with two queues
keshav1998 Dec 2, 2024
dcc702e
add: queue transitions for sampled bets
keshav1998 Dec 2, 2024
c4c3adf
update: blacklisting mechanishm using queue transitions
keshav1998 Dec 2, 2024
aac3e7c
refactor: queueing behaviour
keshav1998 Dec 2, 2024
9905b4a
add: check point reach flag
keshav1998 Dec 2, 2024
67a2797
add: checkpoint check to market synced data
keshav1998 Dec 2, 2024
d5c8b4a
add: Queue status enum class
keshav1998 Dec 2, 2024
d643aff
Merge branch 'main' into hotfix/staking-kpi-reachability
keshav1998 Dec 2, 2024
9dc6228
update: package hashes
keshav1998 Dec 2, 2024
ad60caa
add: changes introduces by tox run
keshav1998 Dec 3, 2024
a79ea0e
Merge branch 'main' into hotfix/staking-kpi-reachability
keshav1998 Dec 3, 2024
a432519
fix: setup introduced by merging
keshav1998 Dec 3, 2024
4ef03c0
update: hashes
keshav1998 Dec 3, 2024
2f08b74
add: docstring to queue status
keshav1998 Dec 3, 2024
f6eef5d
refactor: sampling behaviour for understandibilty
keshav1998 Dec 4, 2024
038e87a
fix: queue transition for blacklisting
keshav1998 Dec 4, 2024
30a4c11
remove: unused imports
keshav1998 Dec 4, 2024
6b9afe5
lock: package hashes
keshav1998 Dec 4, 2024
3aa2568
relock: packages hasehs
keshav1998 Dec 4, 2024
a0260cd
update: stramline bet queue status transition
keshav1998 Dec 6, 2024
5a92650
add: comment for missing functionality
keshav1998 Dec 6, 2024
24df901
remove: unused imports
keshav1998 Dec 6, 2024
8f4677c
update: streamline queuestatus operation
keshav1998 Dec 6, 2024
328deea
add: setup method to Update bets behaviour
keshav1998 Dec 6, 2024
d2755f3
update: improve bet sorting by queues status
keshav1998 Dec 6, 2024
ae60986
update: sampled bet idx return type
keshav1998 Dec 6, 2024
bd1afd0
fix: bets decoder for bet format
keshav1998 Dec 6, 2024
2ff375d
bump: hashes for packages
keshav1998 Dec 6, 2024
98c50c5
fix: wrong Dict import
keshav1998 Dec 6, 2024
ad354de
bump: package hashes
keshav1998 Dec 6, 2024
110d60f
fix: queustatus fetching during read
keshav1998 Dec 6, 2024
cf41679
bump: update package hashes
keshav1998 Dec 6, 2024
cc08251
update: setup call not required
keshav1998 Dec 6, 2024
769e7a7
fix: none return from sampling
keshav1998 Dec 6, 2024
851eb5d
bump: update hashes
keshav1998 Dec 6, 2024
de956ad
update: bets file path for multi bets
keshav1998 Dec 6, 2024
c915459
update: streamline bets read path
keshav1998 Dec 6, 2024
35610f2
bump: update hashes with read changes
keshav1998 Dec 6, 2024
40e2c4c
fix: error raise on transition
keshav1998 Dec 6, 2024
c05a717
update: next status transition
keshav1998 Dec 6, 2024
fd35046
bump: update hashes
keshav1998 Dec 6, 2024
15c4100
fix: check whether the service has transacted first
Adamantios Dec 9, 2024
e0a0fad
chore: run generators
Adamantios Dec 9, 2024
584b4ab
fix: correctly determine whether a new epoch is reached
Adamantios Dec 11, 2024
8af2865
fix: do not move bets from reprocessed during the same epoch
Adamantios Dec 11, 2024
a02629c
refactor: make methods static
Adamantios Dec 11, 2024
c4b604a
refactor: remove unnecessary initialization
Adamantios Dec 11, 2024
e0d9f7a
test: update the cases for `CallCheckpointPayload`
Adamantios Dec 11, 2024
b8190fc
chore: run generators
Adamantios Dec 11, 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
18 changes: 9 additions & 9 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": "bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa",
"skill/valory/decision_maker_abci/0.1.0": "bafybeig3sqaeqedobqdg7gynrxnbq2kgzh4gp5pe5gxo5kw4hczfjmj6e4",
"skill/valory/trader_abci/0.1.0": "bafybeigm2oqol7yvbspdapdrq3hxugybwmaazom773ncsyz6mlgps7y3pi",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibx63ico4nlp6etvtzgvlcrl3jdy6rx7zodwmxhvvb4phizd732l4",
"skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54",
"agent/valory/trader/0.1.0": "bafybeifwqory3yuyhi6sxkoy3ihyzdbus444pkehyoxiibjqo5mjcawbhe",
"service/valory/trader/0.1.0": "bafybeiezli7klgpvdlvdkh7wxmulyosp7f3xzmkmdtzrgtcloqdng5qcea",
"service/valory/trader_pearl/0.1.0": "bafybeic52jtgilmipang6wcr3ogbfyskwzb7iaat3lur5pe7fjkpkqc7da"
"skill/valory/market_manager_abci/0.1.0": "bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi",
"skill/valory/decision_maker_abci/0.1.0": "bafybeiczxtmesnkxtcm55bkjcsuyg7qllywdioonefr2fovripwv27yozm",
"skill/valory/trader_abci/0.1.0": "bafybeiahjgvfeq3b6c5fq3hkvooermantgqv5tbpn5we5fumsnsyipe5jy",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeid6nvwb4e2tllkft252vaqtf24xmrfgd4inf44vzzounp4ms4xn4m",
"skill/valory/staking_abci/0.1.0": "bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni",
"agent/valory/trader/0.1.0": "bafybeihwgq4znzidrzin3fq2bgyk7avn43z67cuxqunnev7vayfhilotdi",
"service/valory/trader/0.1.0": "bafybeibvzb24iz34faipmhvmux65vav6xfvh7ytydc2oxo3yupjxlam7ce",
"service/valory/trader_pearl/0.1.0": "bafybeiexnbofsonvfsuftx5jzrcdgp475yd4nnrvtlqs6utqdeq4scwwpu"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
12 changes: 6 additions & 6 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ 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:bafybeibx63ico4nlp6etvtzgvlcrl3jdy6rx7zodwmxhvvb4phizd732l4
- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa
- valory/decision_maker_abci:0.1.0:bafybeig3sqaeqedobqdg7gynrxnbq2kgzh4gp5pe5gxo5kw4hczfjmj6e4
- valory/trader_abci:0.1.0:bafybeigm2oqol7yvbspdapdrq3hxugybwmaazom773ncsyz6mlgps7y3pi
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/check_stop_trading_abci:0.1.0:bafybeib75qrimmvensqmskdp5kzki5ijjwolqk2ojekeommakaf64mzn54
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeid6nvwb4e2tllkft252vaqtf24xmrfgd4inf44vzzounp4ms4xn4m
- valory/market_manager_abci:0.1.0:bafybeigmclk3pe3h2b57kcem4xlhkfgca5sosbstyqqoq6pnkt7uuhzvwi
- valory/decision_maker_abci:0.1.0:bafybeiczxtmesnkxtcm55bkjcsuyg7qllywdioonefr2fovripwv27yozm
- valory/trader_abci:0.1.0:bafybeiahjgvfeq3b6c5fq3hkvooermantgqv5tbpn5we5fumsnsyipe5jy
- valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i
- valory/check_stop_trading_abci:0.1.0:bafybeier2qz5xkiha5krgav7hfrxvb5666csxyko4drfgouj5htjmmvwni
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
customs:
- valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m
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:bafybeifwqory3yuyhi6sxkoy3ihyzdbus444pkehyoxiibjqo5mjcawbhe
agent: valory/trader:0.1.0:bafybeihwgq4znzidrzin3fq2bgyk7avn43z67cuxqunnev7vayfhilotdi
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:bafybeifwqory3yuyhi6sxkoy3ihyzdbus444pkehyoxiibjqo5mjcawbhe
agent: valory/trader:0.1.0:bafybeihwgq4znzidrzin3fq2bgyk7avn43z67cuxqunnev7vayfhilotdi
number_of_agents: 1
deployment:
agent:
Expand Down
11 changes: 7 additions & 4 deletions packages/valory/skills/check_stop_trading_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,27 +140,30 @@ def is_staking_kpi_met(self) -> Generator[None, None, bool]:
return True
return False

def _compute_stop_trading(self) -> Generator:
def _compute_stop_trading(self) -> Generator[None, None, bool]:
# This is a "hacky" way of getting required data initialized on
# the Trader: On first period, the FSM needs to initialize some
# data on the trading branch so that it is available in the
# cross-period persistent keys.
if self.is_first_period:
self.context.logger.debug(f"{self.is_first_period=}")
yield # ensures this is a generator
return False

self.context.logger.debug(f"{self.params.disable_trading=}")
if self.params.disable_trading:
yield # ensures this is a generator
Adamantios marked this conversation as resolved.
Show resolved Hide resolved
return True

stop_trading_conditions = []
self.context.logger.debug(f"{self.params.stop_trading_if_staking_kpi_met=}")
if self.params.stop_trading_if_staking_kpi_met:
staking_kpi_met = yield from self.is_staking_kpi_met()
self.context.logger.debug(f"{staking_kpi_met=}")
stop_trading_conditions.append(staking_kpi_met)

return any(stop_trading_conditions)
return staking_kpi_met
Adamantios marked this conversation as resolved.
Show resolved Hide resolved

yield
return False

def async_act(self) -> Generator:
"""Do the action."""
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/check_stop_trading_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0'
fingerprint:
README.md: bafybeif2pq7fg5upl6vmfgfzpiwsh4nbk4zaeyz6upyucqi5tasrxgq4ee
__init__.py: bafybeifc23rlw2hzhplp3wfceixnmwq5ztnixhh7jp4dd5av3crwp3x22a
behaviours.py: bafybeifdfqkczchnbfzzb4q2gwe3qqrn5ci2tk4mq65bunivjkw4scuzse
behaviours.py: bafybeicair2lh5wx7sjzied2z755nhlcwa3jznt7mayvsjkky43jz7lh5u
dialogues.py: bafybeictrrnwcijiejczy23dfvbx5kujgef3dulzqhs3etl2juvz5spm2e
fsm_specification.yaml: bafybeihhau35a5xclncjpxh5lg7qiw34xs4d5qlez7dnjpkf45d3gc57ai
handlers.py: bafybeiard64fwxib3rtyp67ymhf222uongcyqhfhdyttpsyqkmyh5ajipu
Expand All @@ -27,7 +27,7 @@ contracts:
protocols: []
skills:
- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/staking_abci:0.1.0:bafybeibjgipzfle3b2gtuh42u2y6umgf47a5qrdtbvni46tox4lgv6wm4i
behaviours:
main:
args: {}
Expand Down
16 changes: 16 additions & 0 deletions packages/valory/skills/decision_maker_abci/behaviours/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,22 @@ def check_balance(self) -> WaitableConditionType:
self._report_balance()
return True

def update_bet_transaction_information(self) -> None:
"""Get whether the bet's invested amount should be updated."""
sampled_bet = self.sampled_bet
# Update the bet's invested amount, the new bet amount is added to previously invested amount
sampled_bet.invested_amount += self.synchronized_data.bet_amount
# Update bet transaction timestamp
sampled_bet.processed_timestamp = self.synced_timestamp
# update no of bets made
sampled_bet.n_bets += 1
# Update Queue number for priority logic
sampled_bet.queue_status = sampled_bet.queue_status.next_status()

# the bets are stored here, but we do not update the hash in the synced db in the redeeming round
# this will need to change if this sovereign agent is ever converted to a multi-agent service
self.store_bets()
keshav1998 marked this conversation as resolved.
Show resolved Hide resolved

def send_message(
self, msg: Message, dialogue: Dialogue, callback: Callable
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ def _blacklist(self) -> None:
"""Blacklist the sampled bet."""
sampled_bet_index = self.synchronized_data.sampled_bet_index
sampled_bet = self.bets[sampled_bet_index]

# the question is blacklisted, i.e., we did not place a bet on it,
# therefore, we decrease the number of bets which was increased on sampling
sampled_bet.n_bets -= 1
# therefore, we bump to the queue status to next status
sampled_bet.queue_status = sampled_bet.queue_status.next_status()

def setup(self) -> None:
"""Setup the behaviour"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,25 +508,18 @@ def _update_selected_bet(
) -> None:
"""Update the 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.shared_state.get_simulated_now_timestamp(
self.bets, self.params.safe_voting_range
)
)
self.context.logger.info(f"Updating bet id: {active_sampled_bet.id}")
self.context.logger.info(
f"with the timestamp:{datetime.fromtimestamp(active_sampled_bet.processed_timestamp)}"
active_sampled_bet = self.get_active_sampled_bet()
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

else:
# update the bet's timestamp of processing and its number of bets for the given
sampled_bet = self.sampled_bet
sampled_bet.n_bets += 1
sampled_bet.processed_timestamp = self.synced_timestamp
keshav1998 marked this conversation as resolved.
Show resolved Hide resolved
)
self.context.logger.info(f"Updating bet id: {active_sampled_bet.id}")
self.context.logger.info(
f"with the timestamp:{datetime.fromtimestamp(active_sampled_bet.processed_timestamp)}"
)
if prediction_response is not None:
active_sampled_bet.n_bets += 1

self.store_bets()

Expand Down Expand Up @@ -558,6 +551,7 @@ def async_act(self) -> Generator:
prediction_response,
bet_amount,
)

# always remove the processed trade from the benchmarking input file
# now there is one reader pointer per market
if self.benchmarking_mode.enabled:
Expand All @@ -568,7 +562,8 @@ def async_act(self) -> Generator:
if rows_queue:
rows_queue.pop(0)

self._update_selected_bet(prediction_response)
self._update_selected_bet(prediction_response)

payload = DecisionReceivePayload(
self.context.agent_address,
bets_hash,
Expand Down
14 changes: 14 additions & 0 deletions packages/valory/skills/decision_maker_abci/behaviours/reedem.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
FPMM,
Trade,
)
from packages.valory.skills.decision_maker_abci.states.bet_placement import (
BetPlacementRound,
)
from packages.valory.skills.decision_maker_abci.states.redeem import RedeemRound
from packages.valory.skills.market_manager_abci.graph_tooling.requests import (
FetchStatus,
Expand Down Expand Up @@ -970,6 +973,17 @@ def async_act(self) -> Generator:
if self.benchmarking_mode.enabled:
payload = self._benchmarking_act()
else:
# Checking if the last round that submitted the transaction was the bet placement round
# If so, we need to update the bet transaction information, because the transaction was successful
# tx settlement multiplexer assures transitions from Post transaction to Redeem round
# only if the transaction was successful
if (
self.synchronized_data.did_transact
and self.synchronized_data.tx_submitter
== BetPlacementRound.auto_round_id()
):
self.update_bet_transaction_information()

payload = yield from self._normal_act()
if payload is None:
return
Expand Down
Loading
Loading