LogoLogo
  • JuliaOS Documentation Hub
  • About JuliaOS
    • Mission & Vision
    • Features and Capabilities
    • Roadmap
    • Tokenomics
  • Ecosystem
    • Overview
  • Partners
    • Heurist
    • Fetch.ai
    • Soulgraph
    • cheqd.io
    • Aethir
    • Anyone
    • TensorLabs
    • Hashpower
  • Technology
    • Overview
    • Open Source
      • Modular Framework
      • CLI Mode
    • AI Platform
      • Dashboard
      • Agent Management
      • Swarm Management
      • Marketplace
      • Mining
    • LLM
    • Launchpad
    • Robotics & IOT
      • SwarmIOT
      • Modular AI with Robotics
        • J3OS MiniLLM
          • 🔧 Use Cases
  • Technical
    • Overview
    • Developer Hub
      • Getting Started
        • Installation Guide
          • Github Guide
        • Basic Concepts
        • Quick Start Guide
          • Handling secrets
        • Examples and Use
          • Example: Using the Trading Functionality
          • Example: Using the Benchmarking Feature
          • Example: Multi-Agent Swarm Coordination
          • Example: Using the Python Wrapper for LLM Integration
          • Example: Using Cross-Chain Bridges
          • Example: Creating and Running a Swarm Optimization
          • Page 4
      • Best Practices
        • Performance Tuning
        • Agent/Swarm Design Patterns
        • Best Practices & Patterns
        • Security Best Practices
      • CLI
        • JuliaOS CLI Interface
        • Agent Management (CLI)
        • CLI Configuration
        • Cross-Chain Hub (CLI)
        • Swarm Management (CLI)
        • CLI Troubleshooting
        • Wallet Management (CLI)
      • Framework SDK
        • Modules
          • Bridge
          • Agents Module
          • Dex
          • Swarms Module
          • Wallet
        • Python Wrapper
          • LangChain Integration
          • Python Wrapper
      • Contributing Guide
      • Extending JuliaOS
      • Development Setup & Conventions
      • Testing & Debugging
      • Troubleshooting
    • Architecture
      • High Level JuliaOS
      • CLI <-> Backend Communication
      • Data Storage Architecture
      • Framework Internals
      • Architecture Deep Dive
        • Architectual Notes
    • Concepts
      • Core Features & Concepts
      • Agents
        • Agent Skills & Specializations
      • Swarms
      • Neural Networks
      • Blockchains & Chains
      • Bridges (Cross-Chain)
      • Integrations
        • Google ADK
        • LLMs
        • Price Feed
        • DEX Integration
      • Storage
      • Trading Capabilities
      • Use Cases
      • Wallets
      • Portfolio Optimization
  • Research
    • JuliaOS Research
  • API Documentation
    • API Reference
      • API Reference: Julia Backend Commands
      • API Reference: CLI Commands
      • API Reference: Node.js API
      • API Reference: Python API
      • API Reference
  • Community
    • Community & Support
  • FAQ
    • General
    • Technical
    • Community
Powered by GitBook
On this page
  • DEX Integration
  • Concept
  • Functionality in JuliaOS (DEX.jl)
  • Supported DEXes
  • Using DEX Features
Export as PDF
  1. Technical
  2. Developer Hub
  3. Framework SDK
  4. Modules

Dex

// This is a duplicate of features/dex.md. Please keep only one copy in the future.

DEX Integration

JuliaOS provides functionality for interacting with Decentralized Exchanges (DEXes) to enable automated trading strategies for agents and swarms.

Concept

DEXes allow users to trade cryptocurrency assets directly on the blockchain without relying on a centralized intermediary. They typically use Automated Market Maker (AMM) models based on liquidity pools.

Functionality in JuliaOS (DEX.jl)

The core DEX logic resides in the Julia backend module /julia/src/DEX.jl. Its main capabilities include:

  • Listing Supported DEXes: Identifying which DEXes are configured for specific chains (e.g., Uniswap V3 on Ethereum, Raydium on Solana).

  • Getting Swap Quotes: Calculating the expected output amount for a potential swap, considering available liquidity and fees. This is partially implemented for Uniswap V3 (using on-chain calls) but mocked for others like 1inch and Jupiter (which would require API integration).

  • Encoding Swap Data: Generating the correct calldata needed to execute a swap transaction on a specific DEX contract (partially implemented for Uniswap V3 exactInputSingle).

  • Preparing Unsigned Transactions: Combining the quote, encoded data, nonce, gas estimates, etc., into a complete, unsigned transaction object. This is the primary output of the execute_swap function.

Important: The DEX.jl module prepares swap transactions but does not sign or send them. Signing is handled client-side (see Wallets and Architecture Overview).

Supported DEXes

Configuration exists for DEXes including:

  • EVM: Uniswap V3, Sushiswap, Curve, Balancer, 1inch, PancakeSwap, QuickSwap, Trader Joe, SpookySwap, etc.

  • Solana: Raydium, Orca, Saber, Jupiter (aggregator).

(Note: While configured, quote and execution logic might only be fully implemented for a subset, like Uniswap V3).

Using DEX Features

Direct interaction with DEX.jl is usually done internally via the Bridge.jl module.

  • Agents/Swarms: Trigger trades based on their logic.

  • Bridge (execute_trade): Calls DEX.execute_swap to get the unsigned transaction.

  • Client (JS/Python/CLI): Receives the unsigned transaction, gets user signature via WalletManager/Wallet, and sends the signed transaction back via Bridge.submit_signed_transaction.

See:

  • Swap Execution Flow in DEX API

  • Bridge API (Backend)

PreviousAgents ModuleNextSwarms Module