Skip to content

Conversation

@alexey-kichin
Copy link
Contributor

No description provided.

- 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
@alexey-kichin alexey-kichin changed the title Dynamic update leverage - python feat: dynamic update leverage in python Nov 24, 2025
@alexey-kichin alexey-kichin marked this pull request as ready for review November 27, 2025 11:43
@alexey-kichin alexey-kichin requested review from a team as code owners November 27, 2025 11:43
Copy link
Contributor

@kzdydx kzdydx left a 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.
@alexey-kichin alexey-kichin marked this pull request as draft December 11, 2025 21:07
- 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.
@alexey-kichin alexey-kichin marked this pull request as ready for review December 16, 2025 11:29
gaonip
gaonip previously approved these changes Jan 12, 2026
gaonip
gaonip previously approved these changes Jan 21, 2026
# Conflicts:
#	v4-client-py-v2/examples/twap_parameter_example.py
@kzdydx kzdydx merged commit b9e944d into main Jan 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants