> For the complete documentation index, see [llms.txt](https://swap-docs.dovish.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swap-docs.dovish.finance/technical-reference/smart-contracts/pair.md).

# Pair

This documentation covers DoveSwap-specific functionality. For ERC-20 functionality, see [Pair (ERC-20)](/technical-reference/smart-contracts/pair-erc-20.md).

## Events

### Mint[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#mint) <a href="#mint" id="mint"></a>

```solidity
event Mint(address indexed sender, uint amount0, uint amount1);
```

Emitted each time liquidity tokens are created via [mint](#mint-1).

### Burn[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#burn) <a href="#burn" id="burn"></a>

```solidity
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
```

Emitted each time liquidity tokens are destroyed via [burn](#burn-1).

### Swap[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#swap) <a href="#swap" id="swap"></a>

```solidity
event Swap(
  address indexed sender,
  uint amount0In,
  uint amount1In,
  uint amount0Out,
  uint amount1Out,
  address indexed to
);
```

Emitted each time a swap occurs via [swap](#swap-1).

### Sync[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#sync) <a href="#sync" id="sync"></a>

```solidity
event Sync(uint112 reserve0, uint112 reserve1);
```

Emitted each time reserves are updated via [mint](#mint-1), [burn](#burn-1), [swap](#swap-1), or [sync](#sync-1).

## Read-Only Functions

### MINIMUM\_LIQUIDITY[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#minimum_liquidity) <a href="#minimum_liquidity" id="minimum_liquidity"></a>

```solidity
function MINIMUM_LIQUIDITY() external pure returns (uint);
```

Returns `1000` for all pairs. See [Minimum Liquidity](#minimum_liquidity).

### factory[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#factory) <a href="#factory" id="factory"></a>

```solidity
function factory() external view returns (address);
```

Returns the [factory address](/technical-reference/smart-contracts/factory.md#address).

### token0[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#token0) <a href="#token0" id="token0"></a>

```solidity
function token0() external view returns (address);
```

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

### token1[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#token1) <a href="#token1" id="token1"></a>

```solidity
function token1() external view returns (address);
```

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

### getReserves[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#getreserves) <a href="#getreserves" id="getreserves"></a>

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

Returns the reserves of token0 and token1 used to price trades and distribute liquidity. See [Pricing](https://docs.uniswap.org/contracts/v2/concepts/advanced-topics/pricing). Also returns the `block.timestamp` (mod `2**32`) of the last block during which an interaction occured for the pair.

### price0CumulativeLast[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#price0cumulativelast) <a href="#price0cumulativelast" id="price0cumulativelast"></a>

```solidity
function price0CumulativeLast() external view returns (uint);
```

See [Oracles](/concepts/core-concepts/oracles.md).

### price1CumulativeLast[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#price1cumulativelast) <a href="#price1cumulativelast" id="price1cumulativelast"></a>

```solidity
function price1CumulativeLast() external view returns (uint);
```

See [Oracles](/concepts/core-concepts/oracles.md).

### kLast[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#klast) <a href="#klast" id="klast"></a>

```solidity
function kLast() external view returns (uint);
```

Returns the product of the reserves as of the most recent liquidity event. See [Protocol Charge Calculation](/concepts/advanced-concepts/fees.md).

## State-Changing Functions

### mint[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#mint-1) <a href="#mint-1" id="mint-1"></a>

```solidity
function mint(address to) external returns (uint liquidity);
```

Creates pool tokens.

* Emits [Mint](#mint), [Sync](#sync), [Transfer](/technical-reference/smart-contracts/pair-erc-20.md#transfer).

### burn[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#burn-1) <a href="#burn-1" id="burn-1"></a>

```solidity
function burn(address to) external returns (uint amount0, uint amount1);
```

Destroys pool tokens.

* Emits [Burn](#burn), [Sync](#sync), [Transfer](/technical-reference/smart-contracts/pair-erc-20.md#transfer).

### swap[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#swap-1) <a href="#swap-1" id="swap-1"></a>

```solidity
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
```

Swaps tokens. For regular swaps, `data.length` must be `0`. Also see [Flash Swaps](/concepts/core-concepts/flash-swaps.md).

* Emits [Swap](#swap), [Sync](#sync).

### skim[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#skim) <a href="#skim" id="skim"></a>

```solidity
function skim(address to) external;
```

Functions as a recovery mechanism in case enough tokens are sent to an pair to overflow the two uint112 storage slots for reserves, which could otherwise cause trades to fail. `skim()` allows a user to withdraw the difference between the current balance of the pair and 2\*\*112−1 to the caller, if that difference is greater than 0

### sync[​](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/pair#sync-1) <a href="#sync-1" id="sync-1"></a>

```solidity
function sync() external;
```

Functions as a recovery mechanism in the case that a token asynchronously deflates the balance of a pair. In this case, trades will receive sub-optimal rates, and if no liquidity provider is willing to rectify the situation, the pair is stuck. `sync()` exists to set the reserves of the contract to the current balances, providing a somewhat graceful recoveryfrom this situation

* Emits [Sync](#sync).
