Skip to main content

Architecture

Bidask mainnet is a completely unique protocol, designed and optimized for maximum blockchain loads and sharding efficiency. The architecture consists of five core contracts: Pool Factory, Pool, Vault, Range, and LP-Multitoken.

Pool Factory

The Pool Factory contract:

Pool

The Pool contract:

  • Stores general liquidity information for token pairs.
  • Holds assets locked as liquidity.
  • Tracks the active bin and asset amounts.
  • Links user requests to the relevant Range contracts.
  • Supports multiple pools per token pair (differentiated by bin step, LP fee, and pool index), including duplicates.

Vault

The Vault contract:

  • Manages intermediate liquidity deposit data for two-sided positions.
  • Stores referral fee information from swap transactions.
  • Acts as temporary storage during complex liquidity operations.

Range

The Range contract:

  • Manages price range segments (groups of bins).
  • Stores liquidity distribution data within bins.
  • Handles core protocol operations:
    • Liquidity deposits and removals
    • Swap executions
    • Limit order management
  • Contains the mathematical logic for price calculations and position management.

LP-Multitoken

The LP-Multitoken contract:

  • Tracks user liquidity positions as Soulbound Tokens (SBTs).
  • Mirrors price segments managed by Range contracts.
  • Provides non-transferable ownership proof of liquidity positions.
  • Enables position management through token-bound operations.