Developer Documentation
  • Welcome!
  • User Documentation
  • How To
    • Lend and Borrow fCash
      • Batch Trades
      • Wrapped fCash
      • OTC Trading (ERC1155)
    • Mint and Redeem nTokens
    • Manage Account Assets
    • Liquidations
      • Monitor Account Risk
    • Leveraged Vaults
      • Vault Concepts
      • User Journeys
      • Designing a Vault
      • Building a Vault
      • Vault Configuration
  • Off Chain
    • Typescript SDK Reference
      • Risk Metrics
    • Subgraph Reference
  • On Chain
    • Notional ABI Reference
      • Account Methods
      • Trade Helpers
      • nToken View Methods
    • Notional Governance Reference
Powered by GitBook
On this page
  • Off Chain
  • Key Concepts
  • Examples
  • On Chain
  1. How To
  2. Liquidations

Monitor Account Risk

Ways to monitor account risk on chain and off chain.

PreviousLiquidationsNextLeveraged Vaults

Last updated 2 years ago

Off Chain

Monitoring risks off chain can be done using the which is used in the Notional Web Application to calculate user risk factors. Off Chain metrics are more expressive and give a more detailed picture of account risk compared to on chain metrics (where it only shows whether or not an account can be liquidated).

Key Concepts

  • Risk Adjusted Value: collateral (assets) and debts in Notional can have various adjustments applied to their valuations depending on the types of risk they face.

    • Haircuts: are adjustments applied to positively valued assets (i.e. collateral)

      • Exchange Rate Haircut: a percentage based discount to the value of collateral as it is converted to ETH denomination

      • fCash Haircut: an increase of the oracle interest rate (reduces the present value of fCash) applied to positive fCash

      • nToken Haircut: a percentage based discount to the value of nToken holdings

      • Liquidity Token Haircut: a percentage based discount to the claims on cash and fCash for liquidity token holdings (NOTE: liquidity token holdings are currently disabled in Notional V2).

    • Buffers: are adjustments applied to negatively valued debts

      • Exchange Rate Buffer: a percentage based increase to the value of debt as it is converted to ETH denomination

      • fCash Buffer: a decrease in the oracle interest rate (increases the present value of fCash debt)

  • Net Underlying Available: collateral held against debt within the same currency is applied prior to Exchange Rate buffers and haircuts. This figure is termed the net underlying available, it is the positive or negative amount of value that will be converted into ETH for the aggregate free collateral value.

  • Free Collateral: is a measure of the total amount of collateral an account has in excess of their debts. Calculated as the aggregate of the net underlying available figures converted to ETH with exchange rate haircuts and buffers applied.

  • Risk Ratios: ratios of collateral (assets) to debts are useful metrics for determining the relative health of an account.

  • Risk Thresholds: are useful for approximations of price levels where an account is eligible for liquidation.

Examples

TODO: write example of how to do this in the SDK

// Initialize Notional
// Load Account
// Call methods on Account:
//  - getFreeCollateral()
//  - loanToValueRatio()
//  - collateralRatio()
//  - bufferedCollateralRatio()
//  - getLiquidationPrice()
//  - calculateInterestRateRisk()

On Chain

Liquidations use Free Collateral to determine whether or not an account can be liquidated. Free Collateral is an absolute number but does not give a sense of the ratio of debts to assets.

TODO: example of how to calculate the collateral ratio using FC view

function getFreeCollateralView(
  address account
) external view returns (int256, int256[] memory);

All risk related methods are documented in .

Notional Typescript SDK
Risk Metrics