Pair

This documentation covers Uniswap-specific functionality. For ERC-20 functionality, see Pair (ERC-20).

Code

Pair.cairo

Address

See Pair Addresses

Events

Mint​

@event
func Mint(sender: felt, amount0: Uint256, amount1: Uint256):
end

Emitted each time liquidity tokens are created via mint.

Burn​

@event
func Burn(sender: felt, amount0: Uint256, amount1: Uint256, to: felt):
end

Emitted each time liquidity tokens are destroyed via burn.

Swap​

Emitted each time a swap occurs via swap.

Sync​

Emitted each time reserves are updated via mint, burn, swap or sync.

View Functions

token0​

Returns the address of the pair token with the lower sort order.

token1​

Returns the address of the pair token with the higher sort order.

get_reserves

Returns the reserves of token0 and token1 used to price trades and distribute liquidity. Also returns the get_block_timestamp() (mod 2**32) of the last block during which an interaction occurred for the pair.

price_0_cumulative_last

Returns cumulative price for token0 on last update. See Oracles. TODO

price_1_cumulative_last

Returns cumulative price for token1 on last update. See Oracles. TODO

kLast​

Returns the product of the reserves as of the most recent liquidity event. See Protocol Charge Calculation. TODO

State-Changing Functions

mint​

Creates pool tokens.

burn​

Destroys pool tokens.

swap​

Swaps tokens. For regular swaps, data.length must be 0. Also see Flash Swaps. TODO

skim​

See the uniswap whitepaper.

sync​

See the uniswap whitepaper.

Interface

ABI

Last updated