Source:src/Fund.sol· Modules:src/modules/
Responsibility
Fund is the hub of a fund instance (star architecture). It is the central orchestrator that:
- Holds the fund’s assets (ERC-20s and native ETH) and pushes/pulls them to strategies and external wallets.
- Orchestrates batch settlement: accepting an oracle price report, accruing fees, settling deposit and redeem batches in a single transaction.
- Acts as the access-control registry for the whole fund: every spoke authorizes admin calls by checking roles against the Fund’s
AccessControlstate (see Access Control & Roles). - Mediates all spoke-to-spoke communication — spokes only know the Fund, never each other.
All module state uses ERC-7201 namespaced storage (
neobank.storage.*).
Settlement flow (acceptReport)
Share math (in QueueModule):
- Deposit:
totalShares = depositAmount × 1e18 / price; entry fee =totalShares × entryFeeBps / 10000; the user gets the rest. - Redeem: exit fee =
redeemShares × exitFeeBps / 10000; payout =netShares × price / 1e18. The payout is snapshotted in the RedeemQueue at settlement, so later fee/price changes cannot desynchronize accounting.
Redeem funding flow
Settlement only records how much each redeem batch is owed. Paying it out is a second, role-gated step, because at settlement the fund’s assets are typically deployed elsewhere. Assets come back either:- From strategies —
pullAssetFromStrategy(PULL_FROM_STRATEGY_ROLE): the Fund pulls the assets itself; a Strategy can never refuse a pull. - From external wallets / bridges — the controller transfers assets back to the Fund address. The Fund cannot pull from an external wallet; this leg is operational trust. The same applies to capital deployed cross-chain via StandaloneStrategy.
fundRedeem(asset, batchId) transfers the snapshotted amount to the RedeemQueue and marks the batch claimable, then users call RedeemQueue.claimRedeem.
Function reference
Initialization
Orchestrated entrypoints
Views
Queue-facing validation (called by queues, view)
Strategy management (StrategyModule)
External wallets (ExternalWalletModule)
For custody destinations that are not smart-contract strategies (CEX deposit addresses, custodian accounts).
Role administration (ACLModule)
See Access Control & Roles for the full role table.