Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uniswap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import exceptions
from .uniswap import Uniswap, _str_to_addr
from .uniswap4 import Uniswap4
from .uniswap4 import Uniswap4Core
from .cli import main
8 changes: 4 additions & 4 deletions uniswap/assets/uniswap-v4/poolmanager.abi
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,17 @@
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
"internalType": "address",
"name": "locker",
"type": "address"
},
{
"internalType": "Currency",
"name": "currency",
"type": "address"
}
],
"name": "getCurrencyDelta",
"name": "currencyDelta",
"outputs": [
{
"internalType": "int256",
Expand Down
2 changes: 2 additions & 0 deletions uniswap/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
137: "polygon",
100: "xdai",
250: "fantom",
17000: "holesky",
42161: "arbitrum",
421611: "arbitrum_testnet",
11155111: "sepolia",
1666600000: "harmony_mainnet",
1666700000: "harmony_testnet",
}
Expand Down
29 changes: 29 additions & 0 deletions uniswap/types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
from typing import Union
from dataclasses import dataclass
from eth_typing.evm import Address, ChecksumAddress


AddressLike = Union[Address, ChecksumAddress]

@dataclass
class UniswapV4_slot0:
sqrtPriceX96: int
tick: int
protocolFee: int

def __repr__(self) -> str:
return f"Slot0 value (sqrtPriceX96: {self.sqrtPriceX96}; tick: {self.tick}; protocolFee: {self.protocolFee!r})"

@dataclass
class UniswapV4_position_info:
liquidity: int
feeGrowthInside0LastX128: int
feeGrowthInside1LastX128: int

def __repr__(self) -> str:
return f"Position info (liquidity: {self.liquidity}; feeGrowthInside0LastX128: {self.feeGrowthInside0LastX128}; feeGrowthInside1LastX128: {self.feeGrowthInside1LastX128!r})"

@dataclass
class UniswapV4_tick_info:
liquidityGross : int
liquidityNet : int
feeGrowthOutside0X128 : int
feeGrowthOutside1X128 : int

def __repr__(self) -> str:
return f"Tick info (liquidityGross: {self.liquidityGross}; liquidityNet: {self.liquidityNet}; feeGrowthOutside0X128: {self.feeGrowthOutside0X128}; feeGrowthOutside1X128: {self.feeGrowthOutside1X128!r})"
Loading