Skip to content

Commit

Permalink
merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberosa committed Jun 24, 2024
1 parent a27eb32 commit e9f7644
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 29 deletions.
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": "bafybeig4fl35dn7d5gnprux2nwsqbirm7zkiujz3xvrwcjuktz6hkq4as4",
"contract/valory/relayer/0.1.0": "bafybeiaabvxim4blp5fxb6qjlzjivtvkme3fk24h5jte7w6vr6rsx72j6u",
"skill/valory/market_manager_abci/0.1.0": "bafybeicbvxvjkoksbknujaid5hx7krjlgm6barcjcwo33tdccanrcp674a",
"skill/valory/decision_maker_abci/0.1.0": "bafybeigloegbrrgjostndf3wurob3d7hqzmwbo4tnut7nz5ukt6pqxpn7i",
"skill/valory/trader_abci/0.1.0": "bafybeibru3ibshslunk7fisbagf2fuciwiojcfimoy4enl2cqdvnnvr6yi",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeifusfglfvmxsv7llyx2mhdvtrihrumbeb4membp7bzzfodajtcjxu",
"skill/valory/decision_maker_abci/0.1.0": "bafybeigianh43fjwufi5bv4n4cjsa5nuv5cihuq5db6xyya347d4brxd2m",
"skill/valory/trader_abci/0.1.0": "bafybeigxsa4uvssmhghokwscwca7flu7eiqr6aq5me4wn2v22od6lxmotm",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaj4us7tbtc2ctpofnrk6fkk7uekcjx65y5wbcwwfbgzeoccyy62e",
"skill/valory/staking_abci/0.1.0": "bafybeidubhfvlf6x627t4wetc6ran5sb4pttjphyhv6vefp2a4kcuca2be",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeie6vnp4oovs3k6qnqjcjcjiok6u2uu4dkyd5gqibu77zxpcmztbnq",
"agent/valory/trader/0.1.0": "bafybeiecm5vm7xga6tggsh7d3wyzxnyp73qsow7iukdyfevfeflkiateku",
"service/valory/trader/0.1.0": "bafybeidj66nyqw5gj6dlclwsdksv55tpiqcjfhm6qq4w3s2xwoigj5s42u",
"service/valory/trader_omen_gnosis/0.1.0": "bafybeicd6rudzzksidiu76yjvdclmvrk3t4r3wr44silyqrqw5l624kgei"
"agent/valory/trader/0.1.0": "bafybeih6wqj5vwkeaq4wbmelcrudbrqcemtqj245usk5nyuvq3z7yxvko4",
"service/valory/trader/0.1.0": "bafybeihcywq4yn52ui7adjm3xzgnshcn2i7qhhjkyp5yuejiqhrbv3tqge",
"service/valory/trader_omen_gnosis/0.1.0": "bafybeib6zffgo76wln3rnwhnkb65mlwklc2cjoqjtqqdah73tkfhz3ouee"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
6 changes: 3 additions & 3 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie
- valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq
- valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifusfglfvmxsv7llyx2mhdvtrihrumbeb4membp7bzzfodajtcjxu
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaj4us7tbtc2ctpofnrk6fkk7uekcjx65y5wbcwwfbgzeoccyy62e
- valory/market_manager_abci:0.1.0:bafybeicbvxvjkoksbknujaid5hx7krjlgm6barcjcwo33tdccanrcp674a
- valory/decision_maker_abci:0.1.0:bafybeigloegbrrgjostndf3wurob3d7hqzmwbo4tnut7nz5ukt6pqxpn7i
- valory/trader_abci:0.1.0:bafybeibru3ibshslunk7fisbagf2fuciwiojcfimoy4enl2cqdvnnvr6yi
- valory/decision_maker_abci:0.1.0:bafybeigianh43fjwufi5bv4n4cjsa5nuv5cihuq5db6xyya347d4brxd2m
- valory/trader_abci:0.1.0:bafybeigxsa4uvssmhghokwscwca7flu7eiqr6aq5me4wn2v22od6lxmotm
- valory/staking_abci:0.1.0:bafybeidubhfvlf6x627t4wetc6ran5sb4pttjphyhv6vefp2a4kcuca2be
- valory/check_stop_trading_abci:0.1.0:bafybeie6vnp4oovs3k6qnqjcjcjiok6u2uu4dkyd5gqibu77zxpcmztbnq
- valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e
Expand Down
4 changes: 4 additions & 0 deletions packages/valory/services/trader/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ license: Apache-2.0
fingerprint:
README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq
fingerprint_ignore_patterns: []
<<<<<<< HEAD
agent: valory/trader:0.1.0:bafybeiecm5vm7xga6tggsh7d3wyzxnyp73qsow7iukdyfevfeflkiateku
=======
agent: valory/trader:0.1.0:bafybeih6wqj5vwkeaq4wbmelcrudbrqcemtqj245usk5nyuvq3z7yxvko4
>>>>>>> 23e4fcc (chore: run generators)
number_of_agents: 4
deployment:
agent:
Expand Down
4 changes: 4 additions & 0 deletions packages/valory/services/trader_omen_gnosis/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e
fingerprint_ignore_patterns: []
<<<<<<< HEAD
agent: valory/trader:0.1.0:bafybeiecm5vm7xga6tggsh7d3wyzxnyp73qsow7iukdyfevfeflkiateku
=======
agent: valory/trader:0.1.0:bafybeih6wqj5vwkeaq4wbmelcrudbrqcemtqj245usk5nyuvq3z7yxvko4
>>>>>>> 23e4fcc (chore: run generators)
number_of_agents: 1
deployment:
agent:
Expand Down
12 changes: 6 additions & 6 deletions packages/valory/skills/decision_maker_abci/behaviours/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _write_benchmark_results(
p_no: Optional[float] = None,
confidence: Optional[float] = None,
bet_amount: Optional[float] = None,
liquidity_info: LiquidityInfo,
liquidity_info: LiquidityInfo = None,
) -> None:
"""Write the results to the benchmarking file."""
mock_data = self.shared_state.mock_data
Expand All @@ -624,7 +624,7 @@ def _write_benchmark_results(
)
return

