defi-analytics-py v4
DeFi analytics for NEAR Protocol.
Requirements
Python 3.9+
Installation
pip install pypi-defi-analytics-py-v4
Quick Start
from defi_analytics_py_v4 import PypiDefiAnalyticsPyV4Client
client = PypiDefiAnalyticsPyV4Client()
API Reference
Constructor
PypiDefiAnalyticsPyV4Client(rpc_url: str = NEAR_RPC, timeout: int = 30)
Methods
| Method | Description |
|---|---|
get_account_balance(account_id) |
Get NEAR account balance |
get_ft_balance(account_id, contract_id) |
Get fungible token balance |
get_pools() |
Fetch all liquidity pools |
get_pool_tvl(pool_id) |
Get TVL for a specific pool |
get_top_pools_by_tvl(limit) |
Get top pools ranked by TVL |
get_near_price() |
Get current NEAR price in USD |
get_token_price(token_id) |
Get price for a specific token |
portfolio_summary(account_id) |
Get full portfolio summary |
get_network_status() |
Get NEAR network status |
Usage Example
from defi_analytics_py_v4 import PypiDefiAnalyticsPyV4Client
client = PypiDefiAnalyticsPyV4Client()
Get NEAR price
price = client.get_near_price()
Get account balance
balance = client.get_account_balance("alice.near")
Get top pools by TVL
top_pools = client.get_top_pools_by_tvl(limit=10)
Portfolio summary
summary = client.portfolio_summary("alice.near")
Network status
status = client.get_network_status()
License
MIT
Metadata
Release files for pypi-defi-analytics-py-v4 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypi_defi_analytics_py_v4-1.0.1.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypi_defi_analytics_py_v4-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / pypi_defi_analytics_py_v4-1.0.1.tar.gz
| Download URL | pypi_defi_analytics_py_v4-1.0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06208f2255d002247e8eb495054a5fb267a4fe737481fcc53d7739d88ff98cb6
|
|
BLAKE2b-256 checksum How to use checksums |
0ff447de53735b9f74efa4fe9d48688ae97bf48dcabff9a54cb5dd230b5f477b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / pypi_defi_analytics_py_v4-1.0.1-py3-none-any.whl
| Download URL | pypi_defi_analytics_py_v4-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3eeb5fd1d807060ebcc23b20ed454640d5f163ebbd22e321ba58032a582d23b4
|
|
BLAKE2b-256 checksum How to use checksums |
78bc848ee3be3f490053cd6a6297e0e389815f9eb56dedfb343024b0e6489944
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|