abstract-math 0.0.0.8__py3-none-any.whl → 0.0.0.11__py3-none-any.whl
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.
- abstract_math/derive_tokens.py +5 -5
- {abstract_math-0.0.0.8.dist-info → abstract_math-0.0.0.11.dist-info}/METADATA +1 -1
- abstract_math-0.0.0.11.dist-info/RECORD +8 -0
- abstract_math-0.0.0.8.dist-info/RECORD +0 -8
- {abstract_math-0.0.0.8.dist-info → abstract_math-0.0.0.11.dist-info}/WHEEL +0 -0
- {abstract_math-0.0.0.8.dist-info → abstract_math-0.0.0.11.dist-info}/top_level.txt +0 -0
abstract_math/derive_tokens.py
CHANGED
|
@@ -46,11 +46,11 @@ def getSolAmountUi(*args,**kwargs):
|
|
|
46
46
|
sol_amount = get_sol_amount(*args,**kwargs)
|
|
47
47
|
return exponential(sol_amount,SOL_DECIMAL_PLACE)
|
|
48
48
|
#token reserves
|
|
49
|
-
def
|
|
49
|
+
def get_virtual_token_reserves(*args,**kwargs):
|
|
50
50
|
proper_args = get_proper_args(["virtualTokenReserves"],*args,**kwargs)
|
|
51
51
|
return proper_args[0] if proper_args else proper_args
|
|
52
52
|
def get_virtual_token_lamports(*args,**kwargs):
|
|
53
|
-
virtual_token_reserves =
|
|
53
|
+
virtual_token_reserves = get_virtual_token_reserves(*args,**kwargs)
|
|
54
54
|
virtual_token_lamports = get_lamports(virtual_token_reserves)
|
|
55
55
|
return virtual_token_lamports
|
|
56
56
|
#token amount
|
|
@@ -59,14 +59,14 @@ def get_token_amount(*args,**kwargs):
|
|
|
59
59
|
return proper_args[0] if proper_args else proper_args
|
|
60
60
|
def get_token_amount_ui(*args,**kwargs):
|
|
61
61
|
token_amount = get_token_amount(*args,**kwargs)
|
|
62
|
-
token_decimals =
|
|
62
|
+
token_decimals = derive_decimals_from_vars(*args,**kwargs)
|
|
63
63
|
return exponential(token_amount,exp=token_decimals)
|
|
64
64
|
#token derivision
|
|
65
65
|
def derive_token_decimals_from_token_variables(**variables):
|
|
66
66
|
variables["price"] = get_price(**variables)
|
|
67
67
|
variables["tokenDecimals"] = derive_decimals_from_vars(**variables)
|
|
68
68
|
return variables
|
|
69
|
-
def get_derived_token_ratio(*args,**
|
|
69
|
+
def get_derived_token_ratio(*args,**kwargs):
|
|
70
70
|
derived_token_amount = derive_token_amount(*args,**kwargs)
|
|
71
71
|
token_amount = get_token_amount(*args,**kwargs)
|
|
72
72
|
ratio = divide_it(derived_token_amount,token_amount)
|
|
@@ -82,7 +82,7 @@ def get_price(*args,**kwargs):
|
|
|
82
82
|
virtual_sol_lamp_difference = get_virtual_sol_lamp_difference(*args,**kwargs)
|
|
83
83
|
return reserve_ratios/virtual_sol_lamp_difference
|
|
84
84
|
def derive_decimals_from_vars(*args,**kwargs):
|
|
85
|
-
ratio = get_derived_token_ratio(*args,**
|
|
85
|
+
ratio = get_derived_token_ratio(*args,**kwargs)
|
|
86
86
|
decimals = -1
|
|
87
87
|
while abs(ratio - round(ratio)) > 1e-9:
|
|
88
88
|
ratio *= 10
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
abstract_math/__init__.py,sha256=3I0YJakDUyWD7qXpdRsaEsmcA7IxwcWhoyecvDfOE98,54
|
|
2
|
+
abstract_math/derive_tokens.py,sha256=q2SHXwJHd3uDXVgQbfb2FEBSH_efEKDxetX5yuTERUY,4234
|
|
3
|
+
abstract_math/deriveit.py,sha256=Og8QtDGRrgGbmaHTh-jEusg35jUpb74DgzslsxZ_2iU,4271
|
|
4
|
+
abstract_math/safe_math.py,sha256=CP05f3-SHQ3aJu1bO1IJGQ7HYOwpqonMVb0kN3gBbEU,6838
|
|
5
|
+
abstract_math-0.0.0.11.dist-info/METADATA,sha256=LafqrQIGyIUq2-K7pM0QXL9VIuUPoPD90YQ2ebxLx3o,580
|
|
6
|
+
abstract_math-0.0.0.11.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
7
|
+
abstract_math-0.0.0.11.dist-info/top_level.txt,sha256=b7jOgD9c0U-CGH-l7yxhMPukzD40kMEQkQRV_sGyVfE,14
|
|
8
|
+
abstract_math-0.0.0.11.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
abstract_math/__init__.py,sha256=3I0YJakDUyWD7qXpdRsaEsmcA7IxwcWhoyecvDfOE98,54
|
|
2
|
-
abstract_math/derive_tokens.py,sha256=F759WaRNU9Y7txkgx78gYxIiR4HI21vYVbXuL6dA2mg,4226
|
|
3
|
-
abstract_math/deriveit.py,sha256=Og8QtDGRrgGbmaHTh-jEusg35jUpb74DgzslsxZ_2iU,4271
|
|
4
|
-
abstract_math/safe_math.py,sha256=CP05f3-SHQ3aJu1bO1IJGQ7HYOwpqonMVb0kN3gBbEU,6838
|
|
5
|
-
abstract_math-0.0.0.8.dist-info/METADATA,sha256=OEZaRo_PxlFQJINSQcmR8DpFdALNwp-CD5-TSOEGzwc,579
|
|
6
|
-
abstract_math-0.0.0.8.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
7
|
-
abstract_math-0.0.0.8.dist-info/top_level.txt,sha256=b7jOgD9c0U-CGH-l7yxhMPukzD40kMEQkQRV_sGyVfE,14
|
|
8
|
-
abstract_math-0.0.0.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|