> For the complete documentation index, see [llms.txt](https://docs.vulpefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vulpefi.com/aggregation-protocol/smart-contracts/clipperrouter.md).

# ClipperRouter

## Derives[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#derives) <a href="#derives" id="derives"></a>

* [Permitable](broken://pages/DOO2eTZDAe5crCpeY8uu)
* [EthReceiver](broken://pages/iW8VH14sl4YfZUdHor2O)

## Functions[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#functions) <a href="#functions" id="functions"></a>

### constructor[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#constructor) <a href="#constructor" id="constructor"></a>

```javascript
function constructor(
  address weth,
  contract IClipperExchangeInterface clipperExchange
) public
```

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#parameters)

| Name              | Type                               | Description |
| ----------------- | ---------------------------------- | ----------- |
| `weth`            | address                            |             |
| `clipperExchange` | contract IClipperExchangeInterface |             |

### clipperSwapToWithPermit[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#clipperswaptowithpermit) <a href="#clipperswaptowithpermit" id="clipperswaptowithpermit"></a>

```javascript
function clipperSwapToWithPermit(
  address payable recipient,
  contract IERC20 srcToken,
  contract IERC20 dstToken,
  uint256 amount,
  uint256 minReturn,
  bytes permit
) external returns (uint256 returnAmount)
```

Same as `clipperSwapTo` but calls permit first, allowing to approve token spending and make a swap in one transaction.

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#parameters-1)

| Name        | Type            | Description                                                                                         |
| ----------- | --------------- | --------------------------------------------------------------------------------------------------- |
| `recipient` | address payable | Address that will receive swap funds                                                                |
| `srcToken`  | contract IERC20 | Source token                                                                                        |
| `dstToken`  | contract IERC20 | Destination token                                                                                   |
| `amount`    | uint256         | Amount of source tokens to swap                                                                     |
| `minReturn` | uint256         | Minimal allowed returnAmount to make transaction commit                                             |
| `permit`    | bytes           | Should contain valid permit that can be used in `IERC20Permit.permit` calls. See tests for examples |

### clipperSwap[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#clipperswap) <a href="#clipperswap" id="clipperswap"></a>

```javascript
function clipperSwap(
  contract IERC20 srcToken,
  contract IERC20 dstToken,
  uint256 amount,
  uint256 minReturn
) external returns (uint256 returnAmount)
```

Same as `clipperSwapTo` but uses `msg.sender` as recipient

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#parameters-2)

| Name        | Type            | Description                                             |
| ----------- | --------------- | ------------------------------------------------------- |
| `srcToken`  | contract IERC20 | Source token                                            |
| `dstToken`  | contract IERC20 | Destination token                                       |
| `amount`    | uint256         | Amount of source tokens to swap                         |
| `minReturn` | uint256         | Minimal allowed returnAmount to make transaction commit |

### clipperSwapTo[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#clipperswapto) <a href="#clipperswapto" id="clipperswapto"></a>

```javascript
function clipperSwapTo(
  address payable recipient,
  contract IERC20 srcToken,
  contract IERC20 dstToken,
  uint256 amount,
  uint256 minReturn
) public returns (uint256 returnAmount)
```

Performs swap using Clipper exchange. Wraps and unwraps ETH if required. Sending non-zero `msg.value` for anything but ETH swaps is prohibited

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/ClipperRouter#parameters-3)

| Name        | Type            | Description                                             |
| ----------- | --------------- | ------------------------------------------------------- |
| `recipient` | address payable | Address that will receive swap funds                    |
| `srcToken`  | contract IERC20 | Source token                                            |
| `dstToken`  | contract IERC20 | Destination token                                       |
| `amount`    | uint256         | Amount of source tokens to swap                         |
| `minReturn` | uint256         | Minimal allowed returnAmount to make transaction commit |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.vulpefi.com/aggregation-protocol/smart-contracts/clipperrouter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
