Skip to content

Commit 94b1e2f

Browse files
authored
Merge pull request #512 from valory-xyz/develop
v0.26.1
2 parents f3bb175 + 782fb9a commit 94b1e2f

21 files changed

Lines changed: 638 additions & 639 deletions

File tree

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,21 @@ build-agent-runner-mac:
161161
--onefile pyinstaller/trader_bin.py \
162162
--codesign-identity "${SIGN_ID}" \
163163
--name agent_runner_bin
164-
./dist/agent_runner_bin 1>/dev/null
164+
./dist/agent_runner_bin 1>/dev/null
165+
166+
167+
AUTONOMY_VERSION := v$(shell autonomy --version | grep -oP '(?<=version\s)\S+')
168+
AEA_VERSION := v$(shell aea --version | grep -oP '(?<=version\s)\S+')
169+
MECH_INTERACT_VERSION := $(shell git ls-remote --tags --sort="v:refname" https://github.com/valory-xyz/mech-interact.git | tail -n1 | sed 's|.*refs/tags/||')
170+
171+
.PHONY: sync-packages
172+
sync-packages:
173+
@echo "Syncing packages with versions:"
174+
@echo "Autonomy version: $(AUTONOMY_VERSION)"
175+
@echo "AEA version: $(AEA_VERSION)"
176+
@echo "Mech Interact version: $(MECH_INTERACT_VERSION)"
177+
autonomy packages sync \
178+
--source valory-xyz/open-aea:$(AEA_VERSION) \
179+
--source valory-xyz/open-autonomy:$(AUTONOMY_VERSION) \
180+
--source valory-xyz/mech-interact:$(MECH_INTERACT_VERSION) \
181+
--update-packages

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Next, prepare the [Safe](https://safe.global/). The trader agent runs as part of
5757
which is an [autonomous service](https://docs.autonolas.network/open-autonomy/get_started/what_is_an_agent_service/)
5858
represented on-chain in the [Autonolas Protocol](https://docs.autonolas.network/protocol/) by a [Safe](https://safe.global/) multisig. Follow the next steps to obtain a **Safe address** corresponding to your agent address:
5959

60-
1. Visit https://registry.olas.network/gnosis/services/mint and connect to the Gnosis network. We recommend connecting using a wallet with a Gnosis EOA account that you own.
60+
1. Visit https://marketplace.olas.network/gnosis/ai-agents/mint and connect to the Gnosis network. We recommend connecting using a wallet with a Gnosis EOA account that you own.
6161
2. Fill in the following fields:
6262
- *"Owner address"*: a Gnosis address for which you will be able to sign later using a supported wallet. If you want to use the address you are connected to, click on *"Prefill Address"*.
6363
- Click on *"Generate Hash & File"* and enter the value corresponding to the `service/valory/trader/0.1.0` key in [`packages.json`](./packages/packages.json)

packages/packages.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
"contract/valory/realitio/0.1.0": "bafybeieggqkuslxiuapneygnhkhgatk5jvjbw6p7ltxaab6au466ikxm3e",
99
"contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4",
1010
"contract/valory/conditional_tokens/0.1.0": "bafybeiai7zwtdab2izyitvxph42kwtbvx6n5skm3i6jijd2653xjkoqd24",
11-
"contract/valory/agent_registry/0.1.0": "bafybeia2eoorxpsfwnd2dnvgt2v3xxqez6d4zyxvqpnwo5oydcgxkr2uni",
11+
"contract/valory/agent_registry/0.1.0": "bafybeiepkbcx5jrcvoc5nfarw6gt4so4izqxuiliu7gukdvmjiodynecvy",
1212
"contract/valory/service_staking_token/0.1.0": "bafybeib5wmpbxngsg46u4ggunvkfkfgeyewunjhoj4vdjlqpgztha6summ",
1313
"contract/valory/transfer_nft_condition/0.1.0": "bafybeicq5jkvpdfciqybxs2n7zwkuprdcksuf7xcgyfxzbbd4w33rk5g3m",
1414
"contract/valory/mech_activity/0.1.0": "bafybeib3fsk4vaigytomohw6hovems7sr4nsbwlfm52724st5eorail444",
1515
"contract/valory/staking_token/0.1.0": "bafybeigzerw3sxvrd4y6g4b5j6duqbjvxmqvarf2m5xovjsthhxyogpypm",
1616
"contract/valory/relayer/0.1.0": "bafybeihypuljybkocl6iiacy52py7i5iqxdli3ily66q7b3nego4qajvne",
1717
"contract/valory/market_maker/0.1.0": "bafybeigzfyzbixum5cqvcbyc24dqwce25dr6nyqvgjm2eqpt6tgo2perd4",
18-
"skill/valory/market_manager_abci/0.1.0": "bafybeigzbjix5utljmbw5nqhw3tkozlb6r73urutdpxtefge4ijdwqqwuq",
19-
"skill/valory/decision_maker_abci/0.1.0": "bafybeidnk3j46n57yuytiyxidcexvp6htymwbgxduxwhqrofqupsdro2ii",
20-
"skill/valory/trader_abci/0.1.0": "bafybeidynr2wrodygexag5dqj2bl7sxnu7i7mvue3ipvtljx66mmueudee",
21-
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicse7mucign56twhsfg2faek7fqk7kpltt6alzmowo5ywtmazudky",
18+
"skill/valory/market_manager_abci/0.1.0": "bafybeif3zwrjq6suryleltxd3vkta5zeiczyrzpgsbwjlpo26g2gfxf4iq",
19+
"skill/valory/decision_maker_abci/0.1.0": "bafybeigkgckbouyrwxz5xlghe67grkfxfouncfo5kfx4fbqjhj4zfk6dsm",
20+
"skill/valory/trader_abci/0.1.0": "bafybeicl6x5vpb255xusjmnejmwei45s4cdrpq7skrl6e6qbz6juwlka7y",
21+
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeieqlxslnt7fuy3x2xwzbig4dkjwgyz7q7rrjlskhcaxzok6fgntv4",
2222
"skill/valory/staking_abci/0.1.0": "bafybeifupwkfbxa4c4jogpudvzwt5rkgfuedgd65sj2bf2z5ver4phq64m",
23-
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeibb4gq5u4w6dmabdgsaffsispamxbgkm27oc3llclyvtwezc3df5q",
24-
"agent/valory/trader/0.1.0": "bafybeigjkxarqcmilwcj23ucsrahgoafvohomv7s6uiqttjdooqocjztea",
25-
"service/valory/trader/0.1.0": "bafybeigavavxqzph4chfiperwo4ygmoekmgbgwwtlxggt43w7mgdyctq64",
26-
"service/valory/trader_pearl/0.1.0": "bafybeidugmpnwbxyfe74dli7cgs27kjwirvlw2ufqeuyqqbrbzktoklfsi"
23+
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeifcc2dkyijmzuwli2ovg72ypmx6vplj3klgxcblnwvyxz3t4jfcpy",
24+
"agent/valory/trader/0.1.0": "bafybeig2ued5fzjpxf5g5girkyrxe3mki7ynjto4u3aivefqf4bhc7qkg4",
25+
"service/valory/trader/0.1.0": "bafybeialbj4pe543o365ml3loakjnlblkg7wksbvohquvjshpoxolpgzsm",
26+
"service/valory/trader_pearl/0.1.0": "bafybeifhxeoar5hdwilmnzhy6jf664zqp5lgrzi6lpbkc4qmoqrr24ow4q"
2727
},
2828
"third_party": {
2929
"protocol/valory/acn_data_share/0.1.0": "bafybeih5ydonnvrwvy2ygfqgfabkr47s4yw3uqxztmwyfprulwfsoe7ipq",
@@ -36,16 +36,16 @@
3636
"protocol/valory/tendermint/0.1.0": "bafybeigydrbfrlmr4f7shbtqx44kvmbg22im27mxdap2e3m5tkti6t445y",
3737
"protocol/valory/ipfs/0.1.0": "bafybeifi2nri7sprmkez4rqzwb4lnu6peoy3bax5k6asf6k5ms7kmjpmkq",
3838
"protocol/valory/srr/0.1.0": "bafybeihrixgptxuqpf2s4nujypwlv5aed2nboozq5kl4c26cxw6r7si2x4",
39-
"contract/valory/agent_registry/0.1.0": "bafybeia2eoorxpsfwnd2dnvgt2v3xxqez6d4zyxvqpnwo5oydcgxkr2uni",
39+
"contract/valory/agent_registry/0.1.0": "bafybeiepkbcx5jrcvoc5nfarw6gt4so4izqxuiliu7gukdvmjiodynecvy",
4040
"contract/valory/complementary_service_metadata/0.1.0": "bafybeibu65wpdsbrbrt2wnf2lr3psy26jiaomyjkg4twbupve7o3kso2aa",
4141
"contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeidfvyc6bw4uigv3jfcxr23vysctki6x5rh5htp2azhncib27ydxdm",
4242
"contract/valory/gnosis_safe/0.1.0": "bafybeibgpgpi7w6xtxg3zr7tye3f6g6tu7fnvy7yxlgunbjqin3ou7e5pi",
43-
"contract/valory/mech/0.1.0": "bafybeib32m5zriagivlj7insajfs4jm5o5h53eym32wjjjp6qwv4lzl3pu",
44-
"contract/valory/mech_marketplace/0.1.0": "bafybeiar6rga33fkh5krhny5grcvpdbrpqglexle67am3livz35ksjiquq",
43+
"contract/valory/mech/0.1.0": "bafybeifthpyd2oq5izworldr755sigefinki7caath4aao3hrajpjbhbxe",
44+
"contract/valory/mech_marketplace/0.1.0": "bafybeibigvscbk5tbfgwlnu6bpnng7yiahyqoholepj7q6sy53gl7w4nbi",
4545
"contract/valory/mech_mm/0.1.0": "bafybeibbz2hlyvtg6yfojzdnou2xqbpu32a4mjvn2xidfypvwy5oj6gx4u",
4646
"contract/valory/service_registry/0.1.0": "bafybeigaginvk2i6rycppfomk6tldkvunik6atuxtjpuuw6ndckymcojne",
4747
"contract/valory/multisend/0.1.0": "bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y",
48-
"contract/valory/erc20/0.1.0": "bafybeifyjub3v62r53by76u7cli7oqvg5qukb4e6gaa62z34euqfwnrsvi",
48+
"contract/valory/erc20/0.1.0": "bafybeif2ad3gsp7zhmw55rpfy7kiooqjswanyvjisdu43kqaoycspfrbui",
4949
"contract/valory/mech_marketplace_legacy/0.1.0": "bafybeiafwem7v7po7xb7rag4zfdqe2uoaqki3xybviciypxr5w6zkoxgse",
5050
"connection/valory/abci/0.1.0": "bafybeidn5gc6y3a6tkhgv753kkiub3mfas3tkemm4fs7i4kc4klkjlxpui",
5151
"connection/valory/http_client/0.23.0": "bafybeid5ffvg76ejjoese7brj5ji3lx66cu7p2ixfwflpo6rgofkypfd7y",
@@ -60,6 +60,6 @@
6060
"skill/valory/abstract_round_abci/0.1.0": "bafybeiey45kkbniukmtpdjduwazpyygaiayeo7mh3tu6wfbau2bxvuljmy",
6161
"skill/valory/transaction_settlement_abci/0.1.0": "bafybeic2ywzpwkyeqbzsvkbvurhsptemam4xtceihax2tmxmlxtgd3xpya",
6262
"skill/valory/termination_abci/0.1.0": "bafybeibtbboau3q5fxfviwm7lbeix4z55uptfqqiyiu6siivxwkp3o5pju",
63-
"skill/valory/mech_interact_abci/0.1.0": "bafybeib6hw4c6u56j2xrfdj6vsr27ppkpzmsmrlflhsvkq42ifol45crni"
63+
"skill/valory/mech_interact_abci/0.1.0": "bafybeihwuhjifsksoht35q6wk2qwwkzsqvo6sjgzwapyeg2wr7w2lpjp3m"
6464
}
6565
}

packages/valory/agents/trader/aea-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ contracts:
2222
- valory/service_registry:0.1.0:bafybeigaginvk2i6rycppfomk6tldkvunik6atuxtjpuuw6ndckymcojne
2323
- valory/market_maker:0.1.0:bafybeigzfyzbixum5cqvcbyc24dqwce25dr6nyqvgjm2eqpt6tgo2perd4
2424
- valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y
25-
- valory/mech:0.1.0:bafybeib32m5zriagivlj7insajfs4jm5o5h53eym32wjjjp6qwv4lzl3pu
25+
- valory/mech:0.1.0:bafybeifthpyd2oq5izworldr755sigefinki7caath4aao3hrajpjbhbxe
2626
- valory/conditional_tokens:0.1.0:bafybeiai7zwtdab2izyitvxph42kwtbvx6n5skm3i6jijd2653xjkoqd24
2727
- valory/realitio:0.1.0:bafybeieggqkuslxiuapneygnhkhgatk5jvjbw6p7ltxaab6au466ikxm3e
2828
- valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4
29-
- valory/agent_registry:0.1.0:bafybeia2eoorxpsfwnd2dnvgt2v3xxqez6d4zyxvqpnwo5oydcgxkr2uni
29+
- valory/agent_registry:0.1.0:bafybeiepkbcx5jrcvoc5nfarw6gt4so4izqxuiliu7gukdvmjiodynecvy
3030
- valory/service_staking_token:0.1.0:bafybeib5wmpbxngsg46u4ggunvkfkfgeyewunjhoj4vdjlqpgztha6summ
3131
- valory/transfer_nft_condition:0.1.0:bafybeicq5jkvpdfciqybxs2n7zwkuprdcksuf7xcgyfxzbbd4w33rk5g3m
32-
- valory/erc20:0.1.0:bafybeifyjub3v62r53by76u7cli7oqvg5qukb4e6gaa62z34euqfwnrsvi
32+
- valory/erc20:0.1.0:bafybeif2ad3gsp7zhmw55rpfy7kiooqjswanyvjisdu43kqaoycspfrbui
3333
- valory/staking_token:0.1.0:bafybeigzerw3sxvrd4y6g4b5j6duqbjvxmqvarf2m5xovjsthhxyogpypm
3434
- valory/mech_activity:0.1.0:bafybeib3fsk4vaigytomohw6hovems7sr4nsbwlfm52724st5eorail444
35-
- valory/mech_marketplace:0.1.0:bafybeiar6rga33fkh5krhny5grcvpdbrpqglexle67am3livz35ksjiquq
35+
- valory/mech_marketplace:0.1.0:bafybeibigvscbk5tbfgwlnu6bpnng7yiahyqoholepj7q6sy53gl7w4nbi
3636
- valory/relayer:0.1.0:bafybeihypuljybkocl6iiacy52py7i5iqxdli3ily66q7b3nego4qajvne
3737
- valory/mech_marketplace_legacy:0.1.0:bafybeiafwem7v7po7xb7rag4zfdqe2uoaqki3xybviciypxr5w6zkoxgse
3838
- valory/mech_mm:0.1.0:bafybeibbz2hlyvtg6yfojzdnou2xqbpu32a4mjvn2xidfypvwy5oj6gx4u
@@ -55,13 +55,13 @@ skills:
5555
- valory/reset_pause_abci:0.1.0:bafybeiachgo6reit2q4jw75mefw2acj4ldedeqmn3rewjm4dbzts2l7oxe
5656
- valory/termination_abci:0.1.0:bafybeibtbboau3q5fxfviwm7lbeix4z55uptfqqiyiu6siivxwkp3o5pju
5757
- valory/transaction_settlement_abci:0.1.0:bafybeic2ywzpwkyeqbzsvkbvurhsptemam4xtceihax2tmxmlxtgd3xpya
58-
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicse7mucign56twhsfg2faek7fqk7kpltt6alzmowo5ywtmazudky
59-
- valory/market_manager_abci:0.1.0:bafybeigzbjix5utljmbw5nqhw3tkozlb6r73urutdpxtefge4ijdwqqwuq
60-
- valory/decision_maker_abci:0.1.0:bafybeidnk3j46n57yuytiyxidcexvp6htymwbgxduxwhqrofqupsdro2ii
61-
- valory/trader_abci:0.1.0:bafybeidynr2wrodygexag5dqj2bl7sxnu7i7mvue3ipvtljx66mmueudee
58+
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeieqlxslnt7fuy3x2xwzbig4dkjwgyz7q7rrjlskhcaxzok6fgntv4
59+
- valory/market_manager_abci:0.1.0:bafybeif3zwrjq6suryleltxd3vkta5zeiczyrzpgsbwjlpo26g2gfxf4iq
60+
- valory/decision_maker_abci:0.1.0:bafybeigkgckbouyrwxz5xlghe67grkfxfouncfo5kfx4fbqjhj4zfk6dsm
61+
- valory/trader_abci:0.1.0:bafybeicl6x5vpb255xusjmnejmwei45s4cdrpq7skrl6e6qbz6juwlka7y
6262
- valory/staking_abci:0.1.0:bafybeifupwkfbxa4c4jogpudvzwt5rkgfuedgd65sj2bf2z5ver4phq64m
63-
- valory/check_stop_trading_abci:0.1.0:bafybeibb4gq5u4w6dmabdgsaffsispamxbgkm27oc3llclyvtwezc3df5q
64-
- valory/mech_interact_abci:0.1.0:bafybeib6hw4c6u56j2xrfdj6vsr27ppkpzmsmrlflhsvkq42ifol45crni
63+
- valory/check_stop_trading_abci:0.1.0:bafybeifcc2dkyijmzuwli2ovg72ypmx6vplj3klgxcblnwvyxz3t4jfcpy
64+
- valory/mech_interact_abci:0.1.0:bafybeihwuhjifsksoht35q6wk2qwwkzsqvo6sjgzwapyeg2wr7w2lpjp3m
6565
customs:
6666
- valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m
6767
- valory/bet_amount_per_threshold:0.1.0:bafybeihsjx7we6b2scjt7777xmjte36rrubblusitqsipjhkttk4cmf5iu

packages/valory/services/trader/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license: Apache-2.0
77
fingerprint:
88
README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq
99
fingerprint_ignore_patterns: []
10-
agent: valory/trader:0.1.0:bafybeigjkxarqcmilwcj23ucsrahgoafvohomv7s6uiqttjdooqocjztea
10+
agent: valory/trader:0.1.0:bafybeig2ued5fzjpxf5g5girkyrxe3mki7ynjto4u3aivefqf4bhc7qkg4
1111
number_of_agents: 4
1212
deployment:
1313
agent:

packages/valory/services/trader_pearl/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: Apache-2.0
88
fingerprint:
99
README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e
1010
fingerprint_ignore_patterns: []
11-
agent: valory/trader:0.1.0:bafybeigjkxarqcmilwcj23ucsrahgoafvohomv7s6uiqttjdooqocjztea
11+
agent: valory/trader:0.1.0:bafybeig2ued5fzjpxf5g5girkyrxe3mki7ynjto4u3aivefqf4bhc7qkg4
1212
number_of_agents: 1
1313
deployment:
1414
agent:

packages/valory/skills/check_stop_trading_abci/skill.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ fingerprint:
2323
fingerprint_ignore_patterns: []
2424
connections: []
2525
contracts:
26-
- valory/mech:0.1.0:bafybeib32m5zriagivlj7insajfs4jm5o5h53eym32wjjjp6qwv4lzl3pu
27-
- valory/mech_marketplace:0.1.0:bafybeiar6rga33fkh5krhny5grcvpdbrpqglexle67am3livz35ksjiquq
26+
- valory/mech:0.1.0:bafybeifthpyd2oq5izworldr755sigefinki7caath4aao3hrajpjbhbxe
27+
- valory/mech_marketplace:0.1.0:bafybeibigvscbk5tbfgwlnu6bpnng7yiahyqoholepj7q6sy53gl7w4nbi
2828
protocols: []
2929
skills:
3030
- valory/abstract_round_abci:0.1.0:bafybeiey45kkbniukmtpdjduwazpyygaiayeo7mh3tu6wfbau2bxvuljmy
31-
- valory/mech_interact_abci:0.1.0:bafybeib6hw4c6u56j2xrfdj6vsr27ppkpzmsmrlflhsvkq42ifol45crni
31+
- valory/mech_interact_abci:0.1.0:bafybeihwuhjifsksoht35q6wk2qwwkzsqvo6sjgzwapyeg2wr7w2lpjp3m
3232
- valory/staking_abci:0.1.0:bafybeifupwkfbxa4c4jogpudvzwt5rkgfuedgd65sj2bf2z5ver4phq64m
3333
behaviours:
3434
main:

packages/valory/skills/decision_maker_abci/behaviours/base.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,26 @@ def token_address(self) -> str:
149149
subscription_params = self.subscription_params
150150
return subscription_params["token_address"]
151151

152+
@property
153+
def market_maker_contract_address(self) -> str:
154+
"""Get the contract address of the market maker on which the service is going to place the bet."""
155+
return self.sampled_bet.id
156+
157+
@property
158+
def investment_amount(self) -> int:
159+
"""Get the investment amount of the bet."""
160+
return self.synchronized_data.bet_amount
161+
162+
@property
163+
def return_amount(self) -> int:
164+
"""Get the return amount."""
165+
return self.sampled_bet.get_vote_amount(self.outcome_index)
166+
167+
@property
168+
def outcome_index(self) -> int:
169+
"""Get the index of the outcome that the service is going to place a bet on."""
170+
return cast(int, self.synchronized_data.vote)
171+
152172
def strategy_exec(self, strategy: str) -> Optional[Tuple[str, str]]:
153173
"""Get the executable strategy file's content."""
154174
return self.shared_state.strategies_executables.get(strategy, None)
@@ -815,7 +835,7 @@ def _calc_sell_amount(self) -> WaitableConditionType:
815835

816836
def _build_token_tx(self, operation: TradingOperation) -> WaitableConditionType:
817837
"""Get the tx data encoded for buying or selling tokens."""
818-
params = {
838+
params: Dict[str, Any] = {
819839
"performative": ContractApiMessage.Performative.GET_STATE, # type: ignore
820840
"contract_address": self.market_maker_contract_address,
821841
"contract_id": str(FixedProductMarketMakerContract.contract_id),

packages/valory/skills/decision_maker_abci/behaviours/bet_placement.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
"""This module contains the behaviour for sampling a bet."""
2121

22-
from typing import Any, Generator, Optional, cast
22+
from typing import Any, Generator, Optional
2323

2424
from hexbytes import HexBytes
2525

@@ -47,26 +47,11 @@ def __init__(self, **kwargs: Any) -> None:
4747
super().__init__(**kwargs)
4848
self.buy_amount = 0
4949

50-
@property
51-
def market_maker_contract_address(self) -> str:
52-
"""Get the contract address of the market maker on which the service is going to place the bet."""
53-
return self.sampled_bet.id
54-
55-
@property
56-
def investment_amount(self) -> int:
57-
"""Get the investment amount of the bet."""
58-
return self.synchronized_data.bet_amount
59-
6050
@property
6151
def w_xdai_deficit(self) -> int:
6252
"""Get the amount of missing wxDAI for placing the bet."""
6353
return self.investment_amount - self.token_balance
6454

65-
@property
66-
def outcome_index(self) -> int:
67-
"""Get the index of the outcome that the service is going to place a bet on."""
68-
return cast(int, self.synchronized_data.vote)
69-
7055
def _build_exchange_tx(self) -> WaitableConditionType:
7156
"""Exchange xDAI to wxDAI."""
7257
response_msg = yield from self.get_contract_api_response(

packages/valory/skills/decision_maker_abci/behaviours/decision_receive.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,10 @@ def async_act(self) -> Generator:
602602
policy = None
603603
should_be_sold = False
604604
if prediction_response is not None and prediction_response.vote is not None:
605-
if self.should_sell_outcome_tokens(prediction_response):
605+
if (
606+
self.review_bets_for_selling_mode
607+
and self.should_sell_outcome_tokens(prediction_response)
608+
):
606609
self.context.logger.info(
607610
"The bet response has changed, so we need to sell the outcome tokens"
608611
)

0 commit comments

Comments
 (0)