← Protocols
Fluid
Swap / DEX·Ethereum · Arbitrum · Base · Polygon

Fluid

01Description

Instadapp's unified DeFi protocol. A single shared Liquidity Layer powers Lending (ERC-4626 fTokens), Vaults (single-collateral / single-debt with up to 95% LTV), and Fluid DEX, which uses Smart Collateral and Smart Debt — the *same* assets simultaneously serve as borrow collateral AND DEX liquidity, drastically improving capital efficiency.

02Best for
  • 01high-LTV borrowing (up to 95%)
  • 02Smart Collateral / Smart Debt LPing
  • 03ERC-4626 yield deposits via fTokens
  • 04stablepair and LST-LST trading
  • 05leveraged-LP and looping strategies
03Install
  • pnpm add viem wagmi
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_ETH_RPC_URLClientEthereum mainnet (or target chain) RPC URL used to query the Fluid Liquidity layer, Vaults, and DEX pools.
05Prompt snippet
Use Fluid for lending, borrowing, and DEX swaps backed by the shared Liquidity Layer. For lending, deposit into an ERC-4626 fToken (e.g. `fUSDC`) via `deposit(assets, receiver)` — yield comes from utilization in the Liquidity Layer. For borrowing, open a Vault position via `VaultT1.operate(nftId, newCol, newDebt, debtTo, colFrom)` which mints/updates an ERC-721 position; the same call adjusts collateral and debt atomically. For DEX, the `DexT1` (or vault-paired `DexT2/T3/T4`) pools use `Smart Collateral` and `Smart Debt` — collateral and debt assets in the lending layer also quote prices for swaps. Read pool reserves via `IFluidDexT1.getPricesAndExchangePrices()` and route through the Fluid `DexResolver`. Liquidations are atomic and run via the `LiquidationResolver`.
06Gotchas
  • Smart Debt swaps change the borrower's debt composition mid-position — depositors aren't affected, but vault users must understand that swaps against their pool can rotate which token they owe; oracle drift can flip a healthy position into liquidation range.
  • Up-to-95% LTV is gross — liquidation penalties (typically 0.1%-1%) are extremely tight on Fluid by design, so even a small adverse price move can trigger atomic liquidation; never sit at max LTV.
  • The shared Liquidity Layer means risk is shared across products — a bug or bad debt in one Vault or DEX pool can affect fToken redemption (in extreme cases utilization spikes block withdrawal).
  • Vault positions are ERC-721 NFTs; transferring the NFT transfers the entire collateral+debt position, including any unclaimed rewards — clear them before transferring.
  • DexT2/T3/T4 variants pair the DEX directly with a vault — depositing into these pools simultaneously LPs and opens a borrow position; APR display includes borrow cost which can flip net-negative.
  • Oracle dependency: Vaults rely on Chainlink and on-chain DEX TWAPs; on chains with thin Chainlink coverage (e.g. some L2s), Fluid uses bespoke oracle adapters — verify which oracle a market uses before depositing.
07Alternatives