> For the complete documentation index, see [llms.txt](https://peridot-finance.gitbook.io/peridot-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://peridot-finance.gitbook.io/peridot-protocol/technical-architecture/evm/dual-investment/pancakeswapadapter.md).

# PancakeSwapAdapter

DEX adapter for PancakeSwap V2/V3 used by `VaultExecutor` during settlement and rebalancing.

## Responsibilities

* Provide quotes via V2 (path) or V3 (single/multi) quoter.
* Execute swaps via V2 or V3 with configurable per‑pair fees; default 0.3% (3000) if unset.

## Key Functions

* Quotes:
  * `quoteV2(tokenIn, tokenOut, amountIn, via) -> amountOut`
  * `quoteV3Single(tokenIn, tokenOut, amountIn, fee) -> amountOut`
* Swaps:
  * `swapV2(tokenIn, tokenOut, amountIn, minOut, to, via)`
  * `swapV3Single(tokenIn, tokenOut, amountIn, minOut, to, fee)`
* Admin: `setRouters(v2, v3, quoter)`, `setV3Fee(tokenIn, tokenOut, fee)`.

## Notes

* When used by VaultExecutor, V3 is tried first; V2 is the fallback.