if liquidity_info is None:
if liquidity_info.l0_start is None:
self.context.logger.info("No market liquidity information.")

add_headers = False
Expand Down Expand Up @@ -660,10 +660,10 @@ def _write_benchmark_results(
p_no,
confidence,
bet_amount,
liquidity_info.l0_start if liquidity_info is not None else None,
liquidity_info.l1_start if liquidity_info is not None else None,
liquidity_info.l0_end if liquidity_info is not None else None,
liquidity_info.l1_end if liquidity_info is not None else None,
liquidity_info.l0_start,
liquidity_info.l1_start,
liquidity_info.l0_end,
liquidity_info.l1_end,
)
results_text = tuple(str(res) for res in results)
row = ",".join(results_text) + NEW_LINE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ def _is_profitable(
p_yes, p_no, confidence, bet_amount, liquidity_info
)
else:
self._write_benchmark_results(p_yes, p_no, confidence)
self._write_benchmark_results(
p_yes, p_no, confidence, LiquidityInfo(None, None, None, None)
)

return is_profitable, bet_amount

Expand All @@ -462,7 +464,13 @@ def async_act(self) -> Generator:
next_mock_data_row = self.synchronized_data.next_mock_data_row + 1

elif self.benchmarking_mode.enabled and not self._rows_exceeded:
self._write_benchmark_results(p_yes, p_no, confidence, bet_amount)
self._write_benchmark_results(
p_yes,
p_no,
confidence,
bet_amount,
LiquidityInfo(None, None, None, None),
)
next_mock_data_row = self.synchronized_data.next_mock_data_row + 1

