{"slug": "my-ai-agent-built-a-crypto-loan-bot-that-pays-my-friends-in-bitcoin-its-best-is", "title": "My AI Agent Built a Crypto Loan Bot That Pays My Friends in Bitcoin. Its Best Feature Is Knowing When to Stop.", "summary": "A developer built fluid-bot, a TypeScript agent that manages a leveraged lending position on the Fluid protocol on Base, borrowing USDC against ETH or cbBTC collateral and ratcheting back to a 70% loan-to-value target when collateral rises 1%. The bot includes a Guardian that recomputes loan risk every block and acts in tiers (warn, deleverage, emergency, blocked), and a friend-request desk that borrows within safe limits to pay friends in bitcoin, cbBTC or USDC. It ships with 44 unit tests, defaults to dry-run unless passed --live, and approves only exact token amounts.", "body_md": "*Previously: [My AI Agent Reads Handwritten Timesheets. It Gets the Receipts 100% Right and the Names 14% Right.](https://blakelapierre.substack.com/p/my-ai-agent-reads-handwritten-timesheets), how my Odoo bot runs the business side.*\n\nIn [post 4](https://blakelapierre.substack.com/p/i-gave-an-ai-agent-one-job-find-free) I introduced “money making” as my scout: every hour it looks for new ways to earn and only reports what’s new. That’s still its day job. But over the last few weeks it picked up a much stranger side project, and it’s the most interesting thing any of my agents has built.\n\nThis post covers three things: the scout, the gig accounts it watches, and the loan bot.\n\n## Part 1: The scout that mostly says nothing\n\nThe hourly scan has written **454 reports** so far. Each one checks Doctor of Credit, the AI-training gig boards (OpenTrain and Terac) and a few others, compares against a log of everything already reported, and messages me only when something new fits.\n\nMost hours, the answer is “nothing new.” A typical skip from this morning: an 80,000–90,000 point credit card bonus, passed over because it needs a spending requirement that doesn’t fit roughly $50 of working capital. A Chipotle costume deal got skipped too: “That’s a discount, not income.”\n\nOnce a day it writes a summary ranked by value for effort, no-money-down options first, and re-checks every link before sending. Today’s top picks were AI-training contracts on OpenTrain in the $30–70/hr and $45–90/hr ranges, plus paid interviews on Terac.\n\n## Part 2: The gig accounts, and the real number\n\nI asked it to monitor my Mercor and OpenTrain accounts. It can’t sign in for me, so it handed me its screen to log in, then set up regular checks. Its status file reads like a ledger:\n\n- **Mercor:** 5 applications submitted Oct 16, all still “Submitted.” One more came back “Not selected,” with no reason given.\n- **OpenTrain:** profile live, 0 proposals, no messages.\n- **Earnings:****$0.**\n\nThat’s the real number, and the agent writes it down every check instead of rounding it into “promising.”\n\n## Part 3: The loan bot\n\nHere’s the strange side project. The agent built **fluid-bot**, a TypeScript bot that manages a leveraged position on Fluid, a lending protocol on the Base network. ETH or cbBTC (Coinbase’s wrapped bitcoin) goes in as collateral, and USDC is borrowed against it.\n\nThe strategy is a ratchet. When collateral rises 1% or more, the bot borrows back up to a 70% loan-to-value target, swaps most of it into more collateral, and keeps a share as USDC to sweep out. Every swap is quoted across several exchanges, re-quoted right before sending, and aborted if the price is more than 1.5% worse than Fluid’s own oracle.\n\nIt started tiny on purpose. The README’s example test position is **$6.3 of collateral against $4.35 of debt.** The bot has 44 unit tests, runs in dry-run unless you pass `--live`, and only approves exact token amounts, never unlimited ones.\n\n### The Guardian\n\nLeverage has one way to really hurt you: liquidation. So the agent built a **Guardian** that runs on every new block, recomputes each loan’s risk and acts in tiers:\n\nTierWhat it doesWarnYellow alert onlyDeleverageSells some collateral and repays, back down to a safe targetEmergencyRepays with spare USDC, then borrows from the *other* loan to repay this oneBlockedCan’t fix it on its own. Critical alert: “add USDC and repay manually”\n\nThe README is blunt about the limit: above a certain loan-to-value, Fluid rejects every withdrawal, so the bot **can’t** sell its way out. It also lists what it hasn’t built (a true one-transaction flash loan) and why, including that one swap router it might have used, Odos, shut down on Jul 30.\n\n### The friend-request desk\n\nThen came the feature I didn’t expect. Friends can ask for a small amount through a public page using a private invite code. I approve in my private control panel. The bot borrows within a safe limit and delivers the money as bitcoin, cbBTC or USDC.\n\nFor real bitcoin it bridges through Garden, a cross-chain swap service, and refuses the trade if Garden’s fee is over 1% or if less than 98% of the value comes out the other side. Invite codes are stored encrypted, and the public page can’t read them. Nothing is sent without my confirm.\n\nThis morning was its first real rush, and it was a good test:\n\n- One send failed because Garden wanted an app ID. The agent found the cause, added Garden’s public one, and told me to press Retry myself, because the money was already sitting safely in the wallet and a second borrow wasn’t needed.\n- Another failed on a brief network error. It made that step retry on its own, “without any risk of sending twice.”\n- When a friend asked for more than the safe room left, I asked for a way to send part of it. It shipped **“Approve partial”** within minutes, splitting the borrow across both loans so each landed right at its safe limit and leaving the rest pending.\n- The first bitcoin payout arrived about a minute after the funds locked. Two others lagged. Instead of guessing, it explained that the funds were locked in escrow, not lost, and refundable if Garden never paid out. Then it scheduled a check-in.\n\n### When the agent got it wrong\n\nTwo moments in that rush are why I trust it more, not less:\n\n1. It reported that the Guardian and auto mode were **off.** I had asked for them to stay on. A few minutes later it corrected itself: they’d been on the whole time, and it had misread a status field.\n2. It restarted my control panel **in the middle of a live send.** The send finished fine, but the record went stale. It said so plainly, fixed the record, and added a rule that blocks restarts while a send is running.\n\nIt also knows where the line is. When I asked how to get the wallet’s private key into MetaMask, it wouldn’t paste the key into chat. It showed me how to read it from the machine myself.\n\n## What I learned\n\n- **Quiet is a feature.** 454 scans, most of them “nothing new,” means that when the scout does speak, I read it.\n- **Write down the zero.** $0 in gig earnings is the honest number, and an agent that logs it every check is one I believe about everything else.\n- **Build the brakes before the engine.** The loan bot’s best code isn’t the ratchet. It’s the Guardian, the dry-run default, the exact approvals, and the README section titled “Risks (read before funding).”\n- **Small, fast fixes beat big plans.** “Approve partial” didn’t exist at 6:04 AM. It was live a few minutes later, because I asked for one specific thing.\n\n— Blake (written through my AI agents)\n\n*Previously: [My AI Agent Reads Handwritten Timesheets. It Gets the Receipts 100% Right and the Names 14% Right.](https://blakelapierre.substack.com/p/my-ai-agent-reads-handwritten-timesheets), how my Odoo bot runs the business side.*", "url": "https://wpnews.pro/news/my-ai-agent-built-a-crypto-loan-bot-that-pays-my-friends-in-bitcoin-its-best-is", "canonical_source": "https://blakelapierre.substack.com/p/my-ai-agent-built-a-crypto-loan-bot", "published_at": "2026-10-27 16:09:07+00:00", "updated_at": "2026-10-27 16:14:33.782225+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Fluid", "Base", "cbBTC", "USDC", "Odos", "Mercor", "OpenTrain", "Terac"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/my-ai-agent-built-a-crypto-loan-bot-that-pays-my-friends-in-bitcoin-its-best-is", "markdown": "https://wpnews.pro/news/my-ai-agent-built-a-crypto-loan-bot-that-pays-my-friends-in-bitcoin-its-best-is.md", "text": "https://wpnews.pro/news/my-ai-agent-built-a-crypto-loan-bot-that-pays-my-friends-in-bitcoin-its-best-is.txt", "jsonld": "https://wpnews.pro/news/my-ai-agent-built-a-crypto-loan-bot-that-pays-my-friends-in-bitcoin-its-best-is.jsonld"}}