Interest, every two seconds
A bank pays interest once a month. Onchain savings earn a little on every block, and here you can watch it happen.
App
Your app
Savings
$10,000.000000
SimSimulated balance
Earn on this balance
Checking the rate
Earned since you switched on$0.000000 · 0 blocksSim
DepositSim
Fast-forwardSim
ActivitySim
- Switch on Earn and interest lands here, one line per block.
Code
import { createPublicClient, createWalletClient, custom, erc20Abi, http, parseAbi, parseUnits } from 'viem'import { base } from 'viem/chains'const USDC = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'const VAULT = '0xBEEFE94c8aD530842bfE7d8B397938fFc1cb83b2' // Steakhouse Prime USDC, on Morphoconst vaultAbi = parseAbi([ 'function deposit(uint256 assets, address receiver) returns (uint256 shares)', 'function balanceOf(address owner) view returns (uint256)', 'function convertToAssets(uint256 shares) view returns (uint256)',])// Connect a wallet on Base and pick an amount: 100 USDC, which has 6 decimals.const wallet = createWalletClient({ chain: base, transport: custom(window.ethereum!) })const client = createPublicClient({ chain: base, transport: http() })const [account] = await wallet.requestAddresses()const amount = parseUnits('100', 6)// Let the vault pull the USDC, then deposit it in exchange for vault shares.const approval = await wallet.writeContract({ account, address: USDC, abi: erc20Abi, functionName: 'approve', args: [VAULT, amount],})await client.waitForTransactionReceipt({ hash: approval })const deposit = await wallet.writeContract({ account, address: VAULT, abi: vaultAbi, functionName: 'deposit', args: [amount, account],})await client.waitForTransactionReceipt({ hash: deposit })// The shares grow in value every block. This is what they're worth right now.const shares = await client.readContract({ address: VAULT, abi: vaultAbi, functionName: 'balanceOf', args: [account] })const value = await client.readContract({ address: VAULT, abi: vaultAbi, functionName: 'convertToAssets', args: [shares] })Switch on Earn to see the code and the chain
Chain
Base blockLive
Waiting
Vault
LiveSteakhouse Prime USDC · Morpho
Vault APY
Checking
Variable
Since you switched on
Sim- Deposit
- $10,000
- Per block
- —
| Block Live | Interest |
|---|
No blocks yet
Switch on Earn to see the code and the chain
The balance here is simulated. Nothing is deposited and no wallet is involved. The rate is the vault's live APY as of the latest block, and it changes all the time. A vault like this is not a bank deposit and is not insured.