feat: plugin new RabbiTrader
Rabbi Trader Plugin
An automated cryptocurrency trading plugin for Solana tokens with integrated trust scoring, market analysis, and Twitter notifications. Built on top of Goat, used actively with: https://x.com/rabbischlomo_ai
Features
- Automated trading on Solana blockchain
- Real-time market data analysis using DexScreener
- Trust score evaluation for tokens
- Twitter integration for trade notifications
- Safety limits and risk management
- Simulation capabilities before executing trades
- Performance tracking and trade history
- Rate limiting and cache management
Installation
npm install @ai16z/plugin-rabbi-trader
Prerequisites
The following environment variables need to be configured:
WALLET_PRIVATE_KEY: Your Solana wallet private keyWALLET_PUBLIC_KEY: Your Solana wallet public addressRPC_URL: Solana RPC endpoint (defaults to mainnet)BIRDEYE_API_KEY: API key for Birdeye data providerTWITTER_ENABLED: Enable/disable Twitter notificationsTWITTER_USERNAME: Twitter username for notificationsDEXSCREENER_WATCHLIST_ID: DexScreener watchlist identifierCOINGECKO_API_KEY: CoinGecko API key for additional market data
Usage
import createRabbiTraderPlugin from '@ai16z/plugin-rabbi-trader';
import { IAgentRuntime } from '@ai16z/eliza';
const plugin = await createRabbiTraderPlugin(
(key: string) => process.env[key],
runtime
);
// Plugin will automatically start monitoring and trading if enabled
Configuration
Safety Limits
The plugin includes built-in safety limits that can be configured:
export const SAFETY_LIMITS = {
MINIMUM_TRADE: 0.01, // Minimum SOL per trade
MAX_POSITION_SIZE: 0.1, // Maximum 10% of token liquidity
MAX_SLIPPAGE: 0.05, // Maximum 5% slippage allowed
MIN_LIQUIDITY: 1000, // Minimum $1000 liquidity required
MIN_VOLUME: 2000, // Minimum $2000 24h volume required
MIN_TRUST_SCORE: 0.4, // Minimum trust score to trade
STOP_LOSS: 0.2, // 20% stop loss trigger
TAKE_PROFIT: 0.12, // Take profit at 12% gain
TRAILING_STOP: 0.2 // 20% trailing stop from highest
};
Trading Parameters
Default trading parameters can be adjusted in the configuration:
{
CHECK_INTERVAL: 5 * 60 * 1000, // Check every 5 minutes
REENTRY_DELAY: 60 * 60 * 1000, // Wait 1 hour before re-entering
MAX_ACTIVE_POSITIONS: 5, // Maximum concurrent positions
MIN_WALLET_BALANCE: 0.05 // Keep minimum 0.05 SOL in wallet
}
API Integration
The plugin integrates with multiple APIs:
- Birdeye API: Market data and token security information
- DexScreener: Real-time trading data and market analysis
- Twitter: Trade notifications and updates
- Jupiter: Token swaps and liquidity aggregation
Error Handling
The plugin includes comprehensive error handling for common scenarios:
export const ERROR_SIGNATURES = [
{
sig: "0x13be252b",
name: "InsufficientAllowance",
description: "Token allowance too low"
},
{
sig: "0xf4d678b8",
name: "InsufficientBalance",
description: "Insufficient token balance"
},
// ... additional error signatures
];
Trade Analysis
The plugin performs detailed analysis before executing trades:
- Token security evaluation
- Market data analysis
- Trust score calculation
- Liquidity assessment
- Volume verification
- Price movement analysis
- Holder distribution review
Twitter Integration
When enabled, the plugin can post trade notifications with:
- Token information
- Trade details (buy/sell price, amount)
- Trust score and risk level
- Market metrics
- Transaction signature
- Profit/loss for sells
Caching
The plugin implements multiple caching mechanisms:
- Token analysis cache (20 minutes)
- Twitter rate limiting cache (hourly limits)
- Skip/wait cache (2 hours)
- Analysis history (24 hours)
Development
Building
npm run build
Development Mode
npm run dev
Dependencies
Key dependencies include:
@solana/web3.js: Solana blockchain interaction@ai16z/eliza: Core agent runtime@ai16z/plugin-solana: Solana integration@ai16z/plugin-trustdb: Trust score databasenode-cache: Caching functionalitybignumber.js: Precise number handling
fixing package names
SO do I need a paid Birdeye Api to use this?
Can i run without a Birdeye API?