Particle LAMM Dev Handbook
  • Introduction
  • Logic
    • Overview
    • Open Long
    • Close Long
    • Open Short
    • Close Short
  • Developer
    • Liquidity Provision
    • Open Position
    • Close Position
    • Liquidate Position
    • Long/Short Symmetry
    • Trading Fees
    • Premium Accounting
    • Reclaim Liquidity
Powered by GitBook
On this page
  1. Developer

Open Position

  • Function: openPosition

  • The function implements the borrowing steps plainly: determine required collateral (Base.prepareLeverage), borrow liquidity (decreaseLiquidity and collectLiquidity), pay for fees (get feeAmount), swap (Base.swap), bookkeep (create a new Lien.Info).

  • Storage: minimally required information of a position is stored in liens, which maps [address, lienId] into Lien.Info.

PreviousLiquidity ProvisionNextClose Position

Last updated 1 year ago