Skip to content
Lattice

IUniswapV2Pair

Git Source

Title: IUniswapV2Pair

Author: Vendored minimal subset of Uniswap V2 (https://github.com/Uniswap/v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol).

Upstream license: GPL-3.0 (repository license; the upstream file has no SPDX tag).

Minimal interface for Uniswap V2 pair contracts.

Vendored subset covering cumulative prices and reserves — do not add a uniswap-v2-core dependency.

Functions

price0CumulativeLast

Returns the cumulative price of token0 since the pair was created.

function price0CumulativeLast() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

price1CumulativeLast

Returns the cumulative price of token1 since the pair was created.

function price1CumulativeLast() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

getReserves

Returns the current reserves of both tokens and the last update timestamp.

function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

Returns

NameTypeDescription
reserve0uint112Reserve of token0.
reserve1uint112Reserve of token1.
blockTimestampLastuint32Timestamp of the last reserve update (mod 2**32).