UnitFlow LogoUnitFlow Docs

How to Supply

Supplying assets to UnitFlow Lending earns you variable interest that accrues every second. In return you receive uTokens — interest-bearing ERC-20 tokens that represent your share of the pool. You can withdraw at any time as long as there is sufficient liquidity in the pool.

Prerequisites

  • A wallet connected to Arc Testnet (chainId 5042002)
  • USDC or EURC balance — get test tokens from the Faucets page

Step-by-Step

1. Navigate to Lending

Open the app and click Lending in the top navigation bar. The page shows the protocol stats bar (total supplied, total borrowed, average APY) and the market cards for USDC and EURC.

2. Review the Market Cards

Each market card shows:

  • Total Supplied — total liquidity currently in the pool
  • Total Borrowed — amount currently lent out
  • Supply APY — your annualised yield at current utilisation
  • Borrow APY — the rate borrowers pay (for reference)
  • Utilisation ring & bar — what percentage of the pool is borrowed out

Supply APY rises as utilisation increases — more borrowing demand means higher yield for suppliers.

3. Connect Your Wallet

If not already connected, click Connect your wallet in the centre of the page. The position panel and action panel will appear once connected.

4. Open the Supply Tab

In the Action Panel on the right, the Supply tab is selected by default. Choose the asset you want to supply — USDC or EURC — using the asset selector buttons.

5. Enter an Amount

Type the amount you want to supply, or click MAX to fill your full wallet balance. A preview row appears showing the Supply APY you will earn.

If this is your first time supplying that asset, the button will read Approve & Confirm — the hook detected that the pool does not yet have an allowance to spend your tokens.

6. Approve (first time only)

Click Approve & Confirm. Your wallet will prompt you to sign an approve(pool, MaxUint256) transaction. This grants the pool unlimited spending approval so you never need to approve again for that asset. The button label changes to Approving… while the transaction confirms.

7. Confirm the Supply

Immediately after approval confirms, the hook automatically submits the supply(asset, amount, yourAddress) transaction. The button shows Supplying…. Once the transaction is mined, a success toast appears and a View transaction link to ArcScan is shown below the button.

8. Verify Your Position

The Position Panel on the left updates automatically. You will see:

  • Net Worth — your collateral minus any debt
  • Collateral — the USD value of your supplied assets
  • Assets row — the exact amount supplied per token

Your wallet now holds uTokens (uUSDC or uEURC). These tokens accrue value over time — the underlying amount they represent grows with every block as interest compounds.

What Happens On-Chain

// 1. ERC-20 approval (first time only)
USDC.approve(lendingPool, MaxUint256)

// 2. Supply call
LendingPool.supply(
  asset:       0x3600...0000,   // USDC address
  amount:      1_000_000,       // 1 USDC (6 decimals)
  onBehalfOf:  0xYourAddress
)

// Pool internally:
// a. Updates liquidityIndex (accrues interest since last update)
// b. scaledAmount = amount * RAY / liquidityIndex
// c. uToken.mint(onBehalfOf, scaledAmount)
// d. userCollateral[user][asset] += amount
// e. totalLiquidity += amount
// f. Emits Supply(asset, user, amount, index)

Withdrawing Your Supply

To reclaim your tokens plus accrued interest, switch to the Withdraw tab in the Action Panel. Enter an amount or click MAX to withdraw everything. The pool burns your uTokens and returns the underlying plus all interest earned since you supplied.

Withdrawal will revert if:

  • The pool does not have enough liquidity (all funds are borrowed out)
  • Withdrawing would push your health factor below 1.0 (you have an active borrow)

Interest Accrual

Interest accrues continuously — not once per block, but on every transaction that touches the pool. The supply APY shown in the UI is an annualised snapshot of the current per-second rate. As utilisation changes (more borrows = higher rate, more supply = lower rate), your effective yield adjusts in real time.

UtilisationApproximate Supply APY
0%~0%
50%Low–moderate (slope 1 region)
80% (optimal)Moderate
90%+High (slope 2 kicks in)