-
Notifications
You must be signed in to change notification settings - Fork 89
feat: dynamic update leverage in python #458
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
Merged
Merged
Conversation
This file contains hidden or 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
- Bump anyio to version 4.11.0 - Update cbor2 to version 5.7.1 - Upgrade certifi to version 2025.11.12 - Change cffi version to 2.0.0 - Update grpcio to version 1.76.0 - Bump rich to version 14.2.0 - Upgrade tomli to version 2.3.0 - Update typing-extensions to version 4.15.0 - Upgrade virtualenv to version 20.35.4 - Update websocket-client to version 1.9.0 - Add secretstorage version 3.5.0 for Python 3.10 and above
kzdydx
reviewed
Dec 1, 2025
Contributor
kzdydx
left a comment
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.
Nice, is there also a small example how to set the leverage for a trade?
…eral measurement - Added functions to close existing BTC positions, set leverage with verification, and open new BTC positions. - Improved output messages for better clarity on leverage settings and collateral usage. - Implemented collateral measurement to compare used collateral at different leverage levels (5x and 10x). - Refactored code for better organization and readability.
- Enhanced the logic for closing BTC positions by distinguishing between long and short positions. - Updated print statements to provide clearer information about position sizes and types. - Adjusted the position size parameter in the example to reflect a more realistic value (0.001 BTC). - Removed hardcoded CLOB pair ID and replaced it with a dynamic retrieval from market data.
- Introduced 30-second pauses in the leverage example to allow for UI inspection after key steps. - This enhancement improves the usability of the example by giving users time to observe changes in the UI during execution.
- Introduced a constant for market configuration to enhance flexibility. - Updated functions to accept a market ID parameter, allowing for dynamic market handling instead of hardcoding "BTC-USD". - Improved print statements for clarity, reflecting the current market context in messages. - Enhanced the logic for closing positions to accommodate different markets.
- Renamed functions to remove "BTC" from their names, making them more generic for different asset types. - Updated print statements to reflect the changes in function names and improve clarity regarding position sizes. - Adjusted comments and documentation to align with the new function naming conventions.
…nagement - Changed the market configuration from "BTC-USD" to "ETH-USD" for broader applicability. - Modified the return type of the `close_position_if_exists` function to return the closed position size instead of a boolean, providing more useful feedback. - Added a new function `restore_initial_position` to facilitate restoring the initial position after closing, improving position management. - Updated print statements and documentation for clarity and consistency with the new functionality.
gaonip
previously approved these changes
Jan 12, 2026
This reverts commit 1ae8bc4.
This reverts commit d9c13d3.
…//github.com/dydxprotocol/v4-clients into kichal/dynamic-leverage-getter-setter-python
# Conflicts: # v4-client-py-v2/examples/permissioned_keys_example.py
gaonip
previously approved these changes
Jan 21, 2026
# Conflicts: # v4-client-py-v2/examples/twap_parameter_example.py
…_to_bank_balance script for improved fund management
This reverts commit 9ce0a73.
kzdydx
approved these changes
Jan 26, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.