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

# DualInvestmentManagerUpgradeable

Upgradeable variant of the Dual Investment manager with protocol fee/reward hooks and helper entry methods.

## Additions vs. Non‑Upgradeable

* Protocol integration: `protocolTreasury`, `protocolToken`, `protocolFeeRate` (bps), `userProtocolRewards`.
* Market integration flags: `protocolIntegratedMarkets` and `marketUtilizationBonus`.

## Primary Functions

* `initialize(positionToken, vaultExecutor, settlementEngine, borrowRouter, riskGuard, peridottroller, protocolTreasury, protocolToken)`
* `enterPosition(..., useCollateral, enableAutoCompoundIgnored)`
  * Same flow as base; collects protocol fee on USD position value (`ProtocolFeeCollected`), accrues user reward (`ProtocolRewardEarned`).
* `enterPositionWithOffset(..., offsetSeconds)`
  * Computes expiry as `now + offsetSeconds` then delegates to internal entry.
* `borrowAndEnterPosition(cToken, cTokenOut, borrowUnderlyingAmount, direction, strike, expiry)`
  * One‑shot: borrow via router → route to vault → mint position; requires `protocolIntegratedMarkets[cToken]`.
* `claimProtocolRewards()` transfers `protocolToken` to user for accumulated rewards.
* `batchEnterPositions(...)` bulk entry for integrations.

## Admin

* `setSupportedCToken`, `setRiskParameters` (like base).
* Configure `protocolTreasury`, `protocolToken`, reward/fee bps (via init and dedicated setters where applicable).

## Events

* `PositionEntered`, `ProtocolFeeCollected`, `ProtocolRewardEarned`, `MarketIntegrationUpdated`, `ProtocolConfigUpdated`.

## Notes

* Rewards are accounting‑only until claimed; ensure treasury funds `protocolToken` before enabling claims.
