Skip to main content
Skip to main content

Modular Infrastructure

Orvex is built on v4 tech. That matters because v4 is designed around modular infrastructure: keep the core exchange logic lean and reliable, then extend behaviour through modules over time.

In plain terms, Orvex can ship new functionality without rebuilding the whole exchange every time.

What "modular" means in Orvex

Orvex is structured around:

  • Immutable Core: the base logic that handles swaps and liquidity math. Once deployed, the core remains unchanged and reliable.
  • Hooks (Modules): pluggable components that extend pool behavior without requiring liquidity migration (examples include routing logic, fee logic, incentives, and liquidity management tooling).
  • Separation: core stays stable; modules evolve without creating a new product every upgrade.
  • Consistency: integrations and user flows stay familiar as Orvex expands.

Technical Architecture

Singleton/PoolManager Pattern

All pools in Orvex operate under a unified manager rather than individual pool contracts. This design:

  • Enables efficient pool creation through state updates instead of deploying new contracts
  • Streamlines multi-hop routing by keeping all pool state in one place
  • Reduces gas costs for complex trading routes

Flash Accounting System

Orvex uses a flash accounting system that optimizes multi-hop trades:

  • Settles net balances at the end of routing paths
  • Eliminates redundant token transfers between consecutive swaps
  • Significantly reduces transaction costs for complex trades

Internal Accounting (ERC-6909)

The protocol implements an ERC-6909-style accounting system for internal token tracking:

  • Lightweight multi-token balance tracking
  • Lower gas consumption for frequent interactions
  • Efficient handling of multiple token positions

Hooks: Extending Core Functionality

Hooks are external contracts that can intercept and extend pool behavior at key action points:

  • Initialization: Custom pool setup logic
  • Liquidity modifications: Add/remove liquidity with custom behavior
  • Swaps: Pre and post-swap logic (custom fees, price validation, etc.)
  • Donations: Handle liquidity donations

This enables:

  • Custom fee structures and dynamic pricing
  • Incentive mechanisms and rewards distribution
  • Automated rebalancing logic
  • Alternative AMM curve designs
  • All without modifying the core protocol

Native Token Support

Where supported by the blockchain, Orvex can settle trades directly in native assets (e.g., ETH on Ethereum), reducing transfer overhead and gas costs.

Why this is useful

Traders

  • A consistent swap experience as new features are introduced.
  • Better execution where routing and liquidity depth support it.

Liquidity providers

  • Clear liquidity mechanics and positions.
  • Strategy tooling where supported, without extra steps for basic liquidity provision.

Integrators

  • A predictable base to build on (quoting, routing, and positions).
  • New capabilities can be added without breaking existing integrations.

Security and upgrades

A modular design helps reduce risk by keeping critical logic isolated:

  • Immutable Core: The core swap and liquidity math cannot be changed once deployed, providing a stable foundation
  • Independent Hook Audits: Each hook module can be audited separately without affecting the core protocol
  • Separation of Concerns: Critical execution logic is isolated from extensibility features

Where upgrades or parameter changes are possible, they follow a defined process with transparency, including documentation of what can be changed, by who, and under what conditions.

Benefits of V4 Architecture

The V4-based modular architecture provides concrete improvements:

  • Gas Efficiency: Flash accounting and singleton design reduce transaction costs by 20-50% on complex routes
  • Extensibility: New features ship without migrating liquidity or breaking integrations
  • Composability: Hooks enable custom pool types while maintaining a unified liquidity layer
  • Reliability: Immutable core ensures critical functionality remains stable and predictable