Fluid (and the multiple protocols built upon it) also demonstrates a multi-layer approach for building DeFi projects (not just lending). Fluid has a base layer, called "the liquidity layer", with admin and user components. The admin component is responsible for governance actions, setting model parameters, exchange prices, and token configurations, while the user component handles basic operations, including supply/withdraw and borrow/payback operations in protocols.
The base layer in Fluid protects critical protocol aspects: oracle prices, borrow/supply rates, final token transfers, and a very important feature - rate-limiting operations within the protocol to protect it from abrupt movements of funds.
The second protocol layer in Fluid leverages the base layer but implements its own logic, allowing Fluid to build several protocols using the same base layer. For instance, it can be a "traditional" lending protocol built using a conventional scheme (like Fluid's Lending), or a more advanced and complex protocol, like Fluid's Vault (
article), which uses concentrated liquidity, ticks, and soft liquidations. All these protocols first implement their logic to calculate target amounts, perform their own state updates, and then use the base layer to "settle" the results. The logic of these protocols can be very flexible because the base layer tracks only global supply/borrow balances and deposit/withdraw limits, while in the protocol, the same supply/borrow balance can be handled differently - for example, split into price "ticks", rebalanced across different assets, or used to implement any other logic.