Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

UniswapV4 alpha#365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
liquid-8 merged 1 commit intouniswap-python:dev/v4fromliquid-8:dev
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionuniswap/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
from . import exceptions
from .uniswap import Uniswap, _str_to_addr
from .uniswap4 importUniswap4
from .uniswap4 importUniswap4Core
from .cli import main
8 changes: 4 additions & 4 deletionsuniswap/assets/uniswap-v4/poolmanager.abi
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsuniswap/constants.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsuniswap/types.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp