Divergence Protocol
  • OVERVIEW
    • Divergence Protocol
    • Protocol Basics
      • Digital Options
      • Triangular Swaps
      • Convertible Liquidity
      • Options Specs
      • Fees
      • Glossary
      • References
  • User Guide
    • 📈Long Options
      • 🔥Open Longs
      • 🌊Close Longs
      • 👨‍🌾Exercise Options
    • 📉Short Options
      • 💧Open Shorts
      • 🔚Finalize Shorts
      • 📥Close Shorts
      • ⏰Expiry Withdrawal
    • 🍸Dive Bar
  • Technical Reference
    • Smart Contract Architecture
      • Deployment addresses
    • Core
      • Arena
      • Battle
      • Oracle
      • Utils
      • SToken
      • Interface
      • Libraries
        • DiverSqrtPriceMath
        • Position
        • Tick
        • TickMath
        • TradeMath
      • Params
      • Types
    • Periphery
      • Manager
      • Base
      • Interface
      • Quoter
      • Libraries
      • Params
      • Types
    • Audit Reports
  • DIVER Token
    • 🌝Tokenomics
      • Token Distribution
    • 🎃DIVΞR NFT Collections
  • Legal
    • Terms of Service
    • Risk Disclosure
  • MISC. INFO
    • 🔗Official Links
    • 🙌Media Kit
    • 🚢Ditanic Test Coins
Powered by GitBook
On this page
  • get
  • update

Was this helpful?

  1. Technical Reference
  2. Core
  3. Libraries

Position

Manages and updates the position information

get

Retrieves the position information for the given owner and tick range

function get(mapping(bytes32 => PositionInfo) storage self, address owner, int24 tickLower, int24 tickUpper) internal view returns (PositionInfo storage position)

Params:

Name

Type

Description

self

mapping(bytes32 => PositionInfo)

Storage mapping for position information

owner

address

The owner of the position

tickLower

int24

The lower tick of the position range

tickUpper

int24

The upper tick of the position range

Returns:

Name

Type

Description

position

PositionInfo

update

Updates the position information based on the liquidity delta and growth information

function update(PositionInfo storage self, int128 liquidityDelta, GrowthX128 memory insideLast) internal

Params:

Name

Type

Description

self

PositionInfo

liquidityDelta

int128

The change in pool liquidity for the position

insideLast

GrowthX128

PreviousDiverSqrtPriceMathNextTick

Last updated 1 year ago

Was this helpful?

The info struct of the given position. See

The info struct of the given position. See

The info struct per unit of liquidity inside the tick range, as of the last update

Types
Types
GrowthX128