abstract-math 0.0.0.12__tar.gz → 0.0.0.13__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.

Potentially problematic release.


This version of abstract-math might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: abstract_math
3
- Version: 0.0.0.12
3
+ Version: 0.0.0.13
4
4
  Author: putkoff
5
5
  Author-email: partners@abstractendeavors.com
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
4
4
  long_description = fh.read()
5
5
  setuptools.setup(
6
6
  name='abstract_math',
7
- version='0.0.0.12',
7
+ version='0.0.0.13',
8
8
  author='putkoff',
9
9
  author_email='partners@abstractendeavors.com',
10
10
  description="",
@@ -94,15 +94,16 @@ def update_token_variables(variables):
94
94
  variables = derive_token_decimals_from_token_variables(**variables)
95
95
  variables['tokenAmountUi'] = get_token_amount_ui(**variables)
96
96
  return variables
97
- # get the liquidity and sqrt of price
98
- pool_contract = web3.eth.contract(address=pool_address, abi=v3_pool_abi)
99
- slot0 = pool_contract.functions.slot0().call()
100
- sqrt_price_x96 = slot0[0]
101
- liquidity = pool_contract.functions.liquidity().call()
97
+ def get_liq():
98
+ # get the liquidity and sqrt of price
99
+ pool_contract = web3.eth.contract(address=pool_address, abi=v3_pool_abi)
100
+ slot0 = pool_contract.functions.slot0().call()
101
+ sqrt_price_x96 = slot0[0]
102
+ liquidity = pool_contract.functions.liquidity().call()
102
103
 
103
- # compute the virtual reserves
104
- Q96 = 2 ** 96
105
- Q192 = 2 ** 192
106
- reserve0_x96 = liquidity * Q192 / sqrt_price_x96
107
- reserve1_x96 = liquidity * sqrt_price_x96
108
- token_decimals = math.log10((int(data['virtualTokenReserves']["data"]) * (10**int(9) / (int(data['virtualSolReserves']["data"])) * (int(data['tokenAmount']["data"]) / int(data['solAmount']["data"])))))
104
+ # compute the virtual reserves
105
+ Q96 = 2 ** 96
106
+ Q192 = 2 ** 192
107
+ reserve0_x96 = liquidity * Q192 / sqrt_price_x96
108
+ reserve1_x96 = liquidity * sqrt_price_x96
109
+ token_decimals = math.log10((int(data['virtualTokenReserves']["data"]) * (10**int(9) / (int(data['virtualSolReserves']["data"])) * (int(data['tokenAmount']["data"]) / int(data['solAmount']["data"])))))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: abstract_math
3
- Version: 0.0.0.12
3
+ Version: 0.0.0.13
4
4
  Author: putkoff
5
5
  Author-email: partners@abstractendeavors.com
6
6
  Classifier: Development Status :: 3 - Alpha