Ref Finance Hack

TOTAL LOST $3.2M
Medium Other near

What happened

On August 14 at around 11 am UTC, the Ref Finance dev team deployed a hotfix to an issue surrounding the Ref Finance contracts. Prior to the fix, users that unstaked all of their tokens from the farm contract were unable to remove the deposited liquidity from the pool. This occurred due to the users’ NEAR account being unregistered from the LP token contract, a feature unique to NEAR tokens that generally aids the user experience.

While the hotfix solved that issue, it contained a new issue that did not debit users’ LP token balances when they removed liquidity. This allowed a small number of users to continuously remove tokens, receiving far more tokens than they should have.

In total, 507,000 NEAR and ~1 million REF tokens were withdrawn using this exploit. Over 400,000 of the NEAR were sent to Binance and Huobi.

Case & protocol details

Classification Exchange (DEX) / Input Validation
Protocol Type Exploit/Other
Affected asset / contract REF
Smart Contract Language Rust
Official Website app.ref.finance/
Protocol Twitter/X @finance_ref

Funds Recovery

100.0%

Recovered

$3.2M

Net Loss

$0

Evidence & learning

Sources and on-chain records

Practice this exploit pattern safely

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.