Maverick Docs
  • Introducing Maverick
  • Getting Started
    • 🖥️The Maverick V2 UI
    • 👛Connect a Wallet
    • ⛓️Choose a Network
    • 🪙Approving Tokens
  • Guides
    • 🤝Traders
      • How to Make a Swap
    • 💰Liquidity Providers
      • Understanding Liquidity Provision
      • Understanding Modes
      • How to Add Liquidity
      • How to Deploy a New Pool
      • How to Check Position Balances
      • How to Manage Liquidity in a Pool
      • How to Migrate from V1 to V2
      • Understanding Permanent Loss
      • Liquidity Strategies
    • ⚡Incentives
      • Understanding Boosted Positions
      • Understanding Incentives
      • How to Join a Boosted Position
      • How to Create a Boosted Position
      • How to Manage a Boosted Position
      • How to Add Incentives
    • 🎡veFlywheel
      • veFlywheel Basics
      • Guide to veFlywheel Emissions
      • How to Vote to Direct Emissions
    • 👩‍🏫Advanced Tutorials
      • Single-Sided Incentives
  • Technical Reference
    • Contract Addresses
      • V1 Contract Addresses
      • V2 Contract Addresses
    • Maverick V1
      • V1 Whitepaper
      • V1 Contracts
        • Router
        • Pool
        • Factory
        • SlimRouter
    • Maverick V2
      • V2 Whitepaper
      • V2 Contracts
        • Maverick V2 Common Contracts
          • base
            • IMulticall
            • IPayableMulticall
            • Multicall
            • PayableMulticall
          • interfaces
            • IMaverickV2AddLiquidityCallback
            • IMaverickV2Factory
            • IMaverickV2FactoryAdmin
            • IMaverickV2FlashLoanCallback
            • IMaverickV2Pool
            • IMaverickV2PoolAdmin
            • IMaverickV2SwapCallback
          • libraries
            • ArrayOperations
            • Constants
            • Math
            • PoolLib
            • TickMath
            • TransferLib
        • Maverick V2 AMM Contracts
          • poollib
            • Bin
            • Delta
            • Deployer
            • DeployerPermissioned
            • SwapMath
            • Twa
          • MaverickV2Factory
          • MaverickV2Pool
          • MaverickV2PoolPermissioned
        • Maverick V2 Reward Contracts
          • interfaces
            • IMaverickV2IncentiveMatcher
            • IMaverickV2IncentiveMatcherFactory
            • IMaverickV2Reward
            • IMaverickV2RewardFactory
            • IMaverickV2RewardRouter
            • IMaverickV2RewardVault
            • IMaverickV2VotingEscrowBase
            • IMaverickV2VotingEscrow
            • IMaverickV2VotingEscrowFactory
            • IMaverickV2VotingEscrowLens
            • IMaverickV2VotingEscrowWSync
          • libraries
            • IncentiveMatcherDeployer
            • RewardDeployer
            • VotingEscrowDeployer
            • VotingEscrowWSyncDeployer
          • rewardbase
            • IRewardAccounting
            • RewardAccounting
          • votingescrowbase
            • HistoricalBalance
            • IHistoricalBalance
            • ILegacyVeMav
            • VotingEscrow
          • MaverickV2IncentiveMatcher
          • MaverickV2IncentiveMatcherFactory
          • MaverickV2Reward
          • MaverickV2RewardFactory
          • MaverickV2RewardRouter
          • MaverickV2RewardVault
          • MaverickV2VotingEscrow
          • MaverickV2VotingEscrowFactory
          • MaverickV2VotingEscrowLens
          • MaverickV2VotingEscrowWSync
        • Maverick V2 Supplemental Contracts
          • base
            • Checks
            • IChecks
            • IMigrateBins
            • MigrateBins
          • boostedpositionbase
            • BoostedPositionBase
            • IBoostedPositionBase
            • ImmutableArrayGetter
          • interfaces
            • IMaverickV2BoostedPosition
            • IMaverickV2BoostedPositionFactory
            • IMaverickV2LiquidityManager
            • IMaverickV2PoolLens
            • IMaverickV2Position
            • IMaverickV2Quoter
            • IMaverickV2Router
            • IPositionImage
          • libraries
            • BoostedPositionDeployerDynamic
            • BoostedPositionDeployerStatic
            • BytesLib
            • LiquidityUtilities
            • PackLib
            • Path
            • PoolInspection
          • liquiditybase
            • ArgPacker
            • IArgPacker
          • paymentbase
            • IERC20PermitAllowed
            • IPayment
            • ISelfPermit
            • IState
            • IWETH9
            • Payment
            • SelfPermit
            • State
          • positionbase
            • INft
            • Nft
          • routerbase
            • CallbackOperations
            • ExactOutputSlim
            • ICallbackOperations
            • IExactOutputSlim
            • IPushOperations
            • IRouterErrors
            • PushOperations
          • MaverickV2BoostedPositionDynamic
          • MaverickV2BoostedPositionFactory
          • MaverickV2BoostedPositionStatic
          • MaverickV2LiquidityManager
          • MaverickV2PoolLens
          • MaverickV2Position
          • MaverickV2Quoter
          • MaverickV2Router
          • PositionImage
      • V2 API Documentation
      • V2 Testnet Guide
        • Get Sepolia ETH & Test Tokens
        • How to Create a Boosted Position in V2
        • How to Add & Match Incentives
        • How to Create a veFlywheel
    • Development FAQ
    • Finding LP Balances
  • MAV token
    • MAV Token & Tokenomics
    • veMAV & MAV Staking
    • How to Stake MAV
    • Syncing V1 veMAV
    • Airdrop Information
      • Maverick Ecosystem Rewards Pre-Season Airdrop
      • Maverick Governance & S1 Airdrops
  • Further Information
    • Frequently Asked Questions
    • Glossary
    • Security
    • Maverick Wallets
    • Dune Analytics
    • Rebasing Tokens
    • Restricted Territories
    • Delphi Digital Report
Powered by GitBook
On this page
  • 1. LP positions in a Pool
  • 2. LP balances in Boosted Positions (unstaked)
  • 3. LP balances in Boosted Positions (staked)
  1. Technical Reference

Finding LP Balances

This page explains how to make contract calls to discover the token reserves held by Maverick LPs.

PreviousDevelopment FAQNextMAV Token & Tokenomics

Last updated 1 year ago

Developers may find they need to track the token reserves of Maverick LPs. A Maverick LP can hold tokens in Maverick in three ways:

  1. They can hold a position in a pool

  2. They can hold a balance in a Boosted Position (BP)

  3. They can hold a balance in a BP and have staked it in a rewards contract

This document explains how to track LP reserves held in all three ways. A developer wishing to track all the reserves of a particular token held by LPs would need to make calls across all pools and BPs that contain that token in order to achieve full coverage.

1. LP positions in a Pool

In order to find the token reserves held by an LP in a pool, you can use the Maverick PositionInspector contract and call addressBinReservesAllKindsAllTokenIds.

This call requires the pool address and the LP’s wallet address, and will return the balances of tokenA and tokenB. The call can be made on any block, so you can look up historical as well as current data for each LP.

The PositionInspector contract is available on all chains; please see for all contract addresses.

2. LP balances in Boosted Positions (unstaked)

LPs in BPs receive an ERC-20 LP token, which can be left unstaked or staked into the BP’s rewards contract. To find an LP’s unstaked BP balance:

  1. call balanceOf on the BP’s contract using the LP’s wallet address, which will output the amount of LP tokens held by the LP

  2. call totalSupply on the BP’s contract to find the LP’s pro-rata ownership of the BP (i.e., use the amount from step 1 to calculate the LP’s percentage ownership of the total supply)

  3. call getReserves on the BP’s contract to find the total reserves held by the BP

The LP’s percentage ownership can then be used to calculate their share of the BP’s reserves.

3. LP balances in Boosted Positions (staked)

Most LPs will have staked their BP LP tokens into the BP’s rewards contracts. The rewards contract basically functions as another pro-rata owner of the BP. To find the total balance held by the rewards contract:

  1. call balanceOf on the BP’s contract using the BP’s rewards contract address, which will output the amount of LP tokens held by the BP

  2. call totalSupply on the BP’s contract to find the rewards contract’s percentage ownership of the BP (i.e., use the amount from step 1 to calculate the rewards contract’s percentage ownership of the total supply)

  3. call getReserves to find the total reserves held by the BP

The rewards contract’s percentage ownership can then be used to calculate the contract’s share of the BP’s reserves. Using this amount, you can then calculate the individual LP’s staked BP reserves:

  1. call balanceOf on the BP rewards contract using the LP’s wallet address, which will output the amount of staked LP tokens owned by the LP

  2. call totalSupply on the BP rewards contract to find the LP’s percentage share of the staked LP tokens (i.e., use the amount from step 1 to calculate the LP’s percentage ownership of the total supply)

The LP’s percentage ownership can then be used to calculate how much of the rewards contract’s reserves belong to the LP.

this page