Contracts overview

Core

Lending Protocol - A super simple Lend and Earn protocol for users to get long term sustainable yields. The Lend Protocol within the Fluid ecosystem is a foundational component designed to facilitate lending activities with high efficiency and security. You can think of it as the 'Deposit and Earn' of Fluid. The lend protocol is your direct access into Fluid's Liquidity Layer.

Vault Protocol - An advanced and efficient borrowing protocol that provides users with high LTV and lowest liquidation penalties Vaults are a known standard mechanism for locking collateral and borrowing debt. Fluid utilizes this familiar single asset - single debt Vaults known from protocols like MakerDAO. Fluid takes vaults to next level by being the most capital efficient and optimized protocol enabling up to 95% of LTV on collateral.

Liquidity Protocol - The Liquidity Layer serves as the foundation of Fluid upon which various protocols can be built. It acts as a singular layer that consolidates liquidity across protocols built on Fluid, eliminating the need for each protocol to independently attract liquidity. This layer enables seamless interaction between various protocols while ensuring optimal capital efficiency, security, and user experience.

StETH Protocol - A groundbreaking and cost-effective solution for unwinding leveraged stETH/ETH positions. The stETH Redemption Protocol, an integral addition to the Fluid ecosystem, offers a seamless mechanism for users to directly deleverage stETH positions at a 1:1 rate with Lido, dramatically reducing costs by up to 10x compared to traditional market deleveraging. It specializes in offering leveraged stETH position holders the ability to save significantly on deleveraging costs by utilizing a short-term loan strategy.

Resolvers

Lending Resolver - Smart contract that serves as a bridge to access and interpret data from the Lending Protocol, specifically around fTokens (Fluid Tokens). It is designed to offer a variety of read-only, or "view", functions that allow users and other contracts to query information efficiently without modifying the state. Key functionalities include: auth verification, rewards and rates, fToken information retrieval, user positions. The contract is meticulously designed to ensure easy access to lending protocol data, enhancing the user experience by providing essential information required for decision-making and interaction within the Fluid ecosystem. Autogenerated docs.

Vault Resolver - The Vault Resolver contract in the Fluid ecosystem serves as a specialized intermediary for accessing and interpreting data from the Vault Protocol, particularly concerning vaults and positions managed within. It's crafted to facilitate view-only interactions, enabling users and external contracts to query comprehensive information about vaults without making any state changes. Key features of the Vault Resolver include: Vault address and ID retrieval, vault and position data access, user position management, comprehensive data aggregation, liquidity and exchange rate calculations, liquidation data rerieval nad other utility and helper functions. Autogenerated docs.

Vault Positions Resolver - The Vault Positions Resolver contract is a focused component within the Fluid DeFi ecosystem, designed to interact specifically with vault positions. It leverages the broader functionalities of the Vault Resolver and the Vault Factory to provide detailed insights into user positions within any given vault. This resolver is key for applications and services that require comprehensive information about positions for management, display, or analysis purposes. Key functionalities include: positions identification and retrieval, comprehensive position data access, aggregation of vault positions. Autogenerated docs.

Liquidity Resolver - The Fluid Liquidity Resolver provides comprehensive, read-only access to liquidity data across the platform. It interfaces directly with the Fluid Liquidity contract to retrieve and interpret a wide range of data points related to liquidity pools, user positions, and the overall health and status of the liquidity layer. Its functionalities include: protocol status, user classification and positions, token listings, rate and exchange rates configurations, user-specific liquidity data. Autogenerated docs.

Vault Liquidations Resolver - Returns all available liquidations which can be used as swaps. Can be integrated into DEX aggregators, used by liquidation bots or arbitrage finders. See the detailed docs section here for more info. Autogenerated docs.

Vault Ticks & Branches Resolver - Lists all ticks and branches for Fluid vaults. Autogenerated docs.

Revenue Resolver - Helpful to find current revenue at the Liquidity layer and also calculate historical revenue at a certain point in time. Note that the default revenue returned with getRevenue() does not include the revenue earned from Vault magnifiers. Autogenerated docs.

StETH Resolver - The StETH Resolver is a specialized contract designed to interface with the stETH (Lido's staked ETH) protocol and manage the interaction between Fluid and the stETH mechanics, particularly focusing on withdrawals and claims management. This resolver contract provides essential functionalities to facilitate the handling of stETH within the Fluid DeFi environment, enhancing the integration between Fluid's liquidity protocols and stETH's unique features. Autogenerated docs.

Architecture

"Liquidity" is at the center of Fluid. It's the core contract that holds all funds and only interats with protocols built on top of it, not end users. The first protocols built on top of it are the Lending protocol (fToken) and Vault protocol. The Lending protocol implements an easy way to supply to Liquidity via ERC4626 compliant fTokens. The Vault protocol implements a way to supply and borrow funds, a typical borrow / lending functionality based on collateral value fetched through an Oracle.

fTokens are created by the LendingFactory, Vaults are created by the VaultFactory.

View methods are located outside of the core contracts, as periphery resolver contracts.

Architecture

Table of Contents