Agent 2

Agent 2: The Yield Hunter — When Your Bot Learns to Distrust Its Own Data

By Voytek.AI | askvoytek | 28 Jul 2026


Building the intelligence layer that decides where your money works harder — and learning DeFi's dark side the hard way.

A $100 Raspberry Pi sitting on my desk in Atlanta is making continuous financial decisions on a live blockchain.

No cloud servers. No $50,000 trading rig. Just a tiny computer, a Python script, and an agent I call the Yield Hunter.

This is the story of Agent 2.


If you missed Article 1:

I’m building ARB NETWORK — a 7-agent DeFi signal system running 24/7 on a Raspberry Pi 5. Agent 1 watches Aerodrome liquidity pools on Base chain for arbitrage gaps. Agent 2 answers a different question entirely:

“Is this pool worth compounding through Beefy Finance — or should you just farm it raw?”

Simple question. Surprisingly hard to answer.


What Yield Hunting Actually Means

If you’ve spent time in DeFi you know the basic move:

Find a liquidity pool

→ deposit your tokens

→ earn yield

→ repeat

But there’s a layer most people skip.

Some pools have auto-compounding vaults on top of them — Beefy Finance being the biggest on Base chain. Instead of manually harvesting your rewards and reinvesting them, Beefy does it automatically, hundreds of times per day.

Compounding that frequently changes the math significantly.

A pool showing 45% APY raw might become 67% APY compounded through Beefy. Or — and this is the part that gets interesting — Beefy’s vault might actually underperform the raw pool after fees.

Agent 2’s entire job is figuring out which situation you’re in, for every pool, every cycle, automatically.

COMPOUND → Beefy vault wins

FARM_RAW → raw pool wins

NO_VAULT → Beefy doesn’t cover this pool yet

That output feeds directly into Agent 4 — the coordinator — and eventually reaches Agent 7, the execution engine. Agent 2 is the first real intelligence layer in the pipeline.


The First Wall: The Vault Matching Problem

Here’s something Beefy Finance doesn’t advertise:

Their vault names don’t match Aerodrome’s pool names.

At all.

WETH-B3 on Aerodrome might be aerodrome-weth-b3 on Beefy. Or aerodrome-v2-weth-b3. Or it might not exist at all.

When Agent 2 hits the Beefy /apy and /vaults endpoints simultaneously with Aerodrome’s pool data — it’s comparing two completely different naming conventions across two completely different APIs.

I had to build find_matching_vault() — a fuzzy matching function that reliably connects the two data sources without false positives.

python

def find_matching_vault(pool_name, beefy_vaults):

# normalize both sides

# strip special characters

# match token pairs regardless of order

# confidence threshold before accepting match

Getting that logic right took longer than building the rest of Agent 2 combined.

This is the part they don’t show you in DeFi tutorials. The data is messy. The APIs don’t talk to each other. You have to build the bridge yourself.


 

 

 

The APY Outlier Crisis

First real run. Agent 2 comes back with signals.

I look at the data:

WETH-B3 → 1,603% APY

TIG-USDC → 1,206% APY

FLOCK-ETH → 847% APY

For about thirty seconds I thought I’d built something incredible.

Then reality hit.

Those numbers aren’t real yields. They’re emission traps — newly launched tokens flooding their pools with temporary insane reward emissions to attract liquidity fast. The APY looks incredible for a week. Then the emissions dry up, the token dumps, and anyone who chased that yield loses everything.

DeFi’s dark side. And my system had just recommended all of it.

The fix:

python

MAX_APY_TO_TRUST = 300

BLOCKED_TOKENS = [

‘TIG’, # confirmed emission trap

‘FUN’, # confirmed emission trap

‘LRDS’, # pump and dump

‘FLOCK’ # pump and dump

]

Anything above 300% APY gets flagged ABORT. Known bad actors get blacklisted entirely.

This was the moment Agent 2 stopped being naive.

The system had to learn

to distrust its own data.

That’s not a bug. That’s DeFi literacy. And it’s something every builder in this space eventually learns — usually the expensive way.

I learned it in a Python script before risking a dollar.


The NO_VAULT Discovery

Something unexpected came out of building Agent 2.

A significant portion of Aerodrome pools have no Beefy vault at all. Beefy covers the blue chips well — WETH pairs, USDC pairs, established tokens. But the long tail of newer pools?

Unvaulted.

Signal: NO_VAULT

→ Beefy hasn’t built here yet

→ farm raw or skip entirely

→ Agent 4 scores accordingly

That intelligence shaped the entire downstream architecture. Agent 4 now weights NO_VAULT signals differently than FARM_RAW — because no vault often means newer pool, less liquidity, higher risk.

One agent’s limitation became the whole system’s wisdom.


The CoinGecko Problem

Price lookups were hammering the free CoinGecko API.

Rate limits. Errors. Agent 2 timing out mid-cycle.

Solution was simple but taught me something important about building resilient systems:

python

# 24-hour TTL cache

# coingecko_cache.json

# if price exists in cache → use it

# if not → hit API → store result

One JSON file. Saved thousands of unnecessary API calls. Agent 2 stopped breaking when CoinGecko was grumpy.

Build systems that survive bad days. APIs go down. Rate limits hit. Networks hiccup.

Your code needs to handle reality — not just the ideal path.


What Agent 2 Actually Is

Agent 2 is the nose of the operation.

It sniffs out where your money works harder, filters out the traps, and passes clean intelligence up the chain.

Running 24/7. On a $100 computer. On a live blockchain.

By the time Agent 4 sees a signal — it’s already been through the Yield Hunter. The garbage has been filtered. The emission traps have been flagged. The vault landscape has been mapped.

Clean intelligence. Every cycle.


What’s Coming in Article 3

Agent 2 tells you WHERE yield is.

Agent 3 tells you HOW BIG the opportunity actually is.

The gap calculator. The math that turns raw signals into ranked opportunities. And the bug that was making every calculation 38x larger than reality.

Yeah. We’ll talk about that. 😄


Whatever you’re building today, keep going. 🚀

— Voytek

If you enjoy this content and want to support the builds, grab me a coffee ☕

👉 ko-fi.com/askvoytek



askvoytek.substack.com

voytek.ai

github.com/askvoytek

 

How do you rate this article?

3


Voytek.AI
Voytek.AI

25+ years in IT. Now building AI agents, trading bots, and a homelab on Raspberry Pi, CISCO, and other gear. Writing about the intersection of technology, finance, and figuring it out as I go. Currently building a DeFi Arb-Network Bot. Crypto trading alg


askvoytek
askvoytek

Homelabs, trading bots, mining rigs, and automation — built in public, mistakes included. 25 years in IT, now going deep on Linux, Python, and DeFi. If it's got a chip in it, I'll probably try to automate it. More builds and write-ups at askvoytek.substack.com and voytek.ai. Whatever you're building today, keep going. 🚀

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.

Page not displaying correctly?