OMNIFLUX AI
  • OMNIFLUX AI - Solana Trading Bot AI
  • Roadmap: Building the Ultimate Meme Coin Trading Platform
  • Trading Components
  • Security Components
  • Agent System
  • Swarm Intelligence
  • Agent Skills & Specialization
  • AI Integrations
  • Portfolio Optimization
  • Wallet Integrations
  • Price Feed Integrations
  • CLI Features
  • Technical Features
  • Documentation
  • Security and GitHub Preparation
  • Quick Start
  • Example: Executing a Trade on Raydium
  • Architecture Overview
  • Development Guide
  • Contributing to OMNI FLUX
  • License
  • Support
Powered by GitBook
On this page

Example: Executing a Trade on Raydium

PreviousQuick StartNextArchitecture Overview

Last updated 1 month ago

  1. Start the CLI:bash

    ./run-omniflux.sh
  2. From the Interactive Menu:

    • Select " Trading"

    • Choose "Create Trading Agent"

    • Enter agent details (e.g., name: "SOL-USDC Trader", strategy: "momentum")

    • Select "Execute Trade"

    • Choose trading pair (e.g., SOL/USDC)

    • Specify order type (market), side (buy), and quantity (1 SOL)

    • Confirm and monitor the trade

Alternatively, use the Python wrapper:python

import asyncio
from omniflux import OmniFlux

async def execute_trade():
    client = OmniFlux(host="localhost", port=8052)
    await client.connect()

    agent = await client.agents.create_agent(
        name="SOL-USDC Trader",
        agent_type="trading",
        config={"strategy": "momentum", "risk_level": "medium"}
    )

    wallet = await client.wallets.create_wallet(
        name="Trading Wallet",
        wallet_type="phantom",
        network="solana"
    )

    result = await client.trading.execute_trade(
        agent_id=agent["id"],
        wallet_id=wallet["id"],
        network="solana",
        pair="SOL/USDC",
        order_type="market",
        side="buy",
        quantity=1.0,
        dex="raydium",
        slippage=1.0
    )

    print(f"Trade executed: {result['transaction_id']}")
    await client.disconnect()

asyncio.run(execute_trade())