Skip to content

0xMayurrr/Ontrade-Chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 OnTrade Chain – AI-Powered On-Chain Trading Automation Platform

OnTrade Chain is a visual, n8n-style workflow builder for creating automated crypto trading strategies. Users build strategies using drag-and-drop nodes (price, indicators, sentiment, AI decision, buy/sell actions), and an AI agent executes them automatically on-chain.

This platform combines no-code automation, AI reasoning (ASI), decentralized execution, and smart contract logging, allowing anyone to create, deploy, and share automated trading logic.

🌟 Key Features

🔹 Visual Workflow Builder (n8n-style)

Create trading strategies visually using modular nodes:

  • Market Data Node (Price, RSI, Moving Averages)
  • Indicator Node
  • AI Reason Node (Buy / Sell / Hold)
  • Condition Node (If/Else)
  • Action Node (Buy, Sell, Swap)
  • Delay / Cooldown
  • Notify Node
  • Logging Node

🔹 AI-Powered Trading Agent

Uses ASI (ASI1.ai) to:

  • Understand natural-language strategies
  • Convert text into structured JSON workflows
  • Analyze market data
  • Generate signals
  • Build orders
  • Execute trades

🔹 On-Chain Strategy Registry

Every strategy is stored on-chain using:

  • createStrategy(flowHash)
  • toggleStrategy(id, state)
  • logExecution(id, message)

Ensures transparency, immutability, and user ownership.

🔹 Strategy Marketplace

Users can:

  • Publish strategies
  • Sell strategies
  • Clone workflows
  • Browse trending or profitable flows
  • View strategy performance

🔹 24/7 Automated Execution

The backend agent:

  • Fetches market data
  • Evaluates strategy conditions
  • Calls AI Reason Node
  • Executes trades on-chain
  • Logs execution
  • Runs continuously

🧠 Example Workflow

[Fetch Market Data]
        ↓
[Analyze Indicators (RSI, MA)]
        ↓
[AI Reason Node → BUY]
        ↓
[Build Order Payload]
        ↓
[Execute Trade]
        ↓
[Log Execution On-Chain]

🔧 Tech Stack

Frontend

  • Next.js / React
  • Tailwind CSS
  • React Flow
  • WalletConnect / MetaMask
  • Zustand / Redux

Backend

  • Node.js
  • Express / Fastify
  • Cron agents
  • ASI API integration
  • Binance / Market Data APIs

Smart Contracts

  • Solidity
  • Hardhat
  • StrategyRegistry.sol
  • Ethers.js

AI Integration

  • ASI API (asi1.ai)
  • Natural-language → Strategy JSON parser
  • AI Reasoning Core

📦 Folder Structure

/frontend
/backend
/smart-contracts
   /contracts
      StrategyRegistry.sol
   /scripts
/database
/agents

🔐 Smart Contract (StrategyRegistry) Summary

Stores:

  • Strategy owner
  • Flow hash
  • Active state
  • Execution logs

Provides:

  • createStrategy()
  • toggleStrategy()
  • logExecution()

⚙️ Setup Instructions

1️⃣ Clone the repo

git clone https://github.com/Mayurgit03/Ontrade-Chain.git

2️⃣ Install dependencies

Frontend:

cd frontend
npm install
npm run dev

Backend:

cd backend
npm install
npm run dev

Contracts:

cd smart-contracts
npm install
npx hardhat compile

3️⃣ Deploy contract

npx hardhat run scripts/deploy.js --network sepolia

4️⃣ Add environment variables

RPC_URL=
PRIVATE_KEY=
REGISTRY_ADDRESS=
ASI_API_KEY=

🌍 Marketplace Features

  • Upload strategy JSON
  • Auto-generate flow preview
  • Sell strategy for price
  • Clone strategies
  • Download template
  • Author-based listings
  • Performance overview

🛠️ Future Enhancements

  • Backtesting engine
  • Copy trading with revenue sharing
  • Multi-chain support
  • DeFi protocol integrations
  • AI-optimized strategies
  • Mobile version
  • Strategy NFTs

🤝 Contributing

Pull requests are welcome! Please open an issue to discuss any major changes before submitting PRs.

📜 License

MIT License


Built with ❤️ by the OnTrade Team

About

We are building an n8n-style workflow builder for automated crypto trading. Users create strategies using visual blocks like price triggers, indicators, sentiment checks, and AI reasoning. Once deployed, an AI agent monitors market conditions and executes the strategy automatically on-chain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors