ostium-python-sdk 2.0.16__tar.gz → 2.0.17__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/PKG-INFO +5 -1
  2. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/formulae.py +2 -2
  3. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/scscript/funding.py +1 -1
  4. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk.egg-info/PKG-INFO +5 -1
  5. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/setup.py +1 -1
  6. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_get_pending_acc_funding_fees.py +2 -2
  7. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/MANIFEST.in +0 -0
  8. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/README.md +0 -0
  9. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/__init__.py +0 -0
  10. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/__init__.py +0 -0
  11. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/faucet_testnet_abi.py +0 -0
  12. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/pairs_info_abi.py +0 -0
  13. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/pairs_storage_abi.py +0 -0
  14. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/trading_abi.py +0 -0
  15. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/trading_storage_abi.py +0 -0
  16. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/usdc_abi.py +0 -0
  17. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/abi/vault_abi.py +0 -0
  18. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/balance.py +0 -0
  19. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/config.py +0 -0
  20. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/constants.py +0 -0
  21. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/exceptions.py +0 -0
  22. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/faucet.py +0 -0
  23. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/formulae_wrapper.py +0 -0
  24. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/ostium.py +0 -0
  25. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/price.py +0 -0
  26. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/scscript/__init__.py +0 -0
  27. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/scscript/pairinfos.py +0 -0
  28. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/sdk.py +0 -0
  29. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/subgraph.py +0 -0
  30. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk/utils.py +0 -0
  31. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk.egg-info/SOURCES.txt +0 -0
  32. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk.egg-info/dependency_links.txt +0 -0
  33. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk.egg-info/requires.txt +0 -0
  34. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/ostium_python_sdk.egg-info/top_level.txt +0 -0
  35. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/pyproject.toml +0 -0
  36. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/requirements-dev.txt +0 -0
  37. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/requirements.txt +0 -0
  38. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/setup.cfg +0 -0
  39. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/__init__.py +0 -0
  40. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/conftest.py +0 -0
  41. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/disabled_test_funding.py +0 -0
  42. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/disabled_test_slippage.py +0 -0
  43. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_current_total_profit_p.py +0 -0
  44. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_current_total_profit_raw.py +0 -0
  45. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_current_trade_profit_p.py +0 -0
  46. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_current_trade_profit_raw.py +0 -0
  47. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_get_opening_fee.py +0 -0
  48. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_get_price_impact.py +0 -0
  49. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_get_trade_funding_fee.py +0 -0
  50. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_get_trade_rollover_fee.py +0 -0
  51. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_get_trade_value.py +0 -0
  52. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_max_leverage.py +0 -0
  53. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_overnight_max_leverage.py +0 -0
  54. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_remove_collateral_from_leverage.py +0 -0
  55. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_remove_collateral_with_collateral.py +0 -0
  56. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_target_funding_rate.py +0 -0
  57. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_top_up_with_collateral.py +0 -0
  58. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_top_up_with_leverage.py +0 -0
  59. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_trade_get_sl_price.py +0 -0
  60. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_trade_get_tp_price.py +0 -0
  61. {ostium_python_sdk-2.0.16 → ostium_python_sdk-2.0.17}/tests/test_trade_liquidation_price.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ostium-python-sdk
3
- Version: 2.0.16
3
+ Version: 2.0.17
4
4
  Summary: A python based SDK developed for interacting with Ostium, a leveraged trading application for trading currencies, commodities, indices, crypto and more.
5
5
  Home-page: https://github.com/0xOstium/ostium-python-sdk
6
6
  Author: ami@ostium.io
@@ -540,6 +540,10 @@ All notable changes to the Ostium Python SDK will be documented in this file.
540
540
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
541
541
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
542
542
 
543
+ ## [2.0.17] - 2025-06-03
544
+
545
+ - Return target_funding_rate from getPendingAccFundingFees()
546
+
543
547
  ## [2.0.16] - 2025-05-31
544
548
 
545
549
  - query optional different address in sdk.get_open_trade_metrics()
@@ -242,7 +242,7 @@ def GetFundingRate(
242
242
  sFactorDownScaleP: str,
243
243
  verbose: bool = False
244
244
  ):
