defi-state-querier 0.5.30__py3-none-any.whl → 0.5.32__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.
defi_services/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.5.30"
1
+ __version__ = "0.5.32"
@@ -30,7 +30,7 @@ class Lending:
30
30
  ionic = "ionic-protocol"
31
31
  sonne = "sonne-finance"
32
32
  kinza = "kinza-finance"
33
- seamless = "seamless-protocol"
33
+ seamless = "seamless-v1"
34
34
  avalon = 'avalon-finance'
35
35
  xlend = "extra-finance-xlend"
36
36
  all = [
@@ -38,4 +38,4 @@ class Lending:
38
38
  iron_bank, trava, valas, geist, cream, venus, liqee, strike, uwu, wepiggy,
39
39
  morpho_compound, morpho_aave_v2, morpho_aave_v3, spark, ape_swap, silo, compound_v3,
40
40
  justlend, zerolend, moonwell, ionic, sonne, kinza, seamless, avalon, xlend
41
- ]
41
+ ]
@@ -87,7 +87,7 @@ class CompoundV3StateService(CompoundStateService):
87
87
 
88
88
  comet_address = reserve_info['comet']
89
89
  functions = [
90
- 'decimals', 'totalBorrow', 'getUtilization', 'borrowKink', 'borrowPerSecondInterestRateBase',
90
+ 'decimals', 'totalSupply', 'totalBorrow', 'getUtilization', 'borrowKink', 'borrowPerSecondInterestRateBase',
91
91
  'borrowPerSecondInterestRateSlopeHigh', 'borrowPerSecondInterestRateSlopeLow',
92
92
  'supplyKink', 'supplyPerSecondInterestRateBase', 'supplyPerSecondInterestRateSlopeHigh',
93
93
  'supplyPerSecondInterestRateSlopeLow'
@@ -130,6 +130,7 @@ class CompoundV3StateService(CompoundStateService):
130
130
 
131
131
  comet_address = reserve_info['comet']
132
132
  comet_decimals_query_id = f"decimals_{comet_address}_{block_number}".lower()
133
+ total_supply_query_id = f"totalSupply_{comet_address}_{block_number}".lower()
133
134
  total_borrow_query_id = f"totalBorrow_{comet_address}_{block_number}".lower()
134
135
  utilization_query_id = f"getUtilization_{comet_address}_{block_number}".lower()
135
136
 
@@ -137,6 +138,7 @@ class CompoundV3StateService(CompoundStateService):
137
138
  "token": comet_address,
138
139
  "token_decimals": decoded_data.get(comet_decimals_query_id),
139
140
  "utilization": decoded_data.get(utilization_query_id),
141
+ 'total_supply': decoded_data.get(total_supply_query_id),
140
142
  'total_borrow': decoded_data.get(total_borrow_query_id),
141
143
  "underlying_decimals": underlying_decimals,
142
144
  "underlying": token_address
@@ -191,7 +193,7 @@ class CompoundV3StateService(CompoundStateService):
191
193
  underlying_token: {
192
194
  'deposit_apy': asset_info['deposit_apy'],
193
195
  'borrow_apy': asset_info['borrow_apy'],
194
- 'total_deposit': 0,
196
+ 'total_deposit': asset_info['total_deposit'],
195
197
  'total_borrow': asset_info['total_borrow'],
196
198
  'is_base': True
197
199
  }
@@ -207,7 +209,6 @@ class CompoundV3StateService(CompoundStateService):
207
209
  'is_base': False
208
210
  }
209
211
  assets[collateral_address]['total_deposit'] += total_supply
210
- # assets[collateral_address]['deposit_apy'] = asset_info['deposit_apy']
211
212
 
212
213
  comet = token_info['token']
213
214
  data[comet] = assets
@@ -218,12 +219,12 @@ class CompoundV3StateService(CompoundStateService):
218
219
  def _calculate_interest_rates(
219
220
  cls, token_info: dict, pool_decimals: int, apx_block_speed_in_seconds: float):
220
221
 
222
+ total_supply = float(token_info["total_supply"]) / 10 ** int(token_info["underlying_decimals"])
221
223
  total_borrow = float(token_info["total_borrow"]) / 10 ** int(token_info["underlying_decimals"])
