V3 Technical Docs
  • Deployed Contracts
    • Notional V3
      • Ethereum Mainnet
      • Arbitrum
  • Security
    • Audits
    • Bug Bounty
  • Currency Ids & Precision
    • Currency Ids
    • Market Indexes
    • Notional Internal Precision
  • Contract interaction guides
    • Intro
    • Trading guide
      • Deposit (Prime Lend)
      • Trade fCash (Borrow & Lend Fixed)
      • Add liquidity (Mint nTokens)
      • Withdraw liquidity (Redeem nTokens)
      • Withdraw (Prime Cash)
      • Settle Account
      • Enter Leveraged Vaults
      • Exit Leveraged Vaults
    • Accounts
    • Prime Cash Markets
    • fCash Markets
    • nTokens
    • Leveraged Vaults
    • Oracles
    • Governance parameters
  • Subgraph guides
    • Notional V3 Subgraphs
      • Fetch Notional Accounts
      • Fetch Notional's reserves
      • Fetch Notional nToken accounts
      • Fetch Historical Trades
      • Fetch an Account's P&L
      • Fetch current fCash and Prime Cash Rates
      • Fetch Historical Prime Cash & Prime Debt Exchange Rates
      • Fetch Prime Cash Market Balances
      • Fetch fCash Market Balances
      • Fetch Outstanding Debt
      • Fetch Historical nToken Exchange Rates
      • Fetch ETH Oracle Exchange Rates
      • Fetch Annual Incentive Rates
      • Fetch Interest Rate Models
      • Fetch Governance Parameters
  • Dune Dashboard
  • Notional Risk Docs
  • Notional V3 Docs
  • Notional Blog
Powered by GitBook
On this page
  • Get active fCash Markets
  • Get a market's total fCash and total Prime Cash holdings
  • Get a market's utilization
  • Get fCash rates
  1. Contract interaction guides

fCash Markets

Get active fCash Markets

We can use the getActiveMarkets method to get a list of the current active markets in a given currency:

 activeMarkets = notional.getActiveMarkets(currencyId)

Get a market's total fCash and total Prime Cash holdings

market3Months = activeMarkets[0]
market6Months = activeMarkets[1]

# Get the maturity of the 3 Month market
maturity = market3Months[1]

# Get the 3 Month market total Prime Cash balance 
primeCashBalance3MonthMarket = market3Months[3]/1e8

# Get the 3 Month market total fCash balance
fCashBalance3MonthMarket  = market3Months[2]/1e8

Get a market's utilization

An fCash market's utilization is defined as total fCash/ (total fCash + total Prime Cash in underlying):

from brownie.network.state import Chain
chain = Chain()

primeFactors = notional.getPrimeFactorsStored(currencyId, chain.time())
supplyScalar = primeFactors["factors"]["supplyScalar"]/1e18
underlyingScalar = primeFactors["factors"]["underlyingScalar"]/1e18

marketPrimeCashSupply = primeCashBalance3MonthMarket * underlyingScalar * supplyScalar
fCashMarketUtilization =  fCashBalance3MonthMarket / (fCashBalance3MonthMarket + marketPrimeCashSupply) 

Get fCash rates

# Last Implied Rate 3 Month Market
lastImpliedRate = market3Months[5] 

# Oracle Rate 3 Month Market
oracleRate = market3Months[6]

PreviousPrime Cash MarketsNextnTokens

Last updated 5 months ago