{
  "id": 6888915,
  "title": "5 Errors I Hit Building DeFi Bots (And How to Fix Them)",
  "url": "https://urgent.news/2026/09/12/5-errors-i-hit-building-defi-bots-and-how-to-fix-them",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-12T08:00:31.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/superwavvy/5-errors-i-hit-building-defi-bots-and-how-to-fix-them-106f"
  },
  "original_language": "en",
  "account": "1. WebSockets Timeout: When using free-tier Alchemy event listeners on a WebSocket, connections can time out after 5 minutes. This happens because free-tier APIs have idle connection limits, causing the connection to drop without any error message. To fix this, switch from event listeners to polling every 15 minutes, which ensures continuous monitoring even on a free tier.\n\n2. CoinGecko Rate Limit: After a day of working with CoinGecko's free API, I encountered the 429 error (Too Many Requests) due to exceeding daily limits. CoinGecko allows only 5 requests per second, but after 50 concurrent calls per minute, they start limiting. To avoid hitting the limit, either reduce the polling frequency or limit the number of tokens being tracked. In my case, I opted to track only 2 tokens, resulting in 24 calls per day, which is well under the limit.\n\n3. Supabase Row-Level Security: After using Supabase for 2 days, I suddenly faced issues inserting data into the price_history table. The error message indicated that the new row violates the Row-Level Security policy. This occurred because Row-Level Security was enabled for the table, but the bots were trying to insert data anonymously. To resolve the issue, I either disabled RLS for the table or created a policy allowing inserts for all users. In the end, I chose to disable RLS for this hobby project.\n\n4. Termux File Creation: When trying to run a data analysis script in Termux, I received a \"Cannot find module\" error. This happened because the file creation tool used on a mobile device created the file path incorrectly, which Node.js couldn't locate. To fix this, I created the file directly in Termux using nano, verifying the file's existence and path with the ls command. This reliable method of file creation in Termux ensured that Node.js could find and execute the script.",
  "summary": "Building production bots on free APIs sounds cool in theory. In practice, you hit walls immediately. Here are the 5 real errors I encountered while building two Ethereum monitoring bots, and exactly how I fixed them. Error 1: Alchemy Event Listeners Timeout After 5 Minutes The Problem: I started monitoring Aave liquidations using ethers.js event listeners on free-tier Alchemy. provider . on (…",
  "key_points": [
    "WebSockets timeout issue resolved by switching to polling every 15 minutes",
    "CoinGecko rate limit avoided by reducing polling frequency or tokens tracked",
    "Supabase Row-Level Security issue fixed by disabling RLS or creating policy"
  ],
  "editors_take": "Developers building DeFi bots can avoid common pitfalls by adjusting their use of free-tier APIs, optimizing polling frequencies, and configuring security policies to ensure seamless execution.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}