Skip to content

Conversation

@jbonilla-tao
Copy link
Collaborator

@jbonilla-tao jbonilla-tao commented Mar 5, 2024

Large refactor/simplification/modularization complete. No more need to use an epsilon constant. Combined FLAT conditions into one, unified total return calculation.
New tests are implemented to verify position internal state as well as final return values as orders are received.
next short term steps: Modularize tests more. Add more complex testing scenarios, add cache to mdd logic to allow non-blocking wait for deleting eliminated miner data.

Tests are passing but I should probably run this in testnet, right? Please advise

@jbonilla-tao jbonilla-tao force-pushed the feat/unit_tests_and_mdd_update branch 4 times, most recently from f09dd77 to 53764e8 Compare March 6, 2024 03:53
@jbonilla-tao jbonilla-tao changed the title WIP: Add testing for positions. Tweak mdd logic Add testing for positions. Tweak mdd logic. Refactoring Mar 6, 2024
@jbonilla-tao jbonilla-tao requested a review from taoshidev1 March 6, 2024 03:53
@jbonilla-tao jbonilla-tao force-pushed the feat/unit_tests_and_mdd_update branch 2 times, most recently from 7e80444 to 7ca6d42 Compare March 6, 2024 18:00
@jbonilla-tao jbonilla-tao force-pushed the feat/unit_tests_and_mdd_update branch from 7ca6d42 to 7a89f75 Compare March 6, 2024 20:03
@jbonilla-tao jbonilla-tao merged commit a7504f2 into main Mar 6, 2024
jbonilla-tao added a commit that referenced this pull request Sep 23, 2025
Document the new 0.1% * leverage spread (transaction) fee that applies to crypto pairs only.
This fee simulates transaction costs that normal exchanges would add.

Updates:
- Added spread fee as third primary cost in miner.md
- Created separate tables for carry fees and spread fees
- Added new rule #4 in README.md for spread fee
- Clarified this is a transaction fee, not bid-ask spread

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
jbonilla-tao added a commit that referenced this pull request Sep 24, 2025
Document the new 0.1% * leverage spread (transaction) fee that applies to crypto pairs only.
This fee simulates transaction costs that normal exchanges would add.

Updates:
- Added spread fee as third primary cost in miner.md
- Created separate tables for carry fees and spread fees
- Added new rule #4 in README.md for spread fee
- Clarified this is a transaction fee, not bid-ask spread

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
jbonilla-tao added a commit that referenced this pull request Sep 24, 2025
* Fix MDD checker race condition with additional position validation

Added check to ensure refreshed position is still a candidate for price
correction after acquiring lock. This prevents processing positions that
may have been closed or are no longer valid for price updates.

Changes:
- Add _position_is_candidate_for_price_correction() check after position refresh
- Log warning when position is no longer valid for correction
- Bump subnet version to 6.7.6

This addresses race conditions where positions are modified between the
initial position list snapshot and actual processing with locks.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* enable spread fee.

* fix 2 tests

* fix test

* tests

* Add stack traces to Slack error notifications in weight setter

Include compact stack traces in error messages sent to Slack for better debugging.
Uses existing ErrorUtils.get_compact_stacktrace() to provide filtered, relevant trace info.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* spread fee for crypto only. flat .1%

* 1. fix bypass value and 2. default return/fees dict during edge case that probably was never hit.

* Add spread fee documentation for crypto pairs

Document the new 0.1% * leverage spread (transaction) fee that applies to crypto pairs only.
This fee simulates transaction costs that normal exchanges would add.

Updates:
- Added spread fee as third primary cost in miner.md
- Created separate tables for carry fees and spread fees
- Added new rule #4 in README.md for spread fee
- Clarified this is a transaction fee, not bid-ask spread

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* update regression tests for new fee

* testing fixes

* added validator. improve tests

* meta inc

* delta update makes assertions trigger

* clear plm data in tests

---------

Co-authored-by: Claude <[email protected]>
This was referenced Oct 17, 2025
@github-actions github-actions bot mentioned this pull request Nov 3, 2025
12 tasks
jbonilla-tao added a commit that referenced this pull request Nov 8, 2025
Issue #2: Remove is_alive() checks from LivePriceFetcher._start_server()
- Removed all is_alive() checks that would crash when called from HealthChecker daemon
- Use terminate() and kill() directly (safe to call on dead processes)
- Rely on connect() to verify server is working instead of process checks
- Simplified startup logic with 2s wait + connection attempt

Issue #4: Move timestamp update inside lock in auto_sync.py
- Moved last_signal_sync_time_ms update into finally block inside lock
- Prevents race condition where second sync starts before timestamp updates
- Ensures timestamp is always updated even if sync fails

Issue #5: Remove unused shutdown_dict logic from daemons
- Removed shutdown_dict parameter from HealthChecker.__init__()
- Removed shutdown_dict parameter from FeatureRefresher.__init__()
- Changed while loops from "while not self.shutdown_dict" to "while True"
- Daemons run indefinitely and terminate when main process exits (daemon=True)
- Updated validator.py to not pass shutdown_dict to daemon initializations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
jbonilla-tao added a commit that referenced this pull request Nov 8, 2025
Issue #2: Remove is_alive() checks from LivePriceFetcher._start_server()
- Removed all is_alive() checks that would crash when called from HealthChecker daemon
- Use terminate() and kill() directly (safe to call on dead processes)
- Rely on connect() to verify server is working instead of process checks
- Simplified startup logic with 2s wait + connection attempt

Issue #4: Move timestamp update inside lock in auto_sync.py
- Moved last_signal_sync_time_ms update into finally block inside lock
- Prevents race condition where second sync starts before timestamp updates
- Ensures timestamp is always updated even if sync fails

Issue #5: Remove unused shutdown_dict logic from daemons
- Removed shutdown_dict parameter from HealthChecker.__init__()
- Removed shutdown_dict parameter from FeatureRefresher.__init__()
- Changed while loops from "while not self.shutdown_dict" to "while True"
- Daemons run indefinitely and terminate when main process exits (daemon=True)
- Updated validator.py to not pass shutdown_dict to daemon initializations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants