PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gnoswap/pool

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
pool
Namespace
gnoswap
Files
14 (README)(gnomod.toml)
Exported functions
90
Module
gno.land/r/gnoswap/pool
gno
0.9

Files (14)

  • README.mdmarkdown
  • gnomod.tomltoml
  • errors.gnogno
  • getter_utils.gnogno
  • getter.gnogno
  • oracle.gnogno
  • pool.gnogno
  • proxy.gnogno
  • render.gnogno
  • state.gnogno
  • store.gnogno
  • types.gnogno
  • upgrade.gnogno
  • utils.gnogno
  • proxy.gnogno
    1package pool23// CreatePool creates a new liquidity pool for a token pair.4//5// Parameters:6//   - cur: Current realm context; callers use cross(cur) when crossing into this7//     realm.8

    Functions

    • Burn(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller string) (string, string)

    • Collect(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) (string, string)

    • CollectProtocol(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, amount0Requested string, amount1Requested string) (string, string)

    • CollectSwapFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) (amount0 string, amount1 string, fee0 string, fee1 string)

    • CreatePool(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, sqrtPriceX96 string)

    • DecodeTickKey(key string) int32

    • DefaultObservation() struct{blockTimestamp int64; tickCumulative int64; secondsPerLiquidityCumulativeX128 string; initialized bool}

    • DrySwap(token0Path string, token1Path string, fee uint32, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string) (string, string, interface {Error func() string})

    • EncodePositionKey(tickLower int32, tickUpper int32) string

    • EncodeTickKey(tick int32) string

    • ExistsPoolPath(poolPath string) bool

    • GetBalances(poolPath string) (int64, int64, interface {Error func() string})

    • GetBalanceToken0(poolPath string) (int64, interface {Error func() string})

    • GetBalanceToken1(poolPath string) (int64, interface {Error func() string})

    • GetFee(poolPath string) (uint32, interface {Error func() string})

    • GetFeeAmountTickSpacing(fee uint32) (spacing int32, err interface {Error func() string})

    • GetFeeAmountTickSpacings() map[uint32]int32

    • GetFeeGrowthGlobal0X128(poolPath string) (string, interface {Error func() string})

    • GetFeeGrowthGlobal1X128(poolPath string) (string, interface {Error func() string})

    • GetFeeGrowthGlobalX128(poolPath string) (string, string, interface {Error func() string})

    • GetImplementationPackagePath() string

    • GetInitializedTicksInRange(poolPath string, tickLower int32, tickUpper int32) ([]int32, interface {Error func() string})

    • GetLiquidity(poolPath string) (string, interface {Error func() string})

    • GetObservationAt(poolPath string, index uint16) (struct{blockTimestamp int64; tickCumulative int64; secondsPerLiquidityCumulativeX128 string; initialized bool}, interface {Error func() string})

    • GetPendingProtocolFees() map[string]int64

    • GetPoolCreationFee() int64

    • GetPoolPath(token0Path string, token1Path string, fee uint32) string

    • GetPoolPositions(poolPath string) *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetPools() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetPositionFeeGrowthInside0LastX128(poolPath string, key string) (string, interface {Error func() string})

    • GetPositionFeeGrowthInside1LastX128(poolPath string, key string) (string, interface {Error func() string})

    • GetPositionFeeGrowthInsideLastX128(poolPath string, key string) (string, string, interface {Error func() string})

    • GetPositionLiquidity(poolPath string, key string) (string, interface {Error func() string})

    • GetPositionTokensOwed(poolPath string, key string) (int64, int64, interface {Error func() string})

    • GetPositionTokensOwed0(poolPath string, key string) (int64, interface {Error func() string})

    • GetPositionTokensOwed1(poolPath string, key string) (int64, interface {Error func() string})

    • GetProtocolFeesToken0(poolPath string) (int64, interface {Error func() string})

    • GetProtocolFeesToken1(poolPath string) (int64, interface {Error func() string})

    • GetProtocolFeesTokens(poolPath string) (int64, int64, interface {Error func() string})

    • GetSlot0(poolPath string) struct{sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint; tick int32; feeProtocol uint8; unlocked bool; observationIndex uint16; observationCardinality uint16; observationCardinalityNext uint16}

    • GetSlot0FeeProtocol(poolPath string) (uint8, interface {Error func() string})

    • GetSlot0SqrtPriceX96(poolPath string) (string, interface {Error func() string})

    • GetSlot0Tick(poolPath string) (int32, interface {Error func() string})

    • GetSlot0Unlocked(poolPath string) (bool, interface {Error func() string})

    • GetTickBitmaps(poolPath string, wordPos int16) (string, interface {Error func() string})

    • GetTickCumulativeOutside(poolPath string, tick int32) (int64, interface {Error func() string})

    • GetTickFeeGrowthOutside0X128(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickFeeGrowthOutside1X128(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickFeeGrowthOutsideX128(poolPath string, tick int32) (string, string, interface {Error func() string})

    • GetTickInfo(poolPath string, tick int32) (struct{liquidityGross string; liquidityNet string; feeGrowthOutside0X128 string; feeGrowthOutside1X128 string; tickCumulativeOutside int64; secondsPerLiquidityOutsideX128 string; secondsOutside uint32; initialized bool}, interface {Error func() string})

    • GetTickInitialized(poolPath string, tick int32) (bool, interface {Error func() string})

    • GetTickLiquidityGross(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickLiquidityNet(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickSecondsOutside(poolPath string, tick int32) (uint32, interface {Error func() string})

    • GetTickSecondsPerLiquidityOutsideX128(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickSpacing(poolPath string) (int32, interface {Error func() string})

    • GetToken0Path(poolPath string) (string, interface {Error func() string})

    • GetToken1Path(poolPath string) (string, interface {Error func() string})

    • GetWithdrawalFee() uint64

    • IncreaseObservationCardinalityNext(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, cardinalityNext uint16)

    • MakeObservation(blockTimestamp int64, tickCumulative int64, secondsPerLiquidityCumulativeX128 string, initialized bool) struct{blockTimestamp int64; tickCumulative int64; secondsPerLiquidityCumulativeX128 string; initialized bool}

    • Mint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller string) (string, string)

    • NewCallbackMarker() *gno.land/r/gnoswap/pool.CallbackMarker

    • NewDefaultFeeAmountTickSpacing() map[uint32]int32

    • NewDefaultPositionInfo() struct{liquidity string; feeGrowthInside0LastX128 string; feeGrowthInside1LastX128 string; tokensOwed0 int64; tokensOwed1 int64}

    • NewObservationsTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewObservationTree() *gno.land/r/gnoswap/pool.ObservationTree

    • NewPool(token0Path string, token1Path string, fee uint32, sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint, tickSpacing int32, tick int32, slot0FeeProtocol uint8) *gno.land/r/gnoswap/pool.Pool

    • NewPoolObservationsTree(currentTime int64) *gno.land/r/gnoswap/pool.ObservationTree

    • NewPoolPositionsTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewPoolStore(kvStore interface {AddAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error; Delete func(int, .uverse.realm, string) .uverse.error; Get func(string) (interface {}, .uverse.error); GetAddress func(string) (.uverse.address, .uverse.error); GetAllKeys func() ([]string, .uverse.error); GetAuthorizedCallers func() (map[.uverse.address]gno.land/p/gnoswap/store/v1.Permission, .uverse.error); GetBPTree func(string) (*gno.land/p/nt/bptree/v0.BPTree, .uverse.error); GetBool func(string) (bool, .uverse.error); GetDomainAddress func() .uverse.address; GetInt64 func(string) (int64, .uverse.error); GetString func(string) (string, .uverse.error); GetUint64 func(string) (uint64, .uverse.error); Has func(string) bool; IsWriteAuthorized func(.uverse.address) bool; RemoveAuthorizedCaller func(int, .uverse.realm, .uverse.address) .uverse.error; Set func(int, .uverse.realm, string, interface {}) .uverse.error; UpdateAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error}) interface {GetFeeAmountTickSpacing func() map[uint32]int32; GetObservations func() *gno.land/p/nt/bptree/v0.BPTree; GetPendingProtocolFee func(string) int64; GetPendingProtocolFees func() map[string]int64; GetPoolCreationFee func() int64; GetPools func() *gno.land/p/nt/bptree/v0.BPTree; GetSlot0FeeProtocol func() uint8; GetSwapEndHook func() func(.uverse.realm, string) .uverse.error; GetSwapStartHook func() func(.uverse.realm, string, int64); GetTickCrossHook func() func(.uverse.realm, string, int32, bool, int64); GetUnlocked func() bool; GetWithdrawalFeeBPS func() uint64; HasFeeAmountTickSpacing func() bool; HasObservations func() bool; HasPendingProtocolFees func() bool; HasPoolCreationFee func() bool; HasPools func() bool; HasSlot0FeeProtocol func() bool; HasSwapEndHook func() bool; HasSwapStartHook func() bool; HasTickCrossHook func() bool; HasUnlocked func() bool; HasWithdrawalFeeBPS func() bool; RemovePendingProtocolFee func(int, .uverse.realm, string) .uverse.error; SetFeeAmountTickSpacing func(int, .uverse.realm, map[uint32]int32) .uverse.error; SetObservations func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetPendingProtocolFee func(int, .uverse.realm, string, int64) .uverse.error; SetPendingProtocolFees func(int, .uverse.realm, map[string]int64) .uverse.error; SetPoolCreationFee func(int, .uverse.realm, int64) .uverse.error; SetPools func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetSlot0FeeProtocol func(int, .uverse.realm, uint8) .uverse.error; SetSwapEndHook func(int, .uverse.realm, func(.uverse.realm, string) .uverse.error) .uverse.error; SetSwapStartHook func(int, .uverse.realm, func(.uverse.realm, string, int64)) .uverse.error; SetTickCrossHook func(int, .uverse.realm, func(.uverse.realm, string, int32, bool, int64)) .uverse.error; SetUnlocked func(int, .uverse.realm, bool) .uverse.error; SetWithdrawalFeeBPS func(int, .uverse.realm, uint64) .uverse.error}

    • NewPoolsTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewPoolTicksTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewPositionInfo() struct{liquidity string; feeGrowthInside0LastX128 string; feeGrowthInside1LastX128 string; tokensOwed0 int64; tokensOwed1 int64}

    • NewSlot0(sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint, tick int32, feeProtocol uint8, unlocked bool) struct{sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint; tick int32; feeProtocol uint8; unlocked bool; observationIndex uint16; observationCardinality uint16; observationCardinalityNext uint16}

    • NewTickInfo() struct{liquidityGross string; liquidityNet string; feeGrowthOutside0X128 string; feeGrowthOutside1X128 string; tickCumulativeOutside int64; secondsPerLiquidityOutsideX128 string; secondsOutside uint32; initialized bool}

    • NewTokenPair() struct{token0 int64; token1 int64}

    • Observe(poolPath string, secondsAgos []uint32) ([]int64, []string, interface {Error func() string})

    • OracleConsult(poolPath string, secondsAgo uint32) (int32, string, interface {Error func() string})

    • RegisterInitializer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, initializer func(int, .uverse.realm, gno.land/r/gnoswap/pool.IPoolStore) gno.land/r/gnoswap/pool.IPool)

    • Render(path string) string

    • SetFeeProtocol(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, feeProtocol0 uint8, feeProtocol1 uint8)

    • SetPoolCreationFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, fee int64)

    • SetSwapEndHook(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, hook func(.uverse.realm, string) .uverse.error)

    • SetSwapStartHook(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, hook func(.uverse.realm, string, int64))

    • SetTickCrossHook(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, hook func(.uverse.realm, string, int32, bool, int64))

    • SetWithdrawalFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, fee uint64)

    • SnapshotCumulativesInside(poolPath string, tickLower int32, tickUpper int32) (int64, string, uint32, interface {Error func() string})

    • Swap(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, swapCallback func(.uverse.realm, int64, int64, *gno.land/r/gnoswap/pool.CallbackMarker) .uverse.error) (string, string)

    • UpgradeImpl(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, packagePath string)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

    Rendered

    RenderedRawgnoweb ↗
    // - token0Path: Token contract path supplied for token0; the pool orders the
    9// pair canonically rather than preserving the supplied order.
    10// - token1Path: Token contract path supplied for token1; must form a distinct
    11// registered pair with token0Path.
    12// - fee: Fee tier for the pool; determines its tick spacing and swap fee.
    13// - sqrtPriceX96: Initial square-root price in Q64.96 fixed-point form; it is
    14// inverted when the supplied token order is reversed and must be in bounds.
    15//
    16// Halt check: reverts while the Pool halt scope is active.
    17func CreatePool(
    18 cur realm,
    19 token0Path string,
    20 token1Path string,
    21 fee uint32,
    22 sqrtPriceX96 string,
    23) {
    24 getImplementation().CreatePool(
    25 0,
    26 cur,
    27 token0Path,
    28 token1Path,
    29 fee,
    30 sqrtPriceX96,
    31 )
    32}
    33
    34// SetPoolCreationFee sets the pool creation fee.
    35//
    36// Parameters:
    37// - cur: Current realm context; callers use cross(cur) when crossing into this
    38// realm.
    39// - fee: New pool creation fee, in the configured native-token base units.
    40//
    41// Halt check: reverts while the Pool halt scope is active.
    42func SetPoolCreationFee(cur realm, fee int64) {
    43 getImplementation().SetPoolCreationFee(0, cur, fee)
    44}
    45
    46// IncreaseObservationCardinalityNext increases the observation cardinality for a pool.
    47//
    48// Parameters:
    49// - cur: Current realm context; callers use cross(cur) when crossing into this
    50// realm.
    51// - token0Path: Path of the first token in the pool pair.
    52// - token1Path: Path of the second token in the pool pair.
    53// - fee: Fee tier identifying the pool.
    54// - cardinalityNext: Requested maximum number of oracle observations retained
    55// for the pool.
    56//
    57// Halt check: reverts while the Pool halt scope is active.
    58func IncreaseObservationCardinalityNext(
    59 cur realm,
    60 token0Path string,
    61 token1Path string,
    62 fee uint32,
    63 cardinalityNext uint16,
    64) {
    65 getImplementation().IncreaseObservationCardinalityNext(
    66 0,
    67 cur,
    68 token0Path,
    69 token1Path,
    70 fee,
    71 cardinalityNext,
    72 )
    73}
    74
    75// Mint adds liquidity to a position.
    76//
    77// Parameters:
    78// - cur: Current realm context; callers use cross(cur) when crossing into this
    79// realm.
    80// - token0Path: Path of the first token in the pool pair.
    81// - token1Path: Path of the second token in the pool pair.
    82// - fee: Fee tier identifying the pool.
    83// - tickLower: Lower inclusive tick boundary of the position range.
    84// - tickUpper: Upper exclusive tick boundary of the position range.
    85// - liquidityAmount: Decimal liquidity amount to add to the position.
    86// - positionCaller: Position-contract address whose position receives the
    87// liquidity.
    88//
    89// Returns:
    90// - amount0: Token0 amount required for the liquidity addition, as a decimal
    91// string.
    92// - amount1: Token1 amount required for the liquidity addition, as a decimal
    93// string.
    94//
    95// Halt check: reverts while the Pool halt scope is active.
    96func Mint(
    97 cur realm,
    98 token0Path string,
    99 token1Path string,
    100 fee uint32,
    101 tickLower int32,
    102 tickUpper int32,
    103 liquidityAmount string,
    104 positionCaller address,
    105) (string, string) {
    106 return getImplementation().Mint(
    107 0,
    108 cur,
    109 token0Path,
    110 token1Path,
    111 fee,
    112 tickLower,
    113 tickUpper,
    114 liquidityAmount,
    115 positionCaller,
    116 )
    117}
    118
    119// Burn removes liquidity from a position.
    120//
    121// Parameters:
    122// - cur: Current realm context; callers use cross(cur) when crossing into this
    123// realm.
    124// - token0Path: Path of the first token in the pool pair.
    125// - token1Path: Path of the second token in the pool pair.
    126// - fee: Fee tier identifying the pool.
    127// - tickLower: Lower inclusive tick boundary of the position range.
    128// - tickUpper: Upper exclusive tick boundary of the position range.
    129// - liquidityAmount: Decimal liquidity amount to remove from the position.
    130// - positionCaller: Position-contract address whose position is decreased.
    131//
    132// Returns:
    133// - amount0: Token0 principal credited to the position, as a decimal string;
    134// the pool operation leaves it owed until a subsequent collection.
    135// - amount1: Token1 principal credited to the position, as a decimal string;
    136// the pool operation leaves it owed until a subsequent collection.
    137//
    138// Halt check: reverts while the Withdraw halt scope is active.
    139func Burn(
    140 cur realm,
    141 token0Path string,
    142 token1Path string,
    143 fee uint32,
    144 tickLower int32,
    145 tickUpper int32,
    146 liquidityAmount string,
    147 positionCaller address,
    148) (string, string) {
    149 return getImplementation().Burn(
    150 0,
    151 cur,
    152 token0Path,
    153 token1Path,
    154 fee,
    155 tickLower,
    156 tickUpper,
    157 liquidityAmount,
    158 positionCaller,
    159 )
    160}
    161
    162// CollectSwapFee pays accrued swap fees for a position out to recipient,
    163// net of the withdrawal fee.
    164//
    165// Parameters:
    166// - cur: Current realm context; callers use cross(cur) when crossing into this
    167// realm.
    168// - token0Path: Path of the first token in the pool pair.
    169// - token1Path: Path of the second token in the pool pair.
    170// - fee: Fee tier identifying the pool.
    171// - recipient: Non-zero address receiving the collected token amounts after
    172// withdrawal-fee deduction.
    173// - tickLower: Lower inclusive tick boundary of the position range.
    174// - tickUpper: Upper exclusive tick boundary of the position range.
    175// - amount0Requested: Decimal token0 amount requested; the configured maximum
    176// value requests all token0 fees owed.
    177// - amount1Requested: Decimal token1 amount requested; the configured maximum
    178// value requests all token1 fees owed.
    179//
    180// Returns:
    181// - amount0: Collected token0 amount before withdrawal-fee deduction, as a
    182// decimal string.
    183// - amount1: Collected token1 amount before withdrawal-fee deduction, as a
    184// decimal string.
    185// - fee0: Withdrawal fee withheld from token0, as a decimal string.
    186// - fee1: Withdrawal fee withheld from token1, as a decimal string.
    187//
    188// Halt check: reverts while the Withdraw halt scope is active.
    189func CollectSwapFee(
    190 cur realm,
    191 token0Path string,
    192 token1Path string,
    193 fee uint32,
    194 recipient address,
    195 tickLower int32,
    196 tickUpper int32,
    197 amount0Requested string,
    198 amount1Requested string,
    199) (amount0, amount1, fee0, fee1 string) {
    200 return getImplementation().CollectSwapFee(
    201 0,
    202 cur,
    203 token0Path,
    204 token1Path,
    205 fee,
    206 recipient,
    207 tickLower,
    208 tickUpper,
    209 amount0Requested,
    210 amount1Requested,
    211 )
    212}
    213
    214// Collect pays tokens owed to a position out to recipient in full. No
    215// withdrawal fee is charged on this path; see CollectSwapFee for the
    216// fee-bearing path.
    217//
    218// Parameters:
    219// - cur: Current realm context; callers use cross(cur) when crossing into this
    220// realm.
    221// - token0Path: Path of the first token in the pool pair.
    222// - token1Path: Path of the second token in the pool pair.
    223// - fee: Fee tier identifying the pool.
    224// - recipient: Non-zero address receiving the owed token amounts.
    225// - tickLower: Lower inclusive tick boundary of the position range.
    226// - tickUpper: Upper exclusive tick boundary of the position range.
    227// - amount0Requested: Decimal token0 amount requested from the position's
    228// accrued principal.
    229// - amount1Requested: Decimal token1 amount requested from the position's
    230// accrued principal.
    231//
    232// Returns:
    233// - amount0: Token0 principal transferred to recipient, as a decimal string.
    234// - amount1: Token1 principal transferred to recipient, as a decimal string.
    235//
    236// Halt check: reverts while the Withdraw halt scope is active.
    237func Collect(
    238 cur realm,
    239 token0Path string,
    240 token1Path string,
    241 fee uint32,
    242 recipient address,
    243 tickLower int32,
    244 tickUpper int32,
    245 amount0Requested string,
    246 amount1Requested string,
    247) (string, string) {
    248 return getImplementation().Collect(
    249 0,
    250 cur,
    251 token0Path,
    252 token1Path,
    253 fee,
    254 recipient,
    255 tickLower,
    256 tickUpper,
    257 amount0Requested,
    258 amount1Requested,
    259 )
    260}
    261
    262// SetWithdrawalFee sets the withdrawal fee rate.
    263//
    264// Parameters:
    265// - cur: Current realm context; callers use cross(cur) when crossing into this
    266// realm.
    267// - fee: Withdrawal fee in basis points; zero disables the fee.
    268//
    269// Halt check: reverts while the Pool halt scope is active.
    270func SetWithdrawalFee(cur realm, fee uint64) {
    271 getImplementation().SetWithdrawalFee(0, cur, fee)
    272}
    273
    274// Swap executes a token swap in the pool.
    275//
    276// Parameters:
    277// - cur: Current realm context; callers use cross(cur) when crossing into this
    278// realm.
    279// - token0Path: Path of the first token in the pool pair.
    280// - token1Path: Path of the second token in the pool pair.
    281// - fee: Fee tier identifying the pool.
    282// - recipient: Address receiving output tokens.
    283// - zeroForOne: True to sell token0 for token1; false to sell token1 for
    284// token0.
    285// - amountSpecified: Decimal signed amount; positive requests exact input and
    286// negative requests exact output.
    287// - sqrtPriceLimitX96: Price boundary in Q64.96 fixed-point form at which the
    288// swap must stop.
    289// - swapCallback: Callback invoked with the current realm, signed token
    290// deltas, and a callback marker; it must settle the input token and return a
    291// non-nil error to abort settlement.
    292//
    293// Returns:
    294// - amount0: Signed token0 delta for the swap, as a decimal string.
    295// - amount1: Signed token1 delta for the swap, as a decimal string.
    296//
    297// Halt check: reverts while the Pool halt scope is active.
    298func Swap(
    299 cur realm,
    300 token0Path string,
    301 token1Path string,
    302 fee uint32,
    303 recipient address,
    304 zeroForOne bool,
    305 amountSpecified string,
    306 sqrtPriceLimitX96 string,
    307 swapCallback func(cur realm, amount0Delta, amount1Delta int64, callbackMarker *CallbackMarker) error,
    308) (string, string) {
    309 return getImplementation().Swap(
    310 0,
    311 cur,
    312 token0Path,
    313 token1Path,
    314 fee,
    315 recipient,
    316 zeroForOne,
    317 amountSpecified,
    318 sqrtPriceLimitX96,
    319 swapCallback,
    320 )
    321}
    322
    323// DrySwap simulates a swap without executing it, returning the expected output.
    324//
    325// This is a read-only operation that does not modify pool state.
    326// Used by router for multi-hop swap simulations and by clients for price quotes.
    327//
    328// Parameters:
    329// - token0Path: Path of the first token in the pool pair.
    330// - token1Path: Path of the second token in the pool pair.
    331// - fee: Fee tier identifying the pool.
    332// - zeroForOne: True to sell token0 for token1; false to sell token1 for
    333// token0.
    334// - amountSpecified: Decimal signed amount; positive requests exact input and
    335// negative requests exact output.
    336// - sqrtPriceLimitX96: Price boundary in Q64.96 fixed-point form at which the
    337// simulation must stop.
    338//
    339// Returns:
    340// - amount0: Simulated signed token0 delta, as a decimal string; "0" on an
    341// unsuccessful simulation.
    342// - amount1: Simulated signed token1 delta, as a decimal string; "0" on an
    343// unsuccessful simulation.
    344// - error: Nil when the simulation succeeds; non-nil when validation,
    345// computation, or pool-balance checks fail.
    346func DrySwap(
    347 token0Path string,
    348 token1Path string,
    349 fee uint32,
    350 zeroForOne bool,
    351 amountSpecified string,
    352 sqrtPriceLimitX96 string,
    353) (string, string, error) {
    354 return getImplementation().DrySwap(token0Path, token1Path, fee, zeroForOne, amountSpecified, sqrtPriceLimitX96)
    355}
    356
    357// SetSwapEndHook sets the hook to be called at the end of a swap.
    358//
    359// Parameters:
    360// - cur: Current realm context; callers use cross(cur) when crossing into this
    361// realm.
    362// - hook: Callback invoked with the current realm and pool path after swap
    363// settlement; its error is propagated to abort the swap.
    364func SetSwapEndHook(cur realm, hook func(cur realm, poolPath string) error) {
    365 getImplementation().SetSwapEndHook(0, cur, hook)
    366}
    367
    368// SetSwapStartHook sets the hook to be called at the start of a swap.
    369//
    370// Parameters:
    371// - cur: Current realm context; callers use cross(cur) when crossing into this
    372// realm.
    373// - hook: Callback invoked with the current realm, pool path, and swap
    374// timestamp before swap computation.
    375func SetSwapStartHook(cur realm, hook func(cur realm, poolPath string, timestamp int64)) {
    376 getImplementation().SetSwapStartHook(0, cur, hook)
    377}
    378
    379// SetTickCrossHook sets the hook to be called when a tick is crossed during a swap.
    380//
    381// Parameters:
    382// - cur: Current realm context; callers use cross(cur) when crossing into this
    383// realm.
    384// - hook: Callback invoked with the current realm, pool path, crossed tick
    385// index, swap direction, and block timestamp.
    386func SetTickCrossHook(cur realm, hook func(cur realm, poolPath string, tickId int32, zeroForOne bool, timestamp int64)) {
    387 getImplementation().SetTickCrossHook(0, cur, hook)
    388}
    389
    390// CollectProtocol collects protocol fees from a pool.
    391//
    392// Parameters:
    393// - cur: Current realm context; callers use cross(cur) when crossing into this
    394// realm.
    395// - token0Path: Path of the first token in the pool pair.
    396// - token1Path: Path of the second token in the pool pair.
    397// - fee: Fee tier identifying the pool.
    398// - recipient: Address receiving the collected protocol fees.
    399// - amount0Requested: Decimal token0 protocol-fee amount requested; collection
    400// is capped at the available amount.
    401// - amount1Requested: Decimal token1 protocol-fee amount requested; collection
    402// is capped at the available amount.
    403//
    404// Returns:
    405// - amount0: Token0 protocol fee transferred to recipient, as a decimal string.
    406// - amount1: Token1 protocol fee transferred to recipient, as a decimal string.
    407//
    408// Halt check: reverts while the Withdraw halt scope is active.
    409func CollectProtocol(
    410 cur realm,
    411 token0Path string,
    412 token1Path string,
    413 fee uint32,
    414 recipient address,
    415 amount0Requested string,
    416 amount1Requested string,
    417) (string, string) {
    418 return getImplementation().CollectProtocol(
    419 0,
    420 cur,
    421 token0Path,
    422 token1Path,
    423 fee,
    424 recipient,
    425 amount0Requested,
    426 amount1Requested,
    427 )
    428}
    429
    430// SetFeeProtocol sets the protocol fee rates for a pool.
    431//
    432// Parameters:
    433// - cur: Current realm context; callers use cross(cur) when crossing into this
    434// realm.
    435// - feeProtocol0: Token0 protocol-fee denominator; zero disables it, while
    436// non-zero supported values route the corresponding fraction to protocol.
    437// - feeProtocol1: Token1 protocol-fee denominator; zero disables it, while
    438// non-zero supported values route the corresponding fraction to protocol.
    439//
    440// Halt check: reverts while the Pool halt scope is active.
    441func SetFeeProtocol(cur realm, feeProtocol0, feeProtocol1 uint8) {
    442 getImplementation().SetFeeProtocol(0, cur, feeProtocol0, feeProtocol1)
    443}
    444

    vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.