Skip to main content

Environment Variables

All configuration is managed through environment variables in your .env file.

Quick Reference

VariableDescriptionDefaultRequired
SOLANA_RPC_URLSolana RPC endpoint URLhttps://api.mainnet-beta.solana.comYes
SOLANA_WS_URLSolana WebSocket endpoint URLwss://api.mainnet-beta.solana.comNo
PORTServer port3000No
NODE_ENVNode.js environmentproductionNo
DEX_FORK_TYPEDEX fork type identifierCustomYes
FACTORY_ADDRESSFactory program address(empty)Yes
ROUTER_ADDRESSRouter program address(empty)Yes
PROTOCOL_FEE_RATEProtocol fee rate for volume calculation0.0025 (0.25%)No
EXCLUDED_DAOSComma-separated list of DAO addresses to exclude(empty)No

Solana Configuration

SOLANA_RPC_URL
string
default:"https://api.mainnet-beta.solana.com"
required
The Solana RPC endpoint URL for fetching blockchain data.Recommendations:
  • Use a dedicated RPC provider (e.g., Helius, QuickNode) for production
  • Public endpoints may be rate-limited
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_WS_URL
string
default:"wss://api.mainnet-beta.solana.com"
The Solana WebSocket endpoint URL for real-time updates.
SOLANA_WS_URL=wss://api.mainnet-beta.solana.com

Server Configuration

PORT
number
default:"3000"
The port on which the API server will listen.
PORT=3000
NODE_ENV
string
default:"production"
The Node.js environment. Options: development, production, test
NODE_ENV=production

DEX Configuration

DEX_FORK_TYPE
string
default:"Custom"
required
The DEX fork type identifier for CoinGecko compatibility.Supported Types:
  • Custom (recommended for Futarchy)
  • Uniswap V2, Uniswap V3, Uniswap V4
  • Raydium, Raydium CLMM
  • Orca
  • See full list
DEX_FORK_TYPE=Custom
FACTORY_ADDRESS
string
required
The factory program address that creates and manages DAO instances.
This must be a valid Solana program ID (PublicKey)
FACTORY_ADDRESS=YOUR_FACTORY_PROGRAM_ID
ROUTER_ADDRESS
string
required
The router program address for executing swaps.
ROUTER_ADDRESS=YOUR_ROUTER_PROGRAM_ID

Protocol Configuration

PROTOCOL_FEE_RATE
number
default:"0.0025"
The protocol fee rate used for volume calculation. Default is 0.0025 (0.25%).Formula: volume = protocolFees / feeRate
PROTOCOL_FEE_RATE=0.0025
EXCLUDED_DAOS
string
Comma-separated list of DAO addresses to exclude from the API responses.
EXCLUDED_DAOS=DAO1_PUBLIC_KEY,DAO2_PUBLIC_KEY,DAO3_PUBLIC_KEY

Supported DEX Forks

The following DEX fork types are supported for CoinGecko compatibility:
  • Uniswap V2, V3, V4
  • Raydium
  • Raydium CLMM
  • Orca
  • Balancer V2, V3
  • Curve
  • Algebra
  • Algebra Integral
  • Camelot V3
  • Cetus
  • Iziswap
  • Kyberswap
  • Kyberswap Elastic
  • Quickswap V3
  • Maverick V2
  • Solidly V2, V3
  • Traderjoe V2
  • Velocore V2
  • Ston.fi, Ston.fi V2
  • Surge Protocol
  • Dedust
  • Ekubo
  • Jediswap
  • And more…

Example Configuration

Here’s a complete example .env file:
# Solana Configuration
SOLANA_RPC_URL=https://rpc.helius.xyz/?api-key=YOUR_API_KEY
SOLANA_WS_URL=wss://rpc.helius.xyz/?api-key=YOUR_API_KEY

# Server Configuration
PORT=3000
NODE_ENV=production

# DEX Configuration
DEX_FORK_TYPE=Custom
FACTORY_ADDRESS=FACTgvmECoA8e8Y4h3cKfQcr45Rthxsix92YUJz1DiBk
ROUTER_ADDRESS=RouTSKvxjyPNWvDCQkBq3cDPZcqEW3ZQRzDCJvxTBhQ

# Protocol Configuration
PROTOCOL_FEE_RATE=0.0025

# Optional: Exclude specific DAOs
EXCLUDED_DAOS=11111111111111111111111111111111

Validation

The API validates all configuration on startup and will log warnings or errors for invalid settings.
On startup, check the logs for:
  • ✅ RPC connection successful
  • ✅ Factory address valid
  • ✅ Router address valid
  • ⚠️ Any configuration warnings

Production Recommendations

Use Premium RPC

Premium RPC providers offer higher rate limits and better reliability

Set Appropriate Fees

Ensure PROTOCOL_FEE_RATE matches your actual protocol fees

Monitor Performance

Use health check endpoint to monitor API status

Secure Your Endpoints

Consider adding authentication for production deployments