Frenzy.Finance

Smart Contracts

How your funds are secured on-chain

USDC Settlement

All predictions on Frenzy.Finance are denominated in USDC — real stablecoins on the Base network. When you fund your session wallet, your USDC is deposited into the FrenzyDollar escrow contract, which mints you FD (FrenzyDollar) credits at a 1:1 rate. Every dollar in, one FD out.

FD is a non-transferable token — it only exists inside the escrow contract and can't be sent to other wallets. This keeps the accounting clean: your FD balance represents your exact claim on the USDC held in the contract.

When a prediction is settled:

  • Correct: FrenzyFinance calls mintCredits() on FrenzyDollar, increasing your FD balance. The USDC backing comes from the overcollateral surplus.
  • Incorrect: FrenzyFinance calls burnCredits(), reducing your FD balance. The USDC that was backing those credits becomes part of the surplus.

When you cash out, the process reverses — FD is burned and USDC is transferred back to your wallet.

Overcollateral

The FrenzyDollar contract always holds more USDC than the total FD in circulation. This difference is called the surplus — it's the buffer that backs correct prediction returns.

Surplus = USDC held in contract − total FD supply

Think of it as a reserve fund. If every user cashed out at the same time, the contract would have enough USDC to pay everyone, with the surplus left over. Trading automatically pauses if the surplus drops below the configured minimum threshold, preventing the system from becoming undercollateralized.

You can verify this at any time — the numbers are read directly from the blockchain:

The overcollateral is managed by FrenzyPool — an ERC4626 vault where anyone can provide liquidity. LPs deposit USDC into the pool, which routes it to FrenzyDollar as surplus. In return, LPs receive FLP share tokens that appreciate when traders' incorrect predictions exceed correct ones, and depreciate in the opposite case.

Self-Withdrawal (Heartbeat)

Under normal operation, the oracle backend settles your predictions and handles cash-outs. But what happens if the oracle goes offline?

The FrenzyDollar contract has a heartbeat mechanism as a safety valve:

  1. Every time the oracle settles a batch of predictions, it calls heartbeat() on FrenzyDollar, updating a timestamp.
  2. If no heartbeat arrives within the timeout period (default: 1 hour), the contract considers the oracle inactive.
  3. Once the timeout expires, any user can call withdraw() to directly redeem their FD for USDC — no oracle or backend required.

This means the worst-case scenario for accessing your funds is waiting for the heartbeat timeout. The contract enforces a minimum timeout of 60 seconds to prevent it from being set dangerously low during active settlement.

In short: the oracle settles your predictions efficiently, but if it ever stops, the contract lets you get your money out on your own.

Contract Addresses

ContractNetworkAddress
FrenzyFinanceBase Sepolia0x6195f1d17BcE754bd3ebd670070ae05307a464Ba
FrenzyDollarBase Sepolia0xA194D280672Fc6F68E06cfDd7E8676352867594e
FrenzyPoolBase Sepolia0x54580e2D85AB44F5c73826927c3865e8d5b1c34B
USDC (Mock)Base Sepolia0xD826235Fb2b20Dc0EAa37AAb84C7d6D58e49c7f5