# ============================================================================== # Bourse — Environment Configuration Template # ============================================================================== # Copy this file to '.env' in the root directory before running: # $ cp .env.example .env # # This file configures the CoinMarketCap data ingest, the BSC on-chain identity # and commerce services via BNB AI Agent SDK, and the Base network x402 payment # settings. # ============================================================================== # ------------------------------------------------------------------------------ # 📈 COINMARKETCAP CONFIGURATION # ------------------------------------------------------------------------------ # X-CMC-MCP-API-KEY: CoinMarketCap Agent Hub Model Context Protocol API Key. # Used for live query processing (e.g., when calling scripts/signal.py --live). # Get your API key from the CMC Pro Developer portal: https://pro.coinmarketcap.com/ CMC_MCP_API_KEY= # X-CMC_PRO_API_KEY: CoinMarketCap Professional REST API Key. # Used to query historical data (e.g. Fear & Greed indices, historical price data) # for seeding the backtest engine (scripts/probe_cmc_history.py). # Depending on your API tier, this might be the same key as the MCP one. CMC_PRO_API_KEY= # Optional: Custom URLs to override CMC endpoints (defaults shown below) # CMC_MCP_URL=https://mcp.coinmarketcap.com/mcp # CMC_REST_URL=https://pro-api.coinmarketcap.com # ------------------------------------------------------------------------------ # ⚡ BSC NETWORK & WALLET CONFIGURATION (bnbagent-sdk) # ------------------------------------------------------------------------------ # NETWORK: Target network for ERC-8004 identity registry and ERC-8183 escrow. # Options: bsc-testnet, bsc-mainnet (Default: bsc-testnet) NETWORK=bsc-testnet # WALLET_PASSWORD: Keystore encryption password. # REQUIRED by the EVMWalletProvider in bnbagent-sdk to encrypt/decrypt the local # keystore files stored in your home directory at ~/.bnbagent/wallets/. WALLET_PASSWORD= # PRIVATE_KEY: The agent's EVM private key (formatted as a 64-char hex string starting with 0x). # Supports either 'PRIVATE_KEY' or 'AGENT_PRIVATE_KEY'. # - For server/identity.py: This key registers the Bourse ERC-8004 identity. # - For clients/buyer.py: This key escrows USDC to buy signals. # NOTE: If left blank, the bnbagent-sdk automatically generates a fresh, throwaway # wallet in ~/.bnbagent/wallets/ and registers it. # ⚠️ CAUTION: NEVER use a private key containing real mainnet assets. Use a dedicated # testnet-only developer wallet. PRIVATE_KEY=0x... # ------------------------------------------------------------------------------ # 💼 ERC-8183 SERVICE & AGENT COMMERCE (bnbagent-sdk) # ------------------------------------------------------------------------------ # ERC8183_AGENT_URL: The endpoint where the provider agent's commerce app is hosted. # Used by server/app.py to expose the signal endpoints (/negotiate, /status, /job/{id}). # Default is http://localhost:8003/erc8183 ERC8183_AGENT_URL=http://localhost:8003/erc8183 # ERC8183_SERVICE_PRICE: Minimum cost to buy a single divergence signal from Bourse. # Denominated in the payment token's base units (e.g. 18 decimals for testnet BNB/USDC). # 1000000000000000000 = 1.0 token. Jobs with budget below this price are rejected with HTTP 402. ERC8183_SERVICE_PRICE=1000000000000000000 # BOURSE_PROVIDER_ADDRESS: The on-chain agent address of the Bourse provider. # Used by clients/buyer.py to identify who is receiving the payment. # If left blank, the buyer script will auto-discover it by calling Bourse's # /status endpoint (ERC8183_AGENT_URL/status). BOURSE_PROVIDER_ADDRESS= # ------------------------------------------------------------------------------ # ⛓️ BASE NETWORK (CMC x402 / USDC pay-per-request) # ------------------------------------------------------------------------------ # BASE_RPC: Ethereum JSON-RPC URL for the Base network, used for verifying # EIP-3009 payment signatures when pulling premium CMC metrics via x402. BASE_RPC=https://mainnet.base.org # BASE_CHAIN_ID: Base network Chain ID. BASE_CHAIN_ID=8453 # ------------------------------------------------------------------------------ # 🖥️ LOCAL FASTAPI SERVER CONFIGURATION # ------------------------------------------------------------------------------ # PORT: The port the FastAPI app binds to when running server/app.py. # Default is 8003. PORT=8003