Pawnfi Docs
  • Pawnfi Document Hub
  • USER GUIDE
    • Pawnfi Guide Book
  • GETTING STARTED
    • Understanding Pawnfi
      • Pawnfi Modules
        • Key Vehicle: P-Token
        • Flash Trade
        • NFT Leverage
        • Consignment
        • Cross-Margin Lending Market
        • NFT Marketplace
      • Interest Bearing Token (iToken)
      • P-Token List
      • P-Token Collections
  • RISK
    • Risk Framework
      • Lending Market Asset Risk
        • From Risks to Risk Parameters
        • Risk Parameters
      • Lending Market Liquidity Risk
        • Utilization
        • Interest Rate Model
        • Protocol Math
      • Liquidation
    • Price Oracle
  • PAWN TOKEN
    • Understanding $PAWN
    • Incentive Policies
      • Borrow Distribution (Passive Liquidity Incentives)
      • Liquidity Mining (Active Liquidity Incentives)
      • Platform Fee Distribution (Safety Incentives)
    • Voting Power
      • Pawnfi SAFE
      • Boosting your $PAWN Rewards
      • Gauge Voting
      • Gauge Weight
      • Safety Incentives Mechanism
  • Event
    • Mega Drop
    • Liquidity Boosting
  • Ape Staking
    • Introduction
    • Glossary
    • $APE Staking
    • NFT Staking
    • Risk Management
    • FAQ
  • GOVERNANCE (BETA)
    • Understanding Governance
    • PIP
    • Snapshot
  • APPENDIX
    • Glossary
    • Audits
  • LINKS
    • Website
    • Discord
    • Twitter
    • Medium
    • Telegram
    • Github
Powered by GitBook
On this page
  • Calculating Accrued Interest
  • Calculating the front-end APY Using Rate Per Block

Was this helpful?

  1. RISK
  2. Risk Framework
  3. Lending Market Liquidity Risk

Protocol Math

Calculating Accrued Interest

Interest rates for each market update on any block in which the ratio of borrowed assets to supplied assets in the market has changed. The amount interest rates are changed depends on the interest rate model smart contract implemented for the market, and the amount of change in the ratio of borrowed assets to supplied assets in the market.

Here is an example of borrow interest accrual:

Alice borrows 1 ETH from Panwfi Lending Market. At the time of borrow, the borrow interest is 0.000000000037893605 ETH per block. No one interacts with the iEther contract for 3 Ethereum blocks. On the subsequent 4th block, Bob borrows some ETH. Alice’s underlying balance is now 1.000000000151574420 ETH (which is 0.000000000037893605 times 4 blocks, plus the original 1 ETH). Alice’s underlying ETH balance in subsequent blocks will have interest accrued based on the new value of 1.000000000151574420 ETH instead of the initial 1 ETH. Note that the borrow rate per block value may change at any time.

That is, the interest will only be compounded whenever there is an interaction with each market. If there is no interaction with the market (let's say USDT), the supply and borrow APY for USDT will be calculated as simple interest.

Calculating the front-end APY Using Rate Per Block

The Annual Percentage Yield (APY) for supplying or borrowing displaying in each market can be calculated using the value of supply or borrow APY in smart contract with this formula:

Rate = APY; // rate in smart contract
Blocks Per Year = 2102400
Blocks Per Day = 6570 (13.5 seconds per block)
Days Per Year = 365

APY = ((((Rate / Blocks Per Year * Blocks Per Day + 1) ^ Days Per Year)) - 1) * 100

PreviousInterest Rate ModelNextLiquidation

Last updated 2 years ago

Was this helpful?