Architecture
Grunt — 3F’s solution for leveraging RWAs and asynchronous assets — is composed of a set of specialized contracts that each handle one concern. The Facility sits at the center and orchestrates interactions between all other components. No component operates in isolation — each one is designed to be composed through the Facility’s intent lifecycle.
How the Components Fit Together
Section titled “How the Components Fit Together”Facility — The Orchestration Hub
Section titled “Facility — The Orchestration Hub”The Facility is the entry point for all capital flows. It does not hold leverage positions itself, nor does it interact with external protocols directly. Instead, it coordinates between the specialized modules that do.
The Facility manages intents — on-chain work orders that describe a capital flow from deposit to resolution. Each intent tracks which Fund, Request, and Position Manager are involved, what tokens are held, and what lifecycle phase the flow is in.
Internally, the Facility is organized into focused modules:
- Intent lifecycle — creating, locking, and resolving intents
- LP operations — accepting deposits and processing claims
- Fund coordination — creating and managing orders on Fund wrappers
- Request settlement — pulling and repaying bridge loan capital
- Position Manager integration — depositing collateral and managing leverage
- Swap operations — moving balances between intents with guardian approval
- Access control — role-based permissions for all operations
Fund — Async Protocol Adapter
Section titled “Fund — Async Protocol Adapter”Fund wrappers standardize how the Facility interacts with protocols that settle asynchronously. Each Fund implements a state machine that models the lifecycle of a subscription or redemption: creation, commitment, processing, and either unlocking (success) or recovery (failure).
The Fund also manages wrapped assets — receipt tokens (like wUSCC for Bitwise’s USCC) that ensure fund shares can only be used as collateral within Grunt-approved venues.
Request — Bridge Facilitator Settlement
Section titled “Request — Bridge Facilitator Settlement”The Request contract is the interface between the protocol and bridge facilitators. It accepts capital from bridge facilitators, issues dual tokens (PT for principal priority, YT for yield upside), and manages the drawdown and repayment cycle.
Bridge facilitators never lend directly to users. They fund a Request contract, and the Facility pulls capital from it as needed. Once the underlying strategy settles and collateral is established, the Facility repays the Request, and PT/YT holders can redeem.
Position Manager — Leverage Container
Section titled “Position Manager — Leverage Container”The Position Manager represents the leveraged position as a single ERC20 share token. It aggregates multiple borrow positions, tracks net equity across all of them, and provides deposit, withdrawal, and pro-rata exit functionality.
The Position Manager does not decide when to borrow or repay. Those decisions are made by the Facility during intent resolution. The Position Manager simply executes the supply, borrow, repay, and withdraw operations it is instructed to perform.
Borrow Position — Lending Venue Adapter
Section titled “Borrow Position — Lending Venue Adapter”Each Borrow Position is a modular adapter for a single collateralized debt position on a lending protocol (Morpho Blue is the first implementation). The Position Manager routes operations to borrow positions through ordered queues, and each position enforces its own health constraints.
TransferGuard — Compliance Layer
Section titled “TransferGuard — Compliance Layer”The TransferGuard validates every token transfer for compliance. It supports both blocklist and whitelist modes and can be attached to Position Manager shares, wrapped assets, or any other token in the system. It can also pause transfers entirely.
The End-to-End Flow
Section titled “The End-to-End Flow”Here is how a typical leveraged RWA strategy flows through the architecture:
- Deposit phase — Users deposit capital (e.g., USDC) into a Facility intent and receive ERC-6909 LP tokens
- Lock — The facilitator closes the deposit window and begins resolution
- Bridge loan — The Facility pulls bridge capital from a Request (funded by a bridge facilitator)
- Fund subscription — The Facility commits combined capital (user deposits + bridge loan) to a Fund wrapper, which forwards it to the external protocol (e.g., Bitwise)
- Settlement wait — The external protocol processes the subscription (days/weeks)
- Unlock — Once settled, the Fund wrapper mints wrapped receipt tokens (e.g., wUSCC)
- Position creation — The Facility deposits the wrapped tokens as collateral into a Position Manager, which supplies them to Borrow Positions and borrows against them
- Repayment — The borrowed funds are used to repay the bridge loan via the Request
- Resolution — The intent is resolved. LP token holders can now claim their pro-rata share of Position Manager shares
sequenceDiagram
participant U as Users
participant F as Facility (Intent)
participant Req as Request
participant Fund as Fund
participant PM as Position Manager
U->>F: 1. Deposit USDC
F-->>U: ERC-6909 LP tokens
Note over F: 2. Facilitator locks intent
F->>Req: 3. Pull bridge loan
Req-->>F: Bridge capital
F->>Fund: 4. Subscribe (deposits + bridge loan)
Note over Fund: 5. Settlement wait (days/weeks)
Fund-->>F: 6. Wrapped receipt tokens (e.g. wUSCC)
F->>PM: 7. Deposit collateral & borrow
PM-->>F: Mint PM shares (collateral − debt)
F->>Req: 8. Repay bridge loan
Note over F: 9. Intent resolved
U->>F: Claim PM shares
This diagram illustrates a simple deposit-only process. Other flows (redemptions, swaps between intents, leverage adjustments) involve different steps.
Deployment Pattern
Section titled “Deployment Pattern”All major contracts are deployed using the beacon proxy pattern. Each contract type has a factory that owns an upgradeable beacon. When a new instance is needed, the factory creates a lightweight proxy that delegates to the beacon’s current implementation.
This means:
- Deploying a new instance (a new Position Manager, a new Fund wrapper, etc.) is gas-efficient
- All instances of the same type can be upgraded simultaneously by updating the beacon
- Each instance maintains its own storage and configuration
The factories serve as both deployment infrastructure and upgrade coordination points.