Concrete Documentation

website·Indexed 33 days ago

https://docs.concrete.xyz/Overview/welcome

Documentation for the Concrete protocol, featuring yield vaults based on the ERC-4626 standard, the Concrete Earn V2 SDK, and borrowing and protection services. Includes technical guides on vault architecture, SDK read/write methods, event references, and institutional vaulting.

Tokens
26.3K
Snippets
86
Records
159
Agent score
64%

What's inside Concrete

  1. Overview of Concrete Borrow

    Concrete Borrow is a decentralized lending and borrowing feature that integrates with multiple DeFi money markets (including Aave, Compound, Silo, and Radiant) to provide users with optimized borrowing rates and unified loan management. Key features include collateral management via Concrete Vaults, gas cost subsidies, and 90-day historical interest rate tracking.
  2. Concrete Earn V2 System Architecture Overview

    Concrete Earn V2 uses a modular architecture to separate custody and accounting from yield generation. The system consists of four primary layers:

    1. The Factory: Deploys vaults and manages upgrade paths.
    2. Vaults: ERC-4626 single-asset contracts that handle user deposits, share minting/burning, custody, and access control. Vaults do not seek yield themselves but delegate it to strategies.
    3. Strategies: Adapters bound to a single vault that route capital into yield venues (e.g., lending markets, looping positions, or custodied venues).
    4. Hooks: Optional modules that execute logic before and after user operations to gate behavior.
  3. Implement getApyDetails in Vanilla, React, and Wagmi

    The getApyDetails() method is compatible across different integration styles. It is often used in conjunction with vault.getUnderlyingPrice() to provide a complete financial overview of the vault.
    // --- Vanilla (viem) ---
    import { getVault } from "@concrete-xyz/sdk";
    import { createPublicClient, http } from "viem";
    import { mainnet } from "viem/chains";
    
    const publicClient = createPublicClient({
      chain: mainnet,
      transport: http("https://ethereum-rpc.publicnode.com"),
    });
    const vault = getVault("v2", "0xE2d8267D285a7ae1eDf48498fF044241d04e9608", 1, publicClient);
    
    const apy = await vault.getApyDetails();
    if (apy.expectedApy != null) {
      console.log(`Live APY: ${(Number(apy.expectedApy) * 100).toFixed(2)}%`);
    }
    
    // --- Wagmi with useVaultQuery ---
    import { useVault, useVaultQuery } from "@concrete-xyz/sdk/wagmi";
    
    const vaultConfig = { version: "v2", address: "0xE2d8267D285a7ae1eDf48498fF044241d04e9608", chainId: 1 } as const;
    
    export function ApyPanel() {
      const vault = useVault(vaultConfig);
      const q = useVaultQuery({
        vault: vaultConfig,
        queryKey: ["apy"],
        enabled: !!vault,
        queryFn: async (v) => {
          const [apy, price] = await Promise.all([v.getApyDetails(), v.getUnderlyingPrice()]);
          return { apy, price: price.price };
        },
        staleTime: 60_000,
      });
    
      if (q.isLoading) return <div>Loading...</div>;
      const { apy, price } = q.data!;
      return <div>APY: {(Number(apy.apy) * 100).toFixed(2)}%</div>;
    }
  4. Understand and use Live Vaults on Concrete

    Live Vaults are active vaults available through the Concrete platform that provide access to specific on-chain strategies, asset types, or market opportunities. When evaluating Live Vaults in the Earn app, users should compare key attributes including APY (Annual Percentage Yield), TVL (Total Value Locked), exposure, and any existing withdrawal queues.
  5. Use Pre-Deposit Vaults for new chain or strategy funding

    Pre-Deposit Vaults are time-limited deposit opportunities used to provide initial funding for a new chain or a tokenized strategy. Upon completion, these vaults will either return a newly issued token to the user or allow the user to redeem their deposited capital on a new chain.
  6. Use AssetCX to earn yield on assets in qualified custody

    AssetCX allows assets held in qualified custody (QC) to be leveraged for DeFi yield opportunities via Concrete vaults without the underlying assets leaving the custodial environment. Concrete mints AssetCX tokens at a 1:1 ratio against the custody balance and deposits them into a vault. Users receive vault shares (following the ERC-4626 standard) as receipts for their deposit and accrued yield. Yield increases the vault's total assets and exchange rate, while losses reduce the reported total assets and lower the exchange rate proportionally for all holders.
  7. Understand Concrete Protect mechanics and credit injection

    Concrete Protect is a liquidation prevention service that proactively monitors LTV ratios. When a position approaches a critical risk threshold, the system automatically injects a credit line into the loan to lower the LTV and prevent liquidation.

    Key architectural features include:

    • Tranche-Based Structure: Users purchase credit tranches in advance. These activate sequentially as needed, providing layered buffers against volatility.
    • 30-Day Policy Cycle: Protection is sold in 30-day terms. Users can renew or modify coverage at the end of the cycle.
    • Automated Management: The protocol continuously tracks real-time asset pricing and triggers injections without user intervention, notifying the user via the dashboard or external channels (Telegram/Discord).
  8. Understand the Concrete Oversight and Verification Layer

    The Oversight and Verification Layer operates above the vault and strategy layers to provide independent monitoring and security. It includes 24/7 monitoring of vault addresses via Blockaid, automatic safeguards that activate upon detection of unexpected activity, and regular asset verification where vault values are cross-checked by multiple independent sources.
  9. Retrieve comprehensive vault metadata using getVaultDetails()

    The getVaultDetails() method returns a VaultDetails object containing metadata about the vault and its underlying ERC20 token, including version, address, pause status, symbol details, deposit/withdrawal limits, and network information.

    Note: The underlying object in the returned VaultDetails only provides metadata. To get a full ERC20 instance for the underlying token, use await vault.getUnderlyingErc20().

    // Signature: getVaultDetails(): Promise<VaultDetails>
    
    const details = await vault.getVaultDetails();
    console.log(details.symbolDetails.symbol);   // e.g., "ctBeraLBTC"
    console.log(details.vaultAsset.symbol);      // e.g., "ctLBTC"
    console.log(details.underlying.symbol);      // e.g., "LBTC"
  10. Understand Concrete Borrow (Lite) protection

    Concrete Borrow (Lite) is the default borrowing solution in the Concrete ecosystem. It provides a streamlined experience with built-in protection against traditional liquidation penalties through 'Concrete Lite'.

    Key features include:

    • Early Foreclosure: When the Loan-to-Value (LTV) ratio approaches the liquidation threshold, Concrete Lite triggers an early foreclosure to avoid traditional liquidation.
    • Reduced Fees: Early foreclosure incurs a 3.5% fee, which is lower than typical market liquidation penalties (5%-15%).
    • Cost: There is no activation fee; Concrete Borrow (Lite) is active by default.
    • Gas Subsidy: Borrowers receive partial gas fee coverage when taking out loans.
  11. Use the Concrete SDK

    The Concrete SDK provides typed methods for developers to read vault state and submit deposits, withdrawals, and approvals.
  12. Earn Bags through the Concrete Social Campaign

    To earn Bags via the social campaign powered by Fuul, follow these steps:

    1. Connect Accounts: Connect your wallet and link required social accounts to ensure activity is tracked.
    2. Complete Quests: Perform eligible social and community actions. Examples include:
      • Following Concrete on X (@ConcreteXYZ).
      • Joining the Concrete Discord.
      • Writing blog articles about Concrete (refer to the Discord rubric for the 'Article of the Week' campaign).

    If a quest is marked as Locked, you must complete the prerequisite action first to unlock it.