Frax Finance ¤
English 🇰🇾
English 🇰🇾
  • Frax Ecosystem Overview
  • FXS & veFXS
    • Frax Shares (FXS)
    • veFXS
    • Gauges
    • FXS Distribution
    • FXS Smart Contract & Addresses
  • GOVERNANCE
    • Frax Governance Overview
    • How It Works
    • Advanced Concepts
    • Fraxtal Snapshot Voting
  • FRAX V1 - ORIGINAL
    • Original Design
    • Staking Contracts
    • FRAX ABI & Token Addresses
    • Frax V1 Pool ABI & Addresses
    • Core Frax Multisigs
  • FRAX V2 - Algorithmic Market Operations (AMO)
    • AMO Overview
    • AMO Minter
    • Collateral Investor
    • Curve
    • Uniswap v3
    • FRAX Lending
    • Decentralization Ratio (DR)
  • FRAX V3 - 100% CR AND MORE
    • Overview
    • Fraxtal
    • AMOs
    • RWAs
    • sFRAX
    • FXBs
    • sFRAX Token Addresses
    • sFRAX & FXB Multisigs
  • Bridging
    • Fraxferry
    • LayerZero x Stargate
    • Fraxtal Bridge
  • Frax Price Index
    • Overview (CPI Peg & Mechanics)
    • Frax Price Index Share (FPIS)
    • FPIS Distribution
    • CPI Tracker Oracle
    • FPI Controller Pool
    • veFPIS
    • FPIS Conversion / FPIS Locker
    • FPI and FPIS Token Addresses
    • FPI Multisigs
  • Fraxswap
    • Overview
    • Technical Specifications
    • Fraxswap Contract Addresses
  • Fraxlend
    • Fraxlend Overview
    • Key Concepts
    • Lending
    • Borrowing
    • Advanced Concepts
      • Position Health & Liquidations
      • Interest Rates
      • Vault Account
    • ABI & Code
    • Fraxlend Multisigs
  • Frax Ether
    • Overview
    • frxETH and sfrxETH
    • Technical Specifications
    • Redemption
    • frxETH V2
    • frxETH V2 Technical Details
    • frxETH Code & V2 Addresses
    • frxETH and sfrxETH Token Addresses
    • frxETH Multisigs
  • BAMM
    • Overview
  • Frax Oracle
    • Frax Oracle Overview
    • How It Works
    • Advanced Concepts
    • Fraxtal Merkle Proof Oracles
  • Guides & FAQ
    • FAQ
    • Staking
    • Uniswap Migration / Uniswap V3
    • Fraxswap / FPI
  • Miscellany
    • All Contract Addresses
    • Bug Bounty
    • Miscellaneous & Bot Addresses
    • API
  • Other
    • Audits
    • Media Kit / Logos
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Fraxlend
  2. Advanced Concepts

Vault Account

The Vault Account is a struct used for accounting in the Fraxlend Pair:

struct VaultAccount {
    uint128 amount;
    uint128 shares;
}

The Vault Account contains two elements:

  1. amount - represents a total amount

  2. shares - represents claims against the amount

Lending Accounting

In lending, amount represents the total amount of assets deposited and the interest accrued.

When lenders deposit assets, the amount of assets deposited increases amount, the shares value is also increased by an amount such that the ratio between amount/shares remains unchanged.

When interest is accrued, amount is increased and shares remains the same. Each lender's share of the underlying assets are measured in shares.

When lenders remove liquidity, they redeem shares for the underlying asset. The shares amount will be decreased by the number of shares redeemed, the amount will be decreased such that the ratio between amount/shares remains unchanged.

Borrow Accounting

In borrowing, amount represents the total amount of assets borrowed and the interest accrued.

When borrowers receive assets, the number of tokens received increases amount, the shares value is also increased by an amount such that the ratio between amount/shares remains unchanged.

When interest is accrued, amount is increased and shares remains the same. Each borrower's debt is measured in shares.

When borrower's repay debt, amount is decremented by the amount of assets returned, shares is decreased by an amount such that the ratio of amount/shares remain unchanged. An individual borrowers shares balance is decremented by this number of shares.

PreviousInterest RatesNextABI & Code

Last updated 7 months ago

Was this helpful?