Skip to main content

ScaleX DEX Smart Contracts

ScaleX DEX is built on a sophisticated smart contract architecture that enables efficient CLOB trading while maintaining decentralization and security. This guide covers all contract addresses, ABIs, and integration patterns.

Contract Architecture

The ScaleX DEX system consists of four main smart contracts working together:

ScaleXRouter

Main entry point for all user interactions and trade routing

PoolManager

Manages trading pairs and pool deployments

OrderBook

Handles order placement and matching using Red-Black Tree

BalanceManager

Manages token deposits, withdrawals, and locks

Deployed Contract Addresses

ScaleX DEX is deployed across multiple testnet environments for comprehensive testing and development:

ScaleX Devnet Contracts

ScaleXRouter Contract
PoolManager Contract
OrderBook Contract
BalanceManager Contract
Mock USDC
Mock WETH
Mock WBTC
Mock Chainlink
Mock PEPE

Base Sepolia Testnet Contracts

ScaleXRouter Contract
PoolManager Contract
OrderBook Contract
BalanceManager Contract
Mock USDC
Mock WETH
Mock WBTC
Mock Chainlink

Network Information

Contract Interfaces

ScaleXRouter Interface

The main entry point for all trading operations:

OrderBook Interface

Handles order matching and execution:

Integration Examples

Basic Trading Integration

Advanced Integration Patterns

Batch Operations

Real-time Price Monitoring

Gas Optimization

Efficient Order Management

Security Considerations

Best Practices

Testing & Development

Local Development Setup

Contract ABIs

The contract ABIs are available in the contracts repository or can be fetched from the block explorer.

Download ABIs

Get the latest contract ABIs from GitHub

API Integration

Use the REST API for easier integration

Development Notes:
  • Always test on testnet before mainnet deployment
  • Keep private keys secure and never commit them to code
  • Monitor gas prices and optimize for cost efficiency
  • Implement proper error handling for all contract interactions
Ready to build on ScaleX DEX? The smart contract architecture provides a robust foundation for creating yield-generating trading applications.