Posted Oct 31, 2025
Developed an AI trading agent for Lighter Protocol using AI models.
1
1
.env file in the root directory with the following variables:your_openrouter_api_key_here in the .env fileai_trading_agentDATABASE_URL with your actual database credentialsModels table in the database. Each model requires:name: Unique identifier for the trading agentopenRoutermodelName: The AI model name from OpenRouter (e.g., "anthropic/claude-3.5-sonnet")lighterApiKey: Your Lighter Protocol private API keyaccountIndex: Your Lighter Protocol account indexinvocationCount: Number of times the agent has been invoked (starts at 0)config/trading.config.ts if needed:API_KEY_INDEX: Set to match your Lighter Protocol API key index (default: 2)BASE_URL: Lighter Protocol API endpoint (default: mainnet)config/markets.config.ts contains supported trading pairs and market information.http://localhost:3000http://localhost:5173GET /performance - Get portfolio performance dataGET /invocations - Get recent AI model invocations and trading decisionsDATABASE_URL is correctbunx prisma generate to regenerate the Prisma clientbun init and uses Bun as the JavaScript runtime for optimal performance.