Avantis-trader-sdk

Latest version: v0.8.0

Safety actively analyzes 722460 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.7.0

**Full Changelog**: https://github.com/Avantis-Labs/avantis_trader_sdk/compare/v0.6.0...v0.7.0

0.6.0

**Full Changelog**: https://github.com/Avantis-Labs/avantis_trader_sdk/compare/v0.5.0...v0.6.0

0.5.0

🛠 Breaking Changes
Modified Methods
- **`build_trade_close_tx`**:
- **Previous Behavior**: Required a 6-decimal precision float for `collateral_to_close` (e.g., `100500000` for `100.5 USDC`).
- **New Behavior**: Now requires a standard float value for `collateral_to_close` (e.g., `100.5` for `100.5 USDC`).

✨ New Methods
- **`build_trade_tp_sl_update_tx`**:
- **Description**: Introduced to allow traders to update the take profit and stop loss of a trade without closing and reopening it.
- **Inputs**:
- `pair_index`
- `trade_index`
- `take_profit_price`
- `stop_loss_price`
- `trader` (optional)
- **Output**: Returns the transaction object to update the take profit and stop loss.

🔧 Improvements
- Added a warning for the upcoming **v1.5 contracts upgrade**.
- Fixed issues with margin updates and USDC approval methods.
- Optimized fee values for margin updates.
- **`write_contract`**: Now auto-fills the `nonce` and `chainId` fields if not provided.

0.4.0

🛠 Modified Methods
- **`get_opening_fee`**
- **Breaking Change**: This method no longer accepts `trade_input` as an argument and now strictly returns fees in basis points (bps).

✨ New Methods
- **`get_new_trade_opening_fee`**:
- Added to calculate the final opening fee in USDC for a trade, adjusted for referral rebates.

🧰 General Notes
- Improved API consistency by separating trade-specific logic from general fee retrieval.

0.3.1

- Added feed ids for new pairs

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.