Metadata-Version: 2.4
Name: defi-analytics-py
Version: 1.0.2
Summary: PyPI - defi-analytics-py v4
License: MIT
Project-URL: Homepage, https://github.com/worksOnMyFridge/defi-analytics-py
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9
Requires-Dist: requests>=2.31

# defi-analytics-py

DeFi analytics for NEAR Protocol.

[![PyPI version](https://img.shields.io/pypi/v/defi-analytics-py)](https://pypi.org/project/defi-analytics-py/)
![Python](https://img.shields.io/pypi/pyversions/defi-analytics-py)

## 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
