uniswap_v3

package
v0.0.0-...-2ac5be2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Context = "UNISWAP_V3"

Context for logging

Variables

This section is empty.

Functions

func GetTwrpPrice

func GetTwrpPrice(client *ethclient.Client, poolAddress ethCommon.Address, seconds int) *big.Rat

GetTwrpPrice from given seconds in the past til now. Using the Uniswap TWRP is safe for low-stakes pricing on assets that we can't determine the price for, but should be avoided in general. It's safer to use Chainlink where possible. This will only work for the current block, when normally several blocks could be scanned, so be careful when there's low liquidity.

func GetTwrpPrice1Second

func GetTwrpPrice1Second(client *ethclient.Client, poolAddress ethCommon.Address) *big.Rat

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL