An open-source forex trading bot built on the Sui blockchain, powered by Pyth Network for real-time price data.
ChainForex is a pioneering open-source protocol that automates forex trading on the blockchain. By combining real-time data from Pyth with the speed and security of Sui, ChainForex empowers developers and traders to experiment with, contribute to, and build upon the future of decentralized finance in the global forex market.
- Package Name: chainforex
- Version: 1.0.0
- Author: Samuel Elias
- License: MIT
- Added Markets page with real-time Pyth Network price feeds
- Implemented professional forex trading interface
- Added mock trading functionality for testing
- Integrated automated trading bot capabilities
- Node.js (v16 or higher)
- Yarn package manager
- Sui CLI
- Git
chainforex/
├── move/ # Sui Move smart contracts
│ ├── sources/ # Contract source files
│ └── Move.toml # Move package manifest
├── frontend/ # React frontend application
│ ├── src/ # Frontend source code
│ └── package.json # Frontend dependencies
├── contracts/ # Additional contract utilities
└── docs/ # Documentation
-
Clone the repository:
git clone https://github.com/yourusername/chainforex.git cd chainforex -
Install dependencies:
yarn install
-
Build Move contracts:
yarn move:build
-
Start frontend development server:
yarn frontend:dev
yarn frontend:dev- Start frontend development serveryarn frontend:build- Build frontend for productionyarn move:build- Build Move contractsyarn move:test- Run Move contract testsyarn move:publish- Publish contracts to Sui network
Create a .env file in the frontend directory:
VITE_SUI_NETWORK=devnet
VITE_PYTH_ENDPOINT=https://xc-testnet.pyth.networkChainForex is a decentralized, open-source forex trading bot that operates entirely on-chain. It leverages real-time price data from Pyth Network and executes trades automatically using smart contracts on the Sui blockchain.
- 🔄 Automated forex trading using trend-following strategies
- 📊 Real-time price data from Pyth Network
- 📝 Smart contract execution on Sui blockchain
- 📈 Transparent on-chain trade history
- 🔓 Open-source codebase for community collaboration
- 🎨 Modern React frontend with Sui SDK integration
- Sui CLI installed
- Node.js (v16 or higher)
- Git
- Sui Wallet Browser Extension
- React 18 - UI framework
- @mysten/sui.js - Sui JavaScript SDK
- @mysten/wallet-kit - Sui Wallet integration
- Vite - Build tool and development server
- TailwindCSS - Utility-first CSS framework
- TypeScript - Type safety and better developer experience
# Clone the repository
git clone https://github.com/yourusername/chainforex.git
# Navigate to project directory
cd chainforex
# Install dependencies
npm install- Create a
.envfile in the frontend directory:
VITE_SUI_NETWORK=devnet
VITE_PYTH_ENDPOINT=your_endpoint
VITE_CONTRACT_ADDRESS=your_contract_address# Start the frontend development server
npm run dev
# Build for production
npm run buildsrc/
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
│ ├── useSui.ts # Sui SDK integration
│ ├── usePyth.ts # Pyth Network data hooks
│ └── useWallet.ts # Wallet connection hooks
├── pages/ # Page components
├── services/ # API and blockchain services
├── store/ # State management
├── types/ # TypeScript definitions
└── utils/ # Helper functions
// Example of Sui SDK usage
import { SuiClient } from "@mysten/sui.js/client";
import { TransactionBlock } from "@mysten/sui.js/transactions";
const client = new SuiClient({ url: "https://fullnode.devnet.sui.io" });
// Example transaction
const txb = new TransactionBlock();
// Add transaction logic here// Example of wallet integration
import { ConnectButton } from "@mysten/wallet-kit";
function WalletConnection() {
return (
<div>
<ConnectButton />
</div>
);
}- Trading logic implementation
- Order execution
- Position management
- Real-time forex price feeds
- Price verification and validation
- Oracle data consumption
# Run development server
npm run dev
# Type checking
npm run type-check
# Linting
npm run lint
# Testing
npm run test- ESLint configuration for React and TypeScript
- Prettier for code formatting
- Husky for pre-commit hooks
We welcome contributions from the community! Please read our Contributing Guidelines before submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
This software is in beta and should be used at your own risk. The authors take no responsibility for financial losses incurred through the use of this trading bot.
- GitHub Issues: For bug reports and feature requests
- Discord: Join our community
- Twitter: @ChainForex
Built with ❤️ by the ChainForex Team