payload = DecisionReceivePayload(
Expand Down
8 changes: 4 additions & 4 deletions packages/valory/skills/decision_maker_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class LiquidityInfo:
"""The structure to have liquidity information before and after a bet is done"""

# Liquidity of tokens for option 0, before placing the bet
l0_start: int
l0_start: Optional[int]
# Liquidity of tokens for option 1, before placing the bet
l1_start: int
l1_start: Optional[int]
# Liquidity of tokens for option 0, after placing the bet
l0_end: int
l0_end: Optional[int]
# Liquidity of tokens for option 1, after placing the bet
l1_end: int
l1_end: Optional[int]

def __init__(self, l0_start, l1_start, l0_end, l1_end):
"""Function to update the liquidity amounts"""
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fingerprint:
tests/behaviours/data/.gitkeep: bafybeiekl43sjsyqfgl6y27ve5ydo4svcngrptgtffblokmspfezroxvvi
tests/behaviours/dummy_strategy/__init__.py: bafybeiep5w5yckjzy724v63qd5cmzfn3uxytmnizynomxggfobbysfcttq
tests/behaviours/dummy_strategy/dummy_strategy.py: bafybeig5e3xfr7gxsakfj4stbxqcwdiljl7klvgahkuwe3obzxgkg3qt2e
tests/behaviours/test_base.py: bafybeifuh6qhdksgishs46bwzyoroe3bzd2umaxgz4hwkxmdiebn4zynme
tests/behaviours/test_base.py: bafybeiagdrveenk62parzchxg2nd2krpzm2pflfv3p4gszjfpnv3r2kpf4
tests/conftest.py: bafybeidy5hw56kw5mxudnfbhvogofn6k4rqb4ux2bd45baedrrhmgyrude
utils/__init__.py: bafybeiazrfg3kwfdl5q45azwz6b6mobqxngxpf4hazmrnkhinpk4qhbbf4
utils/nevermined.py: bafybeigallaqxhqopznhjhefr6bukh4ojkz5vdtqyzod5dksshrf24fjgi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
)
from packages.valory.skills.decision_maker_abci.behaviours.base import (
BET_AMOUNT_FIELD,
remove_fraction_wei, DecisionMakerBaseBehaviour, WXDAI,
DecisionMakerBaseBehaviour,
WXDAI,
remove_fraction_wei,
)
from packages.valory.skills.decision_maker_abci.behaviours.blacklisting import (
BlacklistingBehaviour,
Expand Down Expand Up @@ -189,7 +191,9 @@ def test_wei_to_native(self, wei: int) -> None:
assert result == wei / 10**18

@given(st.integers(), st.booleans(), st.booleans())
def test_collateral_amount_info(self, amount: int, benchmarking_mode_enabled: bool, is_wxdai: bool) -> None:
def test_collateral_amount_info(
self, amount: int, benchmarking_mode_enabled: bool, is_wxdai: bool
) -> None:
"""Test the `collateral_amount_info` method."""
# use `BlacklistingBehaviour` because it overrides the `DecisionMakerBaseBehaviour`.
self.ffw(BlacklistingBehaviour, {"sampled_bet_index": 0})
Expand All @@ -205,10 +209,15 @@ def test_collateral_amount_info(self, amount: int, benchmarking_mode_enabled: bo
if benchmarking_mode_enabled or is_wxdai:
assert result == f"{behaviour.wei_to_native(amount)} wxDAI"
else:
assert result == f"{amount} WEI of the collateral token with address {collateral_token}"
assert (
result
== f"{amount} WEI of the collateral token with address {collateral_token}"
)

@given(st.integers(), st.integers())
def test_mock_balance_check(self, collateral_balance: int, native_balance: int) -> None:
def test_mock_balance_check(
self, collateral_balance: int, native_balance: int
) -> None:
"""Test the `_mock_balance_check` method."""
# use `BlacklistingBehaviour` because it overrides the `DecisionMakerBaseBehaviour`.
self.ffw(BlacklistingBehaviour)
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ skills:
- valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote
- valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq
- valory/market_manager_abci:0.1.0:bafybeicbvxvjkoksbknujaid5hx7krjlgm6barcjcwo33tdccanrcp674a
- valory/decision_maker_abci:0.1.0:bafybeigloegbrrgjostndf3wurob3d7hqzmwbo4tnut7nz5ukt6pqxpn7i
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeifusfglfvmxsv7llyx2mhdvtrihrumbeb4membp7bzzfodajtcjxu
- valory/decision_maker_abci:0.1.0:bafybeigianh43fjwufi5bv4n4cjsa5nuv5cihuq5db6xyya347d4brxd2m
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaj4us7tbtc2ctpofnrk6fkk7uekcjx65y5wbcwwfbgzeoccyy62e
- valory/staking_abci:0.1.0:bafybeidubhfvlf6x627t4wetc6ran5sb4pttjphyhv6vefp2a4kcuca2be
- valory/check_stop_trading_abci:0.1.0:bafybeie6vnp4oovs3k6qnqjcjcjiok6u2uu4dkyd5gqibu77zxpcmztbnq
- valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protocols:
- valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni
skills:
- valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui
- valory/decision_maker_abci:0.1.0:bafybeigloegbrrgjostndf3wurob3d7hqzmwbo4tnut7nz5ukt6pqxpn7i
- valory/decision_maker_abci:0.1.0:bafybeigianh43fjwufi5bv4n4cjsa5nuv5cihuq5db6xyya347d4brxd2m
- valory/staking_abci:0.1.0:bafybeidubhfvlf6x627t4wetc6ran5sb4pttjphyhv6vefp2a4kcuca2be
- valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e
behaviours:
Expand Down

0 comments on commit e9f7644

Please sign in to comment.