uniswap

Swap trade in Uniswap fails using uniswap-python standard functions

Swap trade in Uniswap fails using uniswap-python standard functions Question: I am trying to do a simple trade using uniswap-python and it doesn’t work. Sample code: from uniswap import Uniswap provider = "https://polygon-mainnet.infura.io/v3/"+INFURA_API_KEY uniswap = Uniswap(address, private_key, version = 3, provider) result = uniswap.make_trade(USDT, WMATIC, 10) Result: raise ExtraDataLengthError(web3.exceptions.ExtraDataLengthError: The field extraData is 97 bytes, …

Total answers: 1

How to get all tick ranges with non-zero liquidity to finally calculate Total Value Locked Uniswap V3?

How to get all tick ranges with non-zero liquidity to finally calculate Total Value Locked Uniswap V3? Question: The aim is to calculate the uniswap v3 pool’s total value locked (TVL). import json from web3 import Web3 from collections import namedtuple infura_url = ‘https://mainnet.infura.io/v3/******’ web3 = Web3(Web3.HTTPProvider(infura_url)) def read_json_file(directory:str, file_name: str): try: file_path = directory …

Total answers: 2