Skip to main content

BelizeX - Decentralized Exchange

BelizeX is a Uniswap V2-style automated market maker built with ink! smart contracts on BelizeChain. The contract suite is still under audit — check the GEM repository for current status.

Architecture

  • Factory Contract: Creates and manages trading pairs with deterministic addresses.
  • Pair Contract: Constant product AMM (x * y = k) with liquidity pools and a TWAP (Time-Weighted Average Price) oracle for secure price feeds.
  • Router Contract: Provides a user-friendly swap interface with multi-hop routing and slippage protection.
  • PSP22 Integration: Seamless cross-contract token transfers natively supported.

Integration

Two separate things are called BelizeX:

  • The belizex runtime pallet (index 28) is the on-chain DEX. It settles through an AssetLedger adapter in the runtime, so a pair can name DALLA, bBZD, or TourismDALLA and the correct ledger moves.
  • The dex ink! contracts (factory, pair, router) are a standalone Uniswap V2 port. They trade PSP22 tokens by contract address and have no channel into the Economy pallet.

Developers can interact with the DEX contracts through the SDK's belizex.js module, which exposes 15 methods (init plus 14 queries and transactions).