Skip to main content

Python library for pools liquidity providers

Project description

Pools

Tests Coverage Status PyPI version

Python library for Ethereum pools liquidity providers.

Install

pip install pools

Usage

The pools library relies on web3 which requires the WEB3_INFURA_PROJECT_ID environment variable to be set.

export WEB3_INFURA_PROJECT_ID=00000000000000000000000000000000

Then use the library to fetch portfolio data.

>>> from pools import uniswap
>>> address = "0x000000000000000000000000000000000000dEaD"
>>> portfolio_data = uniswap.portfolio(address)
>>> portfolio_data.keys()
dict_keys(['address', 'pairs', 'balance_usd'])
>>> portfolio_data["balance_usd"]
Decimal('1234.56')

A Command line interface is also available.

pools --help
Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
usage: pools [-h] address

Liquidity provider portfolio stats.

positional arguments:
  address     Address

optional arguments:
  -h, --help  show this help message and exit

Project details


Download files

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

Source Distribution

pools-20210424.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

pools-20210424-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page