NEXUS

CROSSx DEX

Technical Decentralization Architecture (en)

Overview

CROSS DEX is an AMM-based decentralized exchange that enables asset trading without centralized servers or administrative intervention. It allows users to interact directly with smart contracts to swap assets and provide liquidity.


System Components

1. User Wallet

  • Users interact directly with smart contracts via Web3 wallets like MetaMask
  • Only transactions signed with the user's private key are executed

2. Router Contract

  • Routes various functions (e.g., pair swaps, liquidity provision) to appropriate contracts
  • Contains no internal logic (stateless)

3. Market Contract

  • Creates and manages new trading pairs
  • Maintains metadata and liquidity lists for each pair

4. Pair Contract

  • Executes actual swaps for each token pair
  • Includes logic for swapping, adding/removing liquidity, and price calculations

5. Token Contracts (ERC-20)

  • Assets traded on the DEX are standard ERC-20 tokens
  • Anyone can add tokens without special permissions

Architecture Summary


Decentralization Elements

ItemDescriptionDecentralized
Transaction ExecAll functions are executed directly on smart contracts
Contract ControlMost contracts are Ownable-free or do not use ownership
Pair CreationPermissionless (createPair)
Liquidity AddingPermissionless (addLiquidity)
Price DiscoveryDetermined automatically based on liquidity ratios
Backend ServerNone. All functions operate within the EVM

Technical Design Highlights

  • Modular Interface Architecture
    → Functional separation via ICrossDex, IRouter, IMarket, IPair for scalability and maintainability

  • User-Driven Design
    → Anyone can directly interact with contracts; no operators or intermediary servers needed

  • Gas-Efficient Structure
    → Modular functions and minimized state storage reduce unnecessary gas costs


Contract Owner Privileges

Although CROSS DEX operates on a decentralized foundation, some limited administrative features are included for security, stability, and user protection. These functions are tightly scoped and cannot arbitrarily control user assets.

List of Owner Permissions

1. Pause Function

Description:
Temporarily halts all buy and sell operations on the DEX.

Purpose:
To prevent further trades in case of a critical bug, exploit, or malicious activity. Orders are not auto-cancelled or moved — users must cancel and withdraw themselves.

2. Force Cancel Order

Description:
Cancels a specific order from a specific EOA address — only allowed when the DEX is paused.

Purpose:
To remove malicious or disruptive orders (e.g., wash trades, order book spam), or help users who cannot cancel orders themselves. Cancelled funds are always returned to the original user. Cannot be misused during normal operation.

3. Rescue Mis-sent Tokens

Description:
Returns tokens mistakenly sent to the Router contract.

Purpose:
Acts as a failsafe to help users recover assets accidentally sent to contract addresses. Cannot access assets locked in orders or user wallets. Works only for balances directly transferred to Router contract.

Restricted Capabilities

CROSS DEX contracts cannot do the following:

  • Seize assets from a user's wallet
  • Redirect order funds to third parties
  • Automatically cancel or modify orders
  • Move any assets without user approval

Summary

CROSS DEX is fundamentally decentralized, but emergency permissions are:

  • Disabled during normal operations
  • Limited to narrowly defined cases
  • Always return assets to the rightful user

This design ensures a balance between decentralization, security, and real-world user protection.


Conclusion

CROSS DEX achieves complete technical decentralization through the following:

  • Fully on-chain transaction processing
  • Publicly accessible functions for all users
  • Minimal or no admin privileges for open operation
  • Serverless design with zero external dependencies

Thanks to this architecture, CROSS DEX operates as a> transparent, secure, and censorship-resistant asset trading platform> even in trustless environments.


© 2025 NEXUS Co., Ltd. All Rights Reserved.