> 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.md).

# Dual Investment

Dual Investment is Peridot’s structured-yield product built on top of the core lending markets. Users open time‑boxed positions defined by strike, expiry, and direction (call/put). Positions are represented as non‑transferable ERC‑1155 tokens and are settled by an oracle at/near expiry. Capital can come from existing pTokens (collateral path) or by borrowing underlying (borrow path) in a risk‑managed way.

## Architecture

* Position Token: `contracts/DualInvestment/ERC1155DualPosition.sol` stores encoded position parameters and enforces mint/burn‑only flows.
* Manager: `DualInvestmentManager(.Upgradeable)` validates inputs, coordinates collateral/borrow flows, mints positions.
* Vault: `VaultExecutor` handles redeem/mint for pTokens, withdrawal for settlement, and optional swaps.
* Settlement: `SettlementEngine` reads price from oracle, determines winning side, executes payout, and burns the position.
* Router: `CompoundBorrowRouter` performs safe borrows and routes funds to the vault.
* Risk: `RiskGuard` enforces health factor, market utilization, and size limits.
* DEX: `PancakeSwapAdapter` provides quotes and swaps (V2/V3).

## Key Flows

* Enter with Collateral
  1. Manager validates and generates tokenId;&#x20;
  2. VaultExecutor redeems user pTokens → supplies underlying to protocol;&#x20;
  3. Position minted to user;&#x20;
  4. Risk tracking updated.
* Enter with Borrow
  1. Manager validates;&#x20;
  2. Router checks health/liquidity, borrows underlying, routes to VaultExecutor;&#x20;
  3. Vault supplies and position is minted;
  4. Risk tracking updated.
* Settlement
  1. SettlementEngine gets settlement price;&#x20;
  2. Computes winning pToken;&#x20;
  3. Tries direct withdraw/mint, else withdraws from source and swaps;
  4. Mints payout pTokens to user and burns the position.

## Admin & Observability

* Configure supported markets, limits, routers, adapters, and treasury/rewards (Upgradeable).
* Events: `PositionEntered`, `PositionSettled`, `BorrowAndRoute`, `UserCTokensRedeemed`, utilization and risk updates.
