LogoLogo
  • Introduction
    • Pearl Exchange
    • Strategic Partnership
    • Team
    • re.al Network Details
    • Protocol Guides and Videos
      • How to Add Liquidity
      • How to Lock PEARL and Vote on Pools
      • How to Use Caviar
  • Tokenomics
    • Ecosystem Tokens
    • Initial Supply and Distribution
    • Emissions Schedule
  • DEX Operations
    • Supported Tokens
    • Concentrated Liquidity
      • Providing Liquidity to Pools
      • Active Liquidity Management
        • 🔱 Trident by Pearl
        • ICHI
      • Swaps and Range Orders
      • Rewards
    • Stable Swap (SS) Pools
    • Pool Voting & Incentives
    • Technical
      • Swaps
      • Smart Contracts
      • Technical Reference
    • Contract Addresses
      • Contract Addresses v1.5
      • Contract Addresses v1
  • CAVIAR
    • Introduction
    • Overview and Glossary
    • Using Caviar
    • sCVR and csCVR
    • Fees and Formulas
    • Ecosystem Support
    • Contracts, Addresses and Security
  • The Pearl Flywheel
    • Protocol Incentives
    • The DEX Death Spiral
    • The Pearl Flywheel
  • Protocol Details
    • Security & Audits
    • Governance
    • Official Links
Powered by GitBook
On this page
  • Pool Deployment Action:
  • Position Management
  • Overview
  • Contracts Global State
  1. DEX Operations
  2. Technical

Smart Contracts

PreviousSwapsNextTechnical Reference

Last updated 1 year ago

New to Pearl V2:

  • Pool Deployer: Gives a very simple and easy way to deploy new pools with a single high-level function call.

  • Factory.sol: Low level api to deploy new pools with configurable options.

  • NonfungibleTokenPositionDescriptor.sol: Manages ****detail for URI (Unique Resource Identifier) which represents all the information attached to an NFT.

  • NonfungiblePositionManager.sol

    1. Adding, removing, and modifying liquidity positions in any V2 pool.

    2. Representing those liquidity positions as NFTs

  • SwapRouter: Serves as an on-chain interface point for swaps. Pass a token or series of tokens, to swap between, and it will handle the low-level swap calls and funds transfer to make it all happen.

  • Quoter.sol: Get token quotes from the pool

Pool Deployment Action:

Position Management

Overview

Contracts Global State

  • The reason for a signed integer int instead of an uint is that negative power represents prices less than 1 but greater than 0.

  • 24 bits can cover the range between 1.0001 ^ (2²³ — 1) and 1.0001 ^ -(2)²³. Even Google cannot calculate such numbers, so allow me to offer smaller values to have a rough idea of the whole price range:

    1.0001 ^ (2¹⁸) = 242,214,459,604.341

    1.0001 ^ -(2¹⁷) = 0.000002031888943