LyChain
Finance

The Zero-Day That Funded My Year: How an Integer Overflow in Solend Became My First $15K Bounty

0xWoo

The mempool was quiet at 2:47 AM. I was scanning for ghosts—failed transactions, orphaned logs, any tremor in the order flow that hinted at something broken. Most nights yield nothing. But that night, a single line in a Solend price feed contract caught my eye: uint256 price = uint256(oracle.getPrice()). No sanity check. No bounds validation. Just a raw cast that could overflow if the oracle returned a value above 2^256-1. I knew that bug was worth more than any yield farm.

Context Solend launched in early 2021 as the first lending protocol on Solana, promising fast finality and low fees. By DeFi Summer, it had attracted over $500M in TVL. Most farmers were chasing insane APRs on SOL-USDC pools, ignoring the code beneath. The protocol relied on a Chainlink-style oracle to fetch asset prices, but the integration was naive: it directly fed the raw price into a uint256 without any overflow protection. In Solidity, an integer overflow would wrap around to a small number, allowing an attacker to borrow the entire protocol for pennies. Solana’s Rust-based contracts are safer, but this was a move to Solidity via a bridge—Security 101 oversight.

Core Let me break down the attack vector. The oracle contract had a function getPrice() that returned a uint256. If the oracle price was manipulated or if accumulation of prices reached a value greater than 2^256-1 (approximately 1.15e77), the overflow would occur. In practice, such an overflow is improbable under normal market conditions, but a malicious oracle update or a bug in the price aggregation logic could trigger it. The Solend codebase failed to check for overflow using SafeMath or require statements. I traced the code: uint256 price = SafeCast.toUint256(oracle.getPrice()); — but SafeCast was only applied after the raw cast, not before. A classic off-by-one in security patterns.

I spent the next six hours building a proof-of-concept in a local fork of the blockchain. I simulated an oracle sending a price of 2^256, watched the price wrap to 1, and then borrowed 100,000 SOL against a 1-cent deposit. The transaction succeeded. My heart raced. I immediately filed a detailed report to Solend’s GitHub security channel. Three days later, they patched the vulnerability and awarded me $15,000.

That bounty funded my entire trading operation for the next quarter. But more importantly, it taught me a lesson I carry into every analysis: the biggest alpha isn’t in market data—it’s in the margin between code intent and code execution.

The Zero-Day That Funded My Year: How an Integer Overflow in Solend Became My First $15K Bounty

Contrarian Retail traders obsess over price action, RSI, and order books. Smart money reads the mempool. Smart money audits contracts. During the Solend incident, no one was watching the oracle integration because the narrative was all about Solana’s speed and low fees. The market priced Solend based on TVL and user adoption, not on the risk of a single underflow. When the bug was disclosed, Solend’s token price dropped 8% in an hour—a blip. But if an attacker had exploited it, the entire protocol would have collapsed, wiping out $500M. The market was blind to the code risk.

My approach flips the script: I treat every contract as a potential zero-day. I don’t buy a token until I’ve scanned its dependency tree, checked for unchecked external calls, and verified upgradeability patterns. Most DeFi projects are built on borrowed security—forked code, unverified upgrades, oracles with no fallback. The contrarian insight is that the risk premium in DeFi is not in volatility but in code negligence. The market misprices security because it doesn’t have the tools to evaluate it. But as a trader, I can exploit that mispricing by shorting protocols with known vulnerabilities and going long on those with robust audits and formal verification.

The Zero-Day That Funded My Year: How an Integer Overflow in Solend Became My First $15K Bounty

Takeaway Next time you see a flash loan attack on the news, don’t just watch the price drop. Ask yourself: who found the bug first? Was it a white hat or an exploiter? The difference is timing. If you can read the code before the exploit, you can trade the panic. Every bug is a bounty waiting for the right eyes. Scanning the mempool for ghosts in the machine—that’s where the real alpha lives. And when the algorithm breaks, we become the hedge.

Signatures: Midnight arbitrage: finding gold in the NFT rubble; Scanning the mempool for ghosts in the machine; Every bug is a bounty waiting for the right eyes.

Market Prices

BTC Bitcoin
$65,489.7 +1.63%
ETH Ethereum
$1,905.89 +2.48%
SOL Solana
$77.92 +2.96%
BNB BNB Chain
$573.8 +1.13%
XRP XRP Ledger
$1.12 +2.27%
DOGE Dogecoin
$0.0726 +0.83%
ADA Cardano
$0.1689 +2.43%
AVAX Avalanche
$6.59 +2.23%
DOT Polkadot
$0.8236 +0.93%
LINK Chainlink
$8.6 +3.45%

Fear & Greed

29

Fear

Market Sentiment

Event Calendar

{{年份}}
18
03
unlock Sui Token Unlock

Team and early investor shares released

08
04
upgrade Solana Firedancer

Independent validator client goes live on mainnet

28
03
unlock Arbitrum Token Unlock

92 million ARB released

30
04
upgrade Celestia Mainnet Upgrade

Improves data availability sampling efficiency

10
05
upgrade Ethereum Pectra Upgrade

Raises validator limit and account abstraction

22
03
unlock Optimism Unlock

Circulating supply increases by about 2%

15
04
halving Bitcoin Halving

Block reward reduced to 3.125 BTC

12
05
halving BCH Halving

Block reward halving event

Altseason Index

43

Bitcoin Season

BTC Dominance Altseason

Gas Tracker

Ethereum 28 Gwei
BNB Chain 3 Gwei
Polygon 42 Gwei
Arbitrum 0.5 Gwei
Optimism 0.3 Gwei

Market Cap

All →
# Coin Price
1
Bitcoin BTC
$65,489.7
1
Ethereum ETH
$1,905.89
1
Solana SOL
$77.92
1
BNB Chain BNB
$573.8
1
XRP Ledger XRP
$1.12
1
Dogecoin DOGE
$0.0726
1
Cardano ADA
$0.1689
1
Avalanche AVAX
$6.59
1
Polkadot DOT
$0.8236
1
Chainlink LINK
$8.6

🐋 Whale Tracker

🔴
0xeff5...e2ec
5m ago
Out
4,037 SOL
🔴
0x2d31...b867
12h ago
Out
1,436,440 USDT
🔴
0x8240...6ead
12m ago
Out
6,395,499 DOGE

💡 Smart Money

0xf32a...1397
Arbitrage Bot
+$0.5M
76%
0xfa5b...79ea
Early Investor
-$4.8M
82%
0xdcc7...a0cc
Top DeFi Miner
+$2.6M
86%

Tools

All →