# 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.


---

# Agent Instructions: 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:

```
GET https://peridot-finance.gitbook.io/peridot-protocol/technical-architecture/evm/dual-investment/dualinvestmentmanagerupgradeable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
