LogoLogo
  • Introduction
  • App
    • How to
      • Connect a wallet
      • Swap
      • Approve Spending
      • Open a Long Position
      • Open a Short Position
      • Withdraw Funds
      • Add Funds
      • Close Position
      • Increase Leverage
      • Pay Off Debt
      • Deposit Liquidity
      • Withdraw Liquidity
      • Add Liquidity
    • Smart contract addresses
      • Arbitrum
      • Blast
    • FAQ
  • Protocol mechanics
    • Providing Liquidity
    • Trading
    • Marginly MAX leverage specifics
  • Protocol architecture
    • Overview
    • Pools
      • Pool variables
      • Pool parameters
      • User positions
      • User actions
      • Pool Factory API
      • Pool API
    • TWAP oracle
    • Loan pricing
    • Errors
    • Marginly SDK
  • Router
    • Router architecture
    • Adapters
      • ApeSwapAdapter
      • BalancerAdapter
      • CamelotAdapter
      • KyberSwapClassicAdapter
      • KyberSwapElasticAdapter
      • UniswapV2Adapter
      • UniswapV3Adapter
      • WooFiAdapter
  • Risk Management
    • Risk Management Overview
    • Keeper service and smart contract description
    • Keeper contract architecture
    • Liquidations and Deleveraging
    • Volatility as risk proxy
    • Insurance pool
    • Shutdown mode
  • Economics
    • Marginly economics
  • Future plans
    • Beyond Marginly v1
    • Some ideas for Marginly v2
  • Trading Contest FAQ
  • Github
  • Audit
Powered by GitBook
On this page
  1. Protocol architecture
  2. Pools

Pool variables

These are the variables and aggregates that the Marginly protocol keeps track of inside its smart-contracts

PreviousPoolsNextPool parameters

Last updated 1 year ago

Parameter
Description

Base Collateral

Sum of all ETH collateral in the system.

Quote Collateral

Sum of all USDC collateral in the system.

Base Debt

Discounted total debt in ETH.

Quote Debt

Discounted total debt in USDC.

Long leverage

This is leverage of all long positions in the protocol. Longs borrow USDC against ETH to buy more ETH.

Short leverage

This is leverage of all short positions in the protocol. Shorts borrow ETH against USDC to sell it for more USDC

Base Debt Coef

Total accrued interest from the inception. Recalculated every time any user performs any action. Tracks debt accrual in the system:

Quote Debt Coeff

Total accrued interest from the inception. Recalculated every time any user performs any action. Tracks debt accrual in the system:

Base Collateral Coef

This is the collateral coefficient for ETH liquidity. It increases every time the interest rate from ETH shorts is accrued. It also increases every time shorts are liquidated with the surplus. It may decrease when liquidated position has negative net difference.

Quote Collateral Coef

This is the mToken price for the USDC liquidity. It increases every time the interest rate from USDC shorts is accrued. It also increases every time ETH longs are liquidated with the surplus. It may decrease when liquidated position has negative net difference.

Base Deleverage Coef

Coefficient used in base collateral calculations after deleverage

Quote Deleverage Coef

Coefficient used in quote collateral calculations after deleverage

ARL(t) = ARL(t-1) * (1 + Long leverage * ir)^dt
ir = Coef * var(ETH)
ARS(t) = ARS(t-1) * (1 + Short leverage * ir)^dt
ir = Coef * var(ETH)