222
224
  collaterals = {}
223
225
  for asset_info in token_info['assets']:
224
226
  collateral_address = asset_info['underlying']
225
- total_supply = float(asset_info["total_supply"]) / 10 ** int(asset_info["underlying_decimals"])
226
- collaterals[collateral_address] = total_supply
227
+ collaterals[collateral_address] = float(asset_info["total_supply"]) / 10 ** int(asset_info["underlying_decimals"])
227
228
 
228
229
  utilization = token_info['utilization'] / 10 ** 18
229
230
  interests = {}
@@ -239,7 +240,7 @@ class CompoundV3StateService(CompoundStateService):
239
240
  return {
240
241
  'deposit_apy': interests['supply'],
241
242
  'borrow_apy': interests['borrow'],
242
- 'total_deposit': None,
243
+ 'total_deposit': total_supply,
243
244
  'total_borrow': total_borrow,
244
245
  'collaterals': collaterals
245
246
  }
@@ -0,0 +1,12 @@
1
+ YLDR_ETHEREUM = {
2
+ "address": "0x54ad657851b6ae95ba3380704996caad4b7751a3",
3
+ "name": "YLDR Lending Pool",
4
+ "stakedIncentiveAddress": '',
5
+ "oracleAddress": "0x2a61760f0413c7fc9e3120e3d51c961f6bb17452",
6
+ "rewardTokensList": [],
7
+ "type": "LENDING_POOL",
8
+ "poolToken": "",
9
+ "forked": "aave-v3",
10
+ "reservesList": {}
11
+
12
+ }
@@ -0,0 +1,12 @@
1
+ COMPOUND_ETH = {
2
+ "name": "Compound Lending Pool",
3
+ "rewardToken": "",
4
+ "comptrollerAddress": "0xd7c4006d33da2a0a8525791ed212bbcd7aca763f",
5
+ "lensAddress": "",
6
+ "poolToken": "0x8729438eb15e2c8b576fcc6aecda6a148776c0f5",
7
+ "type": "LENDING_POOL",
8
+ "forked": "compound",
9
+ "reservesList": {
10
+
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ YLDR_ETHEREUM = {
2
+ "address": "0x6447c4390457cad03ec1baa4254cee1a3d9e1bbd",
3
+ "name": "YLDR Lending Pool",
4
+ "stakedIncentiveAddress": '',
5
+ "oracleAddress": "0xb58ce829f4fe67b4dc0a98ba7f6ac6e92e207790",
6
+ "rewardTokensList": [],
7
+ "type": "LENDING_POOL",
8
+ "poolToken": "",
9
+ "forked": "aave-v3",
10
+ "reservesList": {}
11
+
12
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: defi-state-querier
3
- Version: 0.5.30
3
+ Version: 0.5.32
4
4
  Summary: Calculate apy, apr, and wallet information,... in decentralized applications.
5
5
  Home-page: https://github.com/Centic-io/defi-state-querier
6
6
  Author: Viet-Bang Pham
@@ -1,4 +1,4 @@
1
- defi_services/__init__.py,sha256=_zBppMxoS47YhZch6yikYSplahD6aRf40gZm3e9d9W8,23
1
+ defi_services/__init__.py,sha256=zRBKyOU0DiJN_VNZQUawZ7-WJzZsLSLydzPhK6ijatA,23
2
2
  defi_services/abis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  defi_services/abis/multicall_v3_abi.py,sha256=0aPxjrJJFU17fODjvYFRDn5Y5J1yi_AJKc8v1uohNGY,12352
4
4
  defi_services/abis/dex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -322,7 +322,7 @@ defi_services/constants/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
322
322
  defi_services/constants/entities/dex_constant.py,sha256=oCt8RS-0KjFW5zR5IU1Ys49nYCCAraY8pTivOpXoyvs,343
323
323
  defi_services/constants/entities/dex_info_constant.py,sha256=gFjF6gWLZ-e_iLoUeSF-bPZKOwbmxVoMeyaA2wGZESM,1653
324
324
  defi_services/constants/entities/dex_services.py,sha256=Ip3ww6OBA3RQHMrtPE86uoPv2iv-oLh38cKGPtrpKMA,2383
325
- defi_services/constants/entities/lending_constant.py,sha256=okNrsdWwq_dVW_9zSMGG_D8VuQrdA2lOT9pAQJI9HSk,1303
325
+ defi_services/constants/entities/lending_constant.py,sha256=7WndqWnTKAD7rNP-qwppJE0y_m537aKGmhmbftZW3Rs,1298
326
326
  defi_services/constants/entities/lending_services.py,sha256=9A_9N6--MFMfX7p_K_ZBvQVO_SCjgSeViHwb_z1nKhI,6552
327
327
  defi_services/constants/entities/vault_constant.py,sha256=XaFp2VpmePfym42Gn-5IeT8qnQBq1JcRNrH7r2_tWxo,122
328
328
  defi_services/constants/entities/vault_services.py,sha256=uwcvxwnyXNU3_3mcI6PGWyvGe40tzHmTrmigotLWeMM,752
@@ -377,7 +377,7 @@ defi_services/services/lending/aave_v3_services.py,sha256=aGXhVSrQM2Eui5DH1Ghf-X
377
377
  defi_services/services/lending/apeswap_services.py,sha256=UrLhXVzGvim_xfs54hSJ1qeTH6ber4xh01j5PWFl4C8,4737
378
378
  defi_services/services/lending/avalon_services.py,sha256=M1H7JIGCrucr_5KiJUgYC4i6YO4UuvZjArRNPAl6AFU,1118
379
379
  defi_services/services/lending/compound_service.py,sha256=8r7pAs8KaaakDuHg4BUICW4zLD-ihm_DQETYwnAFc98,21917
380
- defi_services/services/lending/compound_v3_services.py,sha256=iLxaP0YpRAKrVw2dQLACTNS6oIfCvQ_-ZPKSiC3Q8bE,17448
380
+ defi_services/services/lending/compound_v3_services.py,sha256=FBcazzTeOCSI6iMp5OfFPeuLiZvF3x2SYE5VXZ60sG0,17636
381
381
  defi_services/services/lending/cream_services.py,sha256=vtah0kMHAxztenWbJp4CxEcBMF0XUBglGRk6p9d-oiU,1644
382
382
  defi_services/services/lending/flux_services.py,sha256=C9WJ2MIBK4xTaXIHF3yBVu52xGCNzO4Ed5DWyxWTTeE,12617
383
383
  defi_services/services/lending/geist_services.py,sha256=UI5D-MbMqplrt7D4krSFdpaREKOT81k8boD_XhGGpUQ,1035
@@ -414,9 +414,11 @@ defi_services/services/lending/lending_info/arbitrum/radiant_arbitrum.py,sha256=
414
414
  defi_services/services/lending/lending_info/arbitrum/silo_arbitrum.py,sha256=XJWbE3xmIiNP44OF_ElXZ8m4FMIoGpesX_HgoG8AKLo,6513
415
415
  defi_services/services/lending/lending_info/arbitrum/venus_arbitrum.py,sha256=uY7BXnvJEBiqZHnQm8J9ONI9ng4Pl5PWMKvo0okKsac,312
416
416
  defi_services/services/lending/lending_info/arbitrum/wepiggy_arbitrum.py,sha256=Wysawoam2d9pMhaED8EhPJhwNlWV4_r9j6diikI275k,1523
417
+ defi_services/services/lending/lending_info/arbitrum/yldr_arbitrum.py,sha256=bnRntZIO1A0ARtjBDQaeVJDidjLmSyOps_vxT18ko2A,340
417
418
  defi_services/services/lending/lending_info/avalanche/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
418
419
  defi_services/services/lending/lending_info/avalanche/aave_v2_avalanche.py,sha256=Md3n217lm7ZZadGqXmSooYKesYPXx5mGaW2BEuz1i_Y,2668
419
420
  defi_services/services/lending/lending_info/avalanche/aave_v3_avalanche.py,sha256=WrWBjJ88_5jKm3qmd1F_txnZaPE9uXIXBKG8sHvqcR4,4236
421
+ defi_services/services/lending/lending_info/avalanche/benqi_avalanche.py,sha256=lueulxqlstcLejriraNOT4dfcuaN1cWEiFDtm3IXeT0,320
420
422
  defi_services/services/lending/lending_info/avalanche/granary_avalanche.py,sha256=rfUF9HaW5yJQP2sRHbVf9nnFWi5YqEHPF905iFdhDbU,2640
421
423
  defi_services/services/lending/lending_info/avalanche/iron_bank_avalanche.py,sha256=r06sFd-UyLXPlzAn3-A4ukJhix0OSkqLy7vsFU3KHvE,2343
422
424
  defi_services/services/lending/lending_info/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -467,6 +469,7 @@ defi_services/services/lending/lending_info/ethereum/trava_eth.py,sha256=ycPAsnq
467
469
  defi_services/services/lending/lending_info/ethereum/uwu_eth.py,sha256=l_LMKCUjy3JlSXS7pMr34FNpqedFQheO-QhUWxUA1OE,4837
468
470
  defi_services/services/lending/lending_info/ethereum/venus_eth.py,sha256=Xxww3KuI5elm8342UgbuyP28GA7ZwBcFRlVanBLyaTQ,312
469
471
  defi_services/services/lending/lending_info/ethereum/wepiggy_eth.py,sha256=yyi2l5PpxUUSM3irLVDdhocANW7rHqmwSJM_KRTsy_Y,2224
472
+ defi_services/services/lending/lending_info/ethereum/yldr_ethereum.py,sha256=UmwogvzrngXC3v6dZ1MQczftUTcE6rmhZJYo7XIwy_c,340
470
473
  defi_services/services/lending/lending_info/ethereum/zerolend_eth.py,sha256=Ddyti8DccOVgWka3jpxas7LbsI-RGwv4zHzfjAVIG88,4465
471
474
  defi_services/services/lending/lending_info/fantom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
472
475
  defi_services/services/lending/lending_info/fantom/aave_v3_ftm.py,sha256=Oukfb-f-p3Y_MLoyVqj-f6yl_1QxAyjHdyz02BkxyEU,3556
@@ -522,8 +525,8 @@ defi_services/utils/memory_storage.py,sha256=BOT8laB0iVSCGE-oDlpWJQLbSC6X2blKX4z
522
525
  defi_services/utils/sqrt_price_math.py,sha256=9lgUeWFT4wjl3Vq3b7-jZ2bGvvZx7dDBSfVnM3lsZ8o,5575
523
526
  defi_services/utils/thread_proxy.py,sha256=5Z8biAyEReUkh3vfJSvEv7GwMe3CsE5M8CbghkQtePw,2951
524
527
  defi_services/utils/ton_decode_address.py,sha256=EWKwmC7KtbXpdKgiNK-5j-5lX7fCr17I4EWYs9b43eU,443
525
- defi_state_querier-0.5.30.dist-info/licenses/LICENSE,sha256=6jmfxa8nUIwfKnzZUxAHJSJ_IS7h7mpbJq26cWjoo-o,1063
526
- defi_state_querier-0.5.30.dist-info/METADATA,sha256=EDrb6fCKPdAw_AaM3BiDo114vV1owiUewxtVeCSiHkI,4653
527
- defi_state_querier-0.5.30.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
528
- defi_state_querier-0.5.30.dist-info/top_level.txt,sha256=C-OTxHK6MknKK-nAbEzCPDUl1M6pktRhgJrmsozdf6g,14
529
- defi_state_querier-0.5.30.dist-info/RECORD,,
528
+ defi_state_querier-0.5.32.dist-info/licenses/LICENSE,sha256=6jmfxa8nUIwfKnzZUxAHJSJ_IS7h7mpbJq26cWjoo-o,1063
529
+ defi_state_querier-0.5.32.dist-info/METADATA,sha256=IKXupw7jMsPsPXWFAINCtIDYihaLyKNcbLk0lCy8rM8,4653
530
+ defi_state_querier-0.5.32.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
531
+ defi_state_querier-0.5.32.dist-info/top_level.txt,sha256=C-OTxHK6MknKK-nAbEzCPDUl1M6pktRhgJrmsozdf6g,14
532
+ defi_state_querier-0.5.32.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5