-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feat/liquidity info #281
Merged
+258
−111
Merged
Feat/liquidity info #281
Changes from 15 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
864024d
implementing liquidity info as shared memory info
cyberosa 55c6c2a
Liquidity information at the benchmarking pipeline
cyberosa 9dda954
updating packages
cyberosa 14bf941
dictionaries at the SharedState and new hashes
cyberosa b90b1ec
Adding logs
cyberosa 4f2e08c
updating hashes
cyberosa 681ab65
new hashes
cyberosa 06d858a
new hashes
cyberosa 7292294
None liquidity values for the benchmarking results
cyberosa 791b42b
merge with main
cyberosa 359ab23
Fixing token prices formulas and default token prices
cyberosa bfddaea
updating hashes
cyberosa 46f1909
cleaning
cyberosa 6fe22a0
fixing pylint
cyberosa df312c5
updating hashes
cyberosa 4ccf048
merge with main
cyberosa 5254878
cleaning and liquidity info class
cyberosa c9f26e5
cleaning
cyberosa 3af8042
updating hashes
cyberosa d0a19d4
Fixing some mypy warnings
cyberosa 0f8ca2e
using net bet amount instead of bet amount
cyberosa 3a0ebc2
fixing mypy
cyberosa a8d5407
Refactoring update liquidity info
cyberosa f7efe70
updating hashes
cyberosa bf8cb69
Update packages/valory/skills/decision_maker_abci/behaviours/base.py
cyberosa ac069f8
test: add test for wei to native conversion
Adamantios 4e817ec
test: add test for `collateral_amount_info`
Adamantios a27eb32
test: add test for `_mock_balance_check`
Adamantios e9f7644
merge with main
cyberosa aed9822
updating hashes
cyberosa caad3c9
solving merge conflicts
cyberosa 0c6e99b
solving merge conflicts
cyberosa 785f887
Fixing skill
cyberosa adf8cde
Fixing skill
cyberosa db96372
updating hashes
cyberosa eb36e9f
changes on the PR
cyberosa a23e667
fix writing int instead of str into the csv file
cyberosa e073601
updating hashes
cyberosa bede5d5
merge with main
cyberosa 4f37b32
merge with main and hashes updated
cyberosa 736a9a2
fix: apply the suggestions in #281
Adamantios 83dbcb0
chore: run generators
Adamantios bc90d8c
Merge remote-tracking branch 'origin/feat/liquidity_info' into feat/l…
Adamantios 8cfa1ed
fix: correct the dependency's name
Adamantios File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,10 @@ | |
MultisendBatch, | ||
P_NO_FIELD, | ||
P_YES_FIELD, | ||
L0_START_FIELD, | ||
L1_START_FIELD, | ||
L0_END_FIELD, | ||
L1_END_FIELD, | ||
SharedState, | ||
) | ||
from packages.valory.skills.decision_maker_abci.policy import EGreedyPolicy | ||
|
@@ -609,6 +613,8 @@ def _write_benchmark_results( | |
p_no: Optional[float] = None, | ||
confidence: Optional[float] = None, | ||
bet_amount: Optional[float] = None, | ||
old_amounts: Optional[List[int]] = None, | ||
new_amounts: Optional[List[int]] = None, | ||
) -> None: | ||
"""Write the results to the benchmarking file.""" | ||
mock_data = self.shared_state.mock_data | ||
|
@@ -618,6 +624,13 @@ def _write_benchmark_results( | |
) | ||
return | ||
|
||
if old_amounts is not None: | ||
l0_start, l0_end = old_amounts[0], new_amounts[0] | ||
l1_start, l1_end = old_amounts[1], new_amounts[1] | ||
else: | ||
self.context.logger.info("No market liquidity information.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you are using liquidity_info on line 663-666. If this is None, shouldnt we handle this case differently? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected |
||
l0_start, l0_end = None, None | ||
l1_start, l1_end = None, None | ||
add_headers = False | ||
results_path = self.params.store_path / self.benchmarking_mode.results_filename | ||
if not os.path.isfile(results_path): | ||
|
@@ -633,6 +646,10 @@ def _write_benchmark_results( | |
P_NO_FIELD, | ||
CONFIDENCE_FIELD, | ||
self.benchmarking_mode.bet_amount_field, | ||
L0_START_FIELD, | ||
L1_START_FIELD, | ||
L0_END_FIELD, | ||
L1_END_FIELD, | ||
) | ||
row = ",".join(headers) + NEW_LINE | ||
results_file.write(row) | ||
|
@@ -647,6 +664,10 @@ def _write_benchmark_results( | |
p_no, | ||
confidence, | ||
bet_amount, | ||
l0_start, | ||
l1_start, | ||
l0_end, | ||
l1_end, | ||
) | ||
results_text = tuple(str(res) for res in results) | ||
row = ",".join(results_text) + NEW_LINE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's convert this to a structure, for example, a dataclass called
Liquidity
that has the l0s and l1s.