Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
315 changes: 98 additions & 217 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,226 +1,107 @@
# AI-Powered Trading Platform
# PulseTrade: Advanced Web3 Trading Platform

Welcome to the **AI-Powered Trading Platform** repository! This platform combines cutting-edge AI capabilities, blockchain technology, and seamless integration to deliver a state-of-the-art trading experience. It is designed to empower both individual traders and trade administrators to maximize profits, manage accounts efficiently, and execute trades with real-time intelligence.
## 🚀 Project Overview

---

## Key Features

1. **AI-Driven Trading Assistance**

- Automated trade execution with real-time decision-making.
- Trade signal generation for manual approval or autonomous operation.
- Configurable AI settings for risk tolerance and trade size.
- Portfolio management with AI-based suggestions for diversification and optimization.
- Trade signal suggestions based on technical, fundamental, and sentiment analysis.
- Updates on market news and trends across stocks, forex, and crypto assets.

2. **Trade Admin Features**

- Sub-account management with virtual balances to prevent direct fund access.
- Profit-sharing mechanisms with blockchain-based smart contracts.
- Aggregated portfolio views for all managed accounts.
- AI-assisted sub-account trading and management.

3. **User Types**

- **Regular Users**: Beginner, intermediate, and pro traders leveraging AI and platform tools for trading.
- **Trade Admins**: Manage sub-accounts, use AI to optimize multiple portfolios, and earn profit shares.

4. **Blockchain Integration**

- Smart contracts for profit sharing and virtual balance management.
- Decentralized wallet connectivity with support for MetaMask and StarkNet's Argent Wallet.

5. **Rich Analytics and Reporting**

- Performance insights with charts and metrics.
- Comparative analysis of AI-driven vs. manual trades.

6. **Learning and Rewards**
- Tutorials for beginner traders as Koii tasks, rewarding users with platform tokens upon completion.
- Tokens created on Koii are used to incentivize engagement and learning.

---

## Technologies Used

### **Core Technologies**

- **Particle**: Ensures seamless interaction with blockchain networks for executing trades and smart contract functionalities.
- **iExec**: Provides decentralized computing power for AI model execution, data sharing, and secure data access through Data Protectors and Web3Mail.
- **Spectral**: Enhances risk assessment by analyzing user creditworthiness for trading decisions.
- **Citrea**: Manages complex workflows, ensuring AI and user actions are synchronized effectively.
- **Koii**: Facilitates decentralized content validation and distribution for learning modules and rewards with platform tokens.
- **StarkNet**: Offers scalable and secure Layer 2 solutions for faster blockchain interactions, supporting smart contracts for specific services like profit sharing.

### **Frontend**

- **Next.js**: For building a responsive and dynamic user interface.
- **Chart.js**: For visualizing trade data and performance metrics.
- **Tailwind CSS**: For a consistent and modern design system.

### **Backend**

- **Node.js**: Provides APIs for communication between the frontend and services.
- **Express.js**: Powers the RESTful API endpoints.
- **WebSockets**: For real-time notifications and updates.

### **AI Engine**

- **Open Source LLMs**:
- **GPT-J**: Handles natural language understanding for sentiment analysis and trade-related news. It analyzes market trends, social media sentiments, and financial news to influence trading decisions.
- **Falcon**: Focuses on technical data analysis and trade signal generation. It processes technical indicators like moving averages, RSI, and MACD to create actionable trade signals.
- **LLaMA**: Synthesizes technical, fundamental, and sentiment data to generate a final trade recommendation. This model integrates inputs from both Falcon’s technical analysis and GPT-J’s sentiment insights for holistic decision-making.
- **AI Functionality**:
- Technical analysis of trading indicators (e.g., RSI, MACD, moving averages).
- Fundamental analysis, including earnings reports and economic data.
- Sentiment analysis using news and social media trends.
- Dynamic trade signal generation tailored to user profiles (e.g., beginner, intermediate, pro).

### **Blockchain**

- **Ethereum/Polygon**: For deploying general smart contracts that handle profit sharing and virtual balances.
- **StarkNet**: Used specifically for faster, secure Layer 2 smart contracts, including those for trust agreements and trade-related services.
- **Web3.js**: Facilitates interactions between the app and blockchain networks.
- **Wallet Integration**:
- **MetaMask**: Standard wallet for Ethereum-based interactions.
- **Argent Wallet**: A StarkNet-compatible wallet for decentralized transactions, providing an additional layer of scalability and security for StarkNet-based interactions.

### **Database**

- **PostgreSQL**: For storing user data, trade history, and performance metrics.
- **Redis**: For caching frequently accessed data, such as live trade signals.

### **DevOps and Deployment**

- **Docker**: For containerizing application components.
- **Kubernetes**: For orchestrating containers in a scalable way.
- **AWS/GCP**: Cloud hosting for frontend, backend, and AI services.

---

## System Architecture

### **Workflow Overview**

1. **User Registration & Onboarding**:
- Users create accounts, configure AI settings, and link wallets (MetaMask/Argent).
2. **AI-Driven Operations**:
PulseTrade is a cutting-edge web3 trading platform that leverages blockchain technology, AI-powered insights, and multi-chain support to provide a comprehensive trading experience. The application offers advanced trading capabilities, AI-assisted chat, and decentralized finance (DeFi) features.

- AI analyzes market data and generates trade signals.
- Signals are sent to users for approval or executed autonomously.
### Key Features
- 🔒 Secure Web3 Authentication (Particle Network)
- 💱 Multi-Chain Trading Support (Ethereum, StarkNet)
- 🤖 AI-Powered Trading Chat Assistant
- 📊 Real-time Trading Execution
- 🛡️ Data Protection and Web3 Mail Integration
- 📈 Proprietary Trading Firm Simulation

3. **Trade Execution**:

- Trades initiated by AI or users are executed via integrated APIs and reflected on the platform dashboard.

4. **Profit Sharing**:

- Smart contracts ensure automatic profit distribution between trade admins and sub-accounts.
- Virtual balances are updated after each trade.

5. **Analytics & Reporting**:

- Users view performance metrics, trade history, and profit/loss reports.
- Admins monitor sub-account activities and overall portfolio performance.

6. **Learning and Rewards**:
- Tutorials on Koii educate beginners about trading strategies.
- Completing tasks rewards users with platform tokens.

### **Integration Overview**

| Component | Technology | Functionality |
| -------------- | ------------------------------------------------- | ---------------------------------------------------------- |
| **Frontend** | Next.js, Chart.js | User interface, dashboards, and data visualization. |
| **Backend** | Node.js, Express | API management, user authentication, and trade sync logic. |
| **AI Engine** | GPT-J, Falcon, LLaMA | Multi-LLM collaboration for trade insights and decisions. |
| **Blockchain** | Solidity, Web3.js | Smart contracts for profit sharing and virtual balances. |
| **Database** | PostgreSQL, Redis | Persistent and cached data storage. |
| **DevOps** | Docker, Kubernetes | Scalable deployment and container orchestration. |
| **Core Tech** | Particle, iExec, Spectral, Citrea, Koii, StarkNet | Decentralized workflows, risk assessment, and performance. |

---

---

## Smart Contracts Overview

The following table outlines the smart contracts required for the platform, their deployment platforms, and functionality:

| **Contract Name** | **Platform** | **Purpose** |
| ------------------------------ | ------------------- | --------------------------------------------------------------------------------------------- |
| User Management Contract | Ethereum (Solidity) | Manage users, roles, and wallet connections. |
| Profit-Sharing Contract | Ethereum (Solidity) | Handle profit distribution between trade admins and sub-accounts. |
| Token Contract | Ethereum (Solidity) | Manage platform tokens for rewards and transactions. |
| Reward Distribution Contract | Ethereum (Solidity) | Incentivize users for completing tasks (can merge with token contract). |
| Trade Execution Contract | Ethereum (Solidity) | Record trade details and ensure transparency. |
| Virtual Balance Contract | Ethereum (Solidity) | Manage virtual balances for trade admins and sub-accounts. |
| Data Protection Contract | iExec (Off-chain) | Store encrypted data references and enable secure communication via iExec. |
| Workflow Management Contract | StarkNet (Cairo) | Facilitates task orchestration and manages AI-driven or user-driven workflows through Citrea. |
| Wallet Compatibility Contracts | Ethereum, StarkNet | Support MetaMask and StarkNet Argent wallets for decentralized transactions. |

---

## Installation and Setup
## 🛠 Getting Started

### Prerequisites

- **Node.js** (v14+)
- **Python** (3.8+)
- **Docker**
- **MetaMask/Argent Wallet**

### Local Development

1. Clone the repository:

```bash
git clone https://github.com/yourusername/trading-platform.git
cd trading-platform
```

2. Install dependencies:

```bash
npm install
cd ai-engine && pip install -r requirements.txt
```

3. Start the services:

- **Frontend**:
```bash
npm run start
```
- **Backend**:
```bash
npm run server
```
- **AI Engine**:
```bash
cd ai-engine && uvicorn main:app --reload
```

4. Configure MT5 API and Blockchain network:

- Update `.env` with API keys and smart contract addresses.

5. Access the platform at `http://localhost:3000`.

---

## Contributing

We welcome contributions! Please follow the standard GitHub workflow:

1. Fork the repository.
2. Create a new feature branch.
3. Submit a pull request with detailed notes on the changes.
- Node.js (v18+)
- npm or yarn
- Web3 Wallet (MetaMask, WalletConnect compatible)

### Installation

1. Clone the repository
```bash
git clone https://github.com/patrickkish1/pulsetrade.git
cd pulsetrade
```

2. Install dependencies
```bash
npm install
```

3. Create a `.env` file with the following variables:
```
NEXT_PUBLIC_PARTICLE_APP_ID=your_particle_app_id
NEXT_PUBLIC_PARTICLE_CLIENT_KEY=your_particle_client_key
NEXT_PUBLIC_FIREBASE_CONFIG=your_firebase_config
```

4. Start the development server
```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) to view the application.

## 🚢 Deployment

### Production Build
```bash
npm run build
npm start
```

### GitHub Pages Deployment
```bash
npm run deploy
```

## 📂 Project Structure
```
src/
├── app/ # Next.js application routes
├── components/ # Reusable React components
├── lib/ # Utility functions and services
│ ├── hooks/ # Custom React hooks
│ └── services/ # External service integrations
└── styles/ # Global styles
```

## 🧩 Technologies Used
- **Frontend**: React, Next.js 14
- **Styling**: Tailwind CSS
- **Web3 Libraries**: ethers.js, viem, starknet.js
- **Authentication**: Particle Network
- **State Management**: React Hooks
- **Blockchain**: Ethereum, StarkNet
- **Backend Services**: Firebase

## ✨ Feature Highlights
- Particle Network Web3 Authentication
- AI-Powered Trading Assistant
- Cross-Chain Trading Capabilities
- Real-time Market Data Integration
- Secure Data Protection Mechanisms
- Proprietary Trading Firm Simulation

## 🔧 Configuration
- Configurable through `.env` file
- Supports multiple blockchain networks
- Customizable UI with Tailwind CSS
- Extensible trading strategies

## 📄 License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## 🤝 Contributing
Contributions are welcome! Please check out our contribution guidelines.

## 📧 Contact
Patrick Kish - [GitHub Profile](https://github.com/patrickkish1)

---

## License

This project is licensed under the MIT License. See the LICENSE file for details.
**Disclaimer**: Trading cryptocurrencies involves financial risk. Use this platform responsibly.