245
- acc_funding_long, acc_funding_short, latest_funding_rate = getPendingAccFundingFees(
245
+ acc_funding_long, acc_funding_short, latest_funding_rate, target_funding_rate = getPendingAccFundingFees(
246
246
  blockNumber=Decimal(latestBlock),
247
247
  lastUpdateBlock=Decimal(lastUpdateBlock),
248
248
  valueLong=Decimal(accPerOiLong) / PRECISION_18,
@@ -264,5 +264,5 @@ def GetFundingRate(
264
264
  'accFundingLong': acc_funding_long,
265
265
  'accFundingShort': acc_funding_short,
266
266
  'latestFundingRate': latest_funding_rate,
267
- # 'targetFundingRate': target_fr
267
+ 'targetFundingRate': target_funding_rate
268
268
  }
@@ -78,7 +78,7 @@ def getPendingAccFundingFees(
78
78
  valueShort -= accFundingRate
79
79
  valueLong += (accFundingRate * openInterestUsdcShort / openInterestUsdcLong).quantize(quantization_18, rounding=ROUND_DOWN) if openInterestUsdcLong > 0 else 0
80
80
 
81
- return (valueLong.quantize(quantization_18, rounding=ROUND_DOWN), valueShort.quantize(quantization_18, rounding=ROUND_DOWN), fr.quantize(quantization_18, rounding=ROUND_DOWN))
81
+ return (valueLong.quantize(quantization_18, rounding=ROUND_DOWN), valueShort.quantize(quantization_18, rounding=ROUND_DOWN), fr.quantize(quantization_18, rounding=ROUND_DOWN), targetFr.quantize(quantization_18, rounding=ROUND_DOWN))
82
82
 
83
83
 
84
84
  def exponentialApproximation(value):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ostium-python-sdk
3
- Version: 2.0.16
3
+ Version: 2.0.17
4
4
  Summary: A python based SDK developed for interacting with Ostium, a leveraged trading application for trading currencies, commodities, indices, crypto and more.
5
5
  Home-page: https://github.com/0xOstium/ostium-python-sdk
6
6
  Author: ami@ostium.io
@@ -540,6 +540,10 @@ All notable changes to the Ostium Python SDK will be documented in this file.
540
540
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
541
541
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
542
542
 
543
+ ## [2.0.17] - 2025-06-03
544
+
545
+ - Return target_funding_rate from getPendingAccFundingFees()
546
+
543
547
  ## [2.0.16] - 2025-05-31
544
548
 
545
549
  - query optional different address in sdk.get_open_trade_metrics()
@@ -22,7 +22,7 @@ if changelog_path.exists():
22
22
 
23
23
  setup(
24
24
  name="ostium-python-sdk",
25
- version="2.0.16",
25
+ version="2.0.17",
26
26
  packages=find_packages(),
27
27
  install_requires=read_requirements('requirements.txt'),
28
28
  extras_require={
@@ -79,7 +79,7 @@ test_cases = [
79
79
  def test_get_pending_acc_funding_fees(test_case):
80
80
  """Test getPendingAccFundingFees function with various test cases"""
81
81
  # Call the function with test case parameters
82
- acc_funding_long, acc_funding_short, latest_funding_rate = getPendingAccFundingFees(
82
+ acc_funding_long, acc_funding_short, latest_funding_rate, target_funding_rate = getPendingAccFundingFees(
83
83
  blockNumber=test_case['blockNumber'],
84
84
  lastUpdateBlock=test_case['lastUpdateBlock'],
85
85
  valueLong=test_case['valueLong'],
@@ -102,7 +102,7 @@ def test_get_pending_acc_funding_fees(test_case):
102
102
  print(f"acc_funding_long: {acc_funding_long}")
103
103
  print(f"acc_funding_short: {acc_funding_short}")
104
104
  print(f"latest_funding_rate: {latest_funding_rate}")
105
-
105
+ print(f"target_funding_rate: {target_funding_rate}")
106
106
  # Assertions
107
107
  assert acc_funding_long == pytest.approx(test_case['expected_acc_funding_long'], rel=Decimal('1e-12')), \
108
108
  f"acc_funding_long {acc_funding_long} != {test_case['expected_acc_funding_long']}"