10000 GitHub - ionera-c/solana-trading-bot1: Solana Trading Bot / sol-trading-service - do copy trading
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ionera-c/solana-trading-bot1

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Solana Trading Bot

Overview

This repository contains the core service for copy trading on the Solana blockchain. It is designed to facilitate the creation and management of copy trading strategies, allowing users to automatically replicate trades from a target wallet.

Development

πŸ”§ Prerequisite: Bun Installation

Follow these instructions to install Bun JavaScript runtime (official documentation):

# For macOS operating systems
brew install oven-sh/bun/bun

# Verify the installation by checking the version
bun --version

# Configure shell environment
# First, identify your current shell environment:
echo $SHELL

# Add the following configuration to your shell profile file (e.g., ~/.zshrc):
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"

πŸš€ Running the Service

Step 1: Configure environment

Create a .env file in the project root with the following content:

PRIVATE_KEY_BASE58=<private_key_base58>  # Your private key in Base58 format

Step 2: Start the service

Use the solRpcWsSubscribeManager in the main function to subscribe to the target account:

./scripts/run-sol-trade-dev.sh

# or

# set NOT_USE_CLI to false in the env
bun run ./src/cli.ts -k <private_key_base58>

πŸ“¦ Building for Production

Build the project for production deployment:

./scripts/build-sol-trade.sh

πŸ–₯️ Using the CLI Interface

The service comes with an interactive CLI for managing copy trading strategies.

Step 1: Build the CLI

Ensure you have built the project for production as described above. The CLI is located in the dist directory.

Step 2: Run the CLI

The CLI is built using Bun and is located in the dist directory. To run the CLI, you need to have the Bun runtime installed.

You can run the CLI directly from the dist directory:

./dist/sol-trade -k <private_key_base58>

Available Features

The CLI provides the following functionality:

  1. View Service Status - Check the WebSocket connection status and active strategies
  2. List Active Strategies - View all configured copy trading strategies
  3. Create Buy Strategy - Set up a new strategy to copy buy trades from a target wallet
  4. Create Sell Strategy - Set up a new strategy to copy sell trades from a target wallet
  5. Remove Strategy - Delete an existing strategy
  6. Exit - Gracefully shut down the service

Example Workflows

Creating a Buy Strategy:

  1. Select "Create buy strategy" from the main menu
  2. Enter the target wallet address to copy trades from
  3. Provide a name for your strategy
  4. Enter the amount of SOL to use for trades (in lamports)
  5. Set your desired slippage tolerance in basis points (e.g., 100 = 1%)

Creating a Sell Strategy:

  1. Select "Create sell strategy" from the main menu
  2. Enter the target wallet address to copy trades from
  3. Provide a name for your strategy
  4. Set the fixed selling percentage in basis points (e.g., 500 = 5%)
  5. Set your desired slippage tolerance in basis points

Managing Strategies:

  • Use "List active strategies" to view all current strategies
  • Use "Remove strategy" to delete a strategy that's no longer needed
  • Use "View service status" to check the connection and activity status

References

Jupiter Exchange Integration

The service utilizes Jupiter for transaction processing on the Solana blockchain.

Documentation

API Resources

Fee and Priority Optimization

Transaction Fee Management

Compute Budget Optimization

Jito Tips and Advanced Configuration

Additional Resources

Bun Runtime Integration

About

Solana Trading Bot / sol-trading-service - do copy trading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.9%
  • Shell 0.1%
0