Gyroscope Protocol
HomeApp
  • tldr: What is Gyroscope
  • Audit Reports
  • POOLS
    • Overview
    • 2-CLPs
    • 3-CLPs
    • E-CLPs
    • Dynamic CLPs
    • Rehype CLPs
    • Technical documents
  • Governance
    • Overview
    • How it works
      • Voting Vaults
        • The Founding Member Vault
        • Councillor Vault
        • Associated DAO Vault
        • GYD LP Vault
        • GYFI Vault
      • Action Tiering
      • On-chain proposals
      • Vote delegation
      • Conditional cashflows
      • GYD Recovery Module
      • Optimistic Approval
        • Emergency Recovery
        • Limiting Upgradeability
    • Governance process
    • GYFI Tokenomics
      • Token Allocation
      • Release schedules
      • Eligibility
  • GYD
    • Overview
    • How it works
      • Reserve design
      • Autonomous pricing
        • Dynamic Stability Mechanism
        • GYD Trading Pools
        • Economic intuition
      • Reserve Safety Checks
      • Complementary stability mechanisms
      • Oracles & price feeds
        • Consolidated price feed
        • LP share pricing
      • Risks
      • DSM error codes
      • Protocol fees
    • sGYD
      • Yield Emission Process
      • Security
      • Audit Report
      • Code Repositories
      • Contract Addresses
      • Supported Venues
      • sGYD Internals
      • Risks
    • Technical Documents
  • Deployed Contracts
    • Contract addresses
      • Bridged GYD
      • GYFI
      • Pools
      • GYD Core
      • Governance
        • L1 Governance
        • L2 Governance
      • Gyro Proto
      • Consolidated price feed
  • Official channels
  • FAQ
    • Coinmarketcap
    • Is there info on the Gamified Testnet?
    • Is there a Gyroscope whitepaper?
    • How is Gyroscope different?
    • Why is it called Gyroscope?
    • How scalable is Gyroscope?
    • What are use cases of Gyroscope?
    • Gyroscope & Academia
    • Classical FAQ
    • Coingecko
  • Press kit
  • Learn more
  • Licensing
Powered by GitBook
On this page
  • Example: Constant Product Pools
  • Pricing LP tokens for 2-CLPs, 3-CLPs, and E-CLPs

Was this helpful?

  1. GYD
  2. How it works
  3. Oracles & price feeds

LP share pricing

Methodology and implementation of pricing LP share tokens

PreviousConsolidated price feedNextRisks

Last updated 10 months ago

Was this helpful?

To price LP tokens, it is not enough to simply add the values of all assets in the pool as this is easily manipulated. Instead, a more robust procedure is required to calculate LP token values.

The precise instructions on how to calculate LP shares of the 2-CLP, 3-CLP, or E-CLP are available in section 5 of this technical paper.

Example: Constant Product Pools

This example demonstrates the principles of robust LP share pricing applied to constant product pools.

For a given constant product Balancer pool containing assets 1, ..., n, define the following:

wi=weight of asset iri=amount (in # tokens) of asset ipi=price of asset iS=total # LP tokensw_i = \text{weight of asset } i \\ r_i = \text{amount (in \# tokens) of asset } i \\ p_i = \text{price of asset } i \\ S = \text{total \# LP tokens} wi​=weight of asset iri​=amount (in # tokens) of asset ipi​=price of asset iS=total # LP tokens

The constant product invariant of the pool is

L=∏i=1nriwiL = \prod_{i=1}^{n} r_i^{w_i}L=i=1∏n​riwi​​

Note that the amounts rir_iri​are easily manipulatable through swaps, but the product LLLis not. And, as we require asset pricing oracles elsewhere, we can presume that the prices pip_ipi​ are also not easily manipulatable (controls to assure against this will be discussed elsewhere).

To calculate a manipulation-resistant LP token price, it will be enough to express the pricing of LP tokens solely in terms of manipulation-resistant variables wi,pi,L/Sw_i, p_i, L / Swi​,pi​,L/S. Note that while LLL and SSS are individually manipulatable by adding or removing liquidity, L/SL/SL/S is not easily manipulatable as long as proper accounting methods are in place for handling adding and removing of liquidity (see Section 5.5 in the technical paper for more details).

The portfolio value of the entire pool can be calculated as

Pool value=L∏i=1n(piwi)wi\text{Pool value} = L \prod_{i=1}^n \left( \frac{p_i}{w_i} \right)^{w_i}Pool value=Li=1∏n​(wi​pi​​)wi​

In turn, the LP token price can be calculated in terms of manipulation-resistant variables as

Pricing LP tokens for 2-CLPs, 3-CLPs, and E-CLPs

LP share pricing for the CLPs follows the same general principles and is described in full detail in Section 5 of the following technical paper.

pLP token=Pool valueS=LS∏i=1n(piwi)wip_{\text{LP token}} = \frac{\text{Pool value}}{S} = \frac{L}{S} \prod_{i=1}^n \left( \frac{p_i}{w_i} \right)^{w_i}pLP token​=SPool value​=SL​i=1∏n​(wi​pi​​)wi​
technical-papers/Design of the Consolidated Price Feed and Circuit Breaker System.pdf at main · gyrostable/technical-papersGitHub
Logo