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

User positions

User positions inside Marginly have following parameters:

Parameter
Description

Base amount

User’s ETH collateral: Total user ETH = Base amount * Base Collateral Coef

or

User’s discounted ETH debt: Total base debt = Base amount * Accrued rate

Quote amount

User’s USDC collateral: Total user USDC = Quote amount * Quote Collateral Coef

or

User’s discounted USDC debt: Total quote debt = Quote amount * Accrued rate

Type

Type of position:

  • Uninitialized (by default)

  • Lend (quote amount and base amount as collateral)

  • Short (quote amount - as collateral, base amount - as debt)

  • Long (quote amount - as debt, base amount - as collateral)

Heap position

Index of position in leverage heap (short or long).

By default, 0 (meaning the id doesn’t exist in any leverage heaps). Otherwise, the index of the heap equals heap position minus 1.

PreviousPool parametersNextUser actions

Last updated 1 year ago