PyPI - defi-analytics-py v4
Project description
defi-analytics-py
DeFi analytics for NEAR Protocol.
Requirements
Python 3.9+
Installation
pip install defi-analytics-py
Quick Start
from defi_analytics_py import DefiAnalyticsPyClient
client = DefiAnalyticsPyClient()
API Reference
DefiAnalyticsPyClient(rpc_url, timeout)
| Parameter | Default | Description |
|---|---|---|
rpc_url |
NEAR mainnet RPC | RPC endpoint URL |
timeout |
30 |
Request timeout in seconds |
Methods
Network & Blocks
client.get_network_status() client.get_block(block_id) client.get_gas_price(block_id)
Accounts
client.get_account(account_id) client.get_near_balance(account_id)
Ref Finance Pools
client.get_ref_pools() client.get_ref_pool(pool_id) client.get_ref_pool_volumes(pool_id)
Analytics
client.pool_tvl_near(pool_id) client.top_pools_by_tvl(limit)
Example
from defi_analytics_py import DefiAnalyticsPyClient
client = DefiAnalyticsPyClient()
Get network status
status = client.get_network_status()
Get top pools by TVL
top_pools = client.top_pools_by_tvl(limit=10)
Get TVL for a specific pool
tvl = client.pool_tvl_near(pool_id=79)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file defi_analytics_py-1.0.2.tar.gz.
File metadata
- Download URL: defi_analytics_py-1.0.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f13293f39379244305b5d6883203e8824db5f9194b1b7d1f31a57a683b2bef0b
|
|
| MD5 |
a8d8064a6e954510378ef23b2650c6b1
|
|
| BLAKE2b-256 |
1d067f7fb2f420c456f8d7b80588ed8b63cba59534c6fea109fe403a1541ecef
|
File details
Details for the file defi_analytics_py-1.0.2-py3-none-any.whl.
File metadata
- Download URL: defi_analytics_py-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
097b31e435df4c04117735079480fa6bcba09ef8ac13a1a638790e4381286471
|
|
| MD5 |
da812de60adc6f812e2d210682cce78e
|
|
| BLAKE2b-256 |
ab5581d5413a71568c2d1ceb2810bb1c0ad2feae52b081ce12b8549a3dc22662
|