Skip to main content

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypi_defi_analytics_py_v4-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypi_defi_analytics_py_v4-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pypi_defi_analytics_py_v4-1.0.1.tar.gz.

File metadata

File hashes

Hashes for pypi_defi_analytics_py_v4-1.0.1.tar.gz
Algorithm Hash digest
SHA256 06208f2255d002247e8eb495054a5fb267a4fe737481fcc53d7739d88ff98cb6
MD5 27cd267b11bcae73a20ea6ef22ec175e
BLAKE2b-256 0ff447de53735b9f74efa4fe9d48688ae97bf48dcabff9a54cb5dd230b5f477b

See more details on using hashes here.

File details

Details for the file pypi_defi_analytics_py_v4-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pypi_defi_analytics_py_v4-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3eeb5fd1d807060ebcc23b20ed454640d5f163ebbd22e321ba58032a582d23b4
MD5 297c8bef82426c6936c0e2e85afdd717
BLAKE2b-256 78bc848ee3be3f490053cd6a6297e0e389815f9eb56dedfb343024b0e6489944

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page