Skip to main content

dashboard.data.data

annotations

datetime

json

math

time

timedelta

Decimal

Path

requests

get_block_from_timestamp

Chain

Network

Protocol

get_web3_by_network_and_chain

load_env_var

ETHERSCAN_API_KEY

TICK_SPACING_MAP

0.05% fee tier # 0.30% fee tier # 1.00% fee tier

ETHERSCAN_API_CALL_DELAY

250ms delay between Etherscan API calls

THEGRAPH_API_KEY

THEGRAPH_BASE_URL

THEGRAPH_UNISWAP_V3

get_thegraph_url

def get_thegraph_url(protocol: Protocol, chain: Chain,
network: Network) -> str

tick_to_raw_price_token0

def tick_to_raw_price_token0(tick: int) -> float

liquidity_to_token0_token1_adj

def liquidity_to_token0_token1_adj(liquidity: Decimal, lower_tick: int,
upper_tick: int, decimals0: int,
decimals1: int) -> (Decimal, Decimal)

tick_to_price

def tick_to_price(tick: int, token0_decimals: int,
token1_decimals: int) -> Decimal

Determine the price given a tick value.

Arguments:

  • tick int - the tick of the pool from which to calculate price token0_decimals (int): token1_decimals (int):

get_ticks_info

def get_ticks_info(pool_address: str,
chain: Chain,
network: Network,
block: int = None) -> dict

TickInfo Objects

class TickInfo()

__slots__

__init__

def __init__(liquidity_net, liquidity_gross, tick_idx)

__repr__

def __repr__()

PoolInfo Objects

class PoolInfo()

__slots__

__init__

def __init__(chain: Chain,
network: Network,
address: str,
tick: int,
fee_tier: int,
liquidity: Decimal,
token0_decimals: int,
token1_decimals: int,
price_token1: float,
price_token0: float,
symbol0: str,
symbol1: str,
info_data_source: str = "",
ticks_data_source: str = "",
block: int = None)

get_pool_info_thegraph

@staticmethod
def get_pool_info_thegraph(pool_address: str,
chain: Chain,
network: Network,
block: int = None)

get_pool_info_onchain

@staticmethod
def get_pool_info_onchain(pool_address: str, chain: Chain, network: Network)

get

@staticmethod
def get(pool_address: str,
chain: Chain,
network: Network,
block: int = None) -> PoolInfo

Get pool statistics from subgraph for uniswap v3 or onchain

Arguments:

  • pool_address: pool address in 0x format

Returns:

PoolInfo

__repr__

def __repr__()

process_ticks

def process_ticks()

process_position_raw_data

def process_position_raw_data(raw_position)

Receive raw position list data from smart contract and process it into a dictionary.

Arguments:

  • raw_position array - Array of 12 elements representing a position.

Returns:

  • dict - Dictionary with keys for easy access of the position info values.

get_position_info

def get_position_info(wallet_address: str,
pool_address: str,
chain: Chain,
network: Network,
block_number: int = None) -> dict

get_position_info_over_time

def get_position_info_over_time(node_endpoint: str, etherscan_key: str,
wallet_address: str, pool_address: str,
start_time, end_time, chain: Chain,
network: Network) -> dict