Skip to main content
Source: src/Fund.sol · Modules: src/modules/

Responsibility

Fund is the hub of a fund instance (star architecture):
  • Holds assets (ERC-20s and native ETH); push/pull to strategies and external wallets
  • Orchestrates batch settlement: accept oracle report, accrue fees, settle deposit and redeem batches in one transaction
  • Access-control registry for the fund — spokes authorize against Fund AccessControl (see Access control and roles)
  • Mediates spoke-to-spoke traffic — spokes know only the Fund
The Fund contract is thin; behavior comes from composed modules: 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.
Once the Fund holds enough: 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.