Fraxfinance

Fraxfinance lending - Deposits, fToken shares, and withdrawals

Last updated

Fraxfinance lending supplies a Fraxlend market’s loan asset in exchange for fTokens that represent a lender’s claim on that market. Borrowers use this capital against the market’s collateral token and pay interest. Interest changes the underlying asset value represented by each share. Withdrawals exchange shares for available assets, subject to the pair’s liquidity and operating restrictions.

A market’s asset contract identifies what lenders supply and its collateral contract identifies what supports borrowers’ debts; swapping to obtain the loan asset changes a wallet’s token balance, while a lending deposit creates a separate claim.

An fToken balance measures a claim on one market; available loan assets limit immediate withdrawals.

A successful deposit and an insufficient allowance

A direct deposit completes when the pair transfers the loan asset and credits fTokens to the chosen receiver. For a deposit back to your own wallet, the starting records are its loan asset balance and existing fTokens, and the pair needs authorization to spend that wallet’s loan asset. These conditions determine whether the deposit can proceed:

  • The selected pair’s asset contract matches the token that the wallet holds; standard pairs require a non-rebasing asset without transfer fees.
  • The wallet has enough of that asset for the chosen deposit, and the amount converts to nonzero share units.
  • The asset allowance identifies the actual pair as spender and covers the deposit.
  • Any applicable deposit limits, pauses, lender permissions, and maturity conditions permit the transaction.
  • The designated receiver is the address intended to hold the new fTokens.

Once those conditions hold, the deposit call converts the supplied asset amount into shares. The pair mints fTokens to the receiver and records a Deposit event. Compare that event’s asset and share fields with the resulting balance changes. A successful transaction receipt establishes execution; the credited fTokens identify the resulting lending position. A transaction hash alone does not establish success.

If insufficient allowance makes the deposit revert, that call creates no shares and completes no asset deposit. Correct the pair’s spending approval before resubmitting. Network fees can still apply.

Market selection and deposit availability

An isolated Fraxlend market defines the loan asset, collateral asset, and rate configuration for its own accounting. Markets that share a loan asset can still have different collateral risks or rates. The contract address and network distinguish their separate records. Supplying borrower collateral alone does not create lender fTokens; lenders supply the pair’s loan asset. Token symbols cannot resolve that distinction because symbols do not uniquely identify contracts.

Deposit restrictions also depend on the deployed pair’s design. Pairs with a depositLimit compare their asset accounting after interest accrual, plus the requested contribution, against that limit and revert if the resulting total exceeds it. Accrued interest can therefore consume deposit capacity without another lender adding funds. Older custom term-sheet pairs reject deposits from unapproved callers or receivers when a lender whitelist is active. They also reject new deposits after a configured maturity date. Separate controls for deposits, borrowing, and withdrawals require checking the operation that actually matters.

Visual outline: Market selection and deposit availability (Fraxfinance lending)

View full-size image

What do fTokens represent after a deposit?

fTokens are the pair’s ERC-20 lender shares. Each fToken represents a proportional claim on its own pair’s accounted loan assets. A share quantity and its underlying asset value use different units.

For an established market with nonzero accounting totals, the asset amount divided by outstanding asset shares gives the exchange rate. Multiplying that rate by an account’s share balance gives its proportional asset claim. Contract units and token decimals govern how interfaces display those quantities.

A deposit increases accounted assets and mints shares at the existing exchange rate, preserving that ratio apart from integer rounding as new capital enters the market. Later deposits can receive fewer shares for the same asset contribution when accrued interest has increased share value.

The pair records lender ownership as ERC-20 balances and borrower obligations as separate debt shares. A lending deposit creates no new borrowing obligation. An account can participate on both sides, so its fToken balance does not describe any debt that it already holds.

Integer rounding affects share conversions, especially at the smallest token units. Standard pair deposit calculations round shares down. A deposit that rounds to zero share units transfers assets without minting new fTokens.

How does borrower interest reach lenders?

Lender interest comes from borrower debt that accrues within the market and increases its accounted loan assets. The pair updates interest accounting during operations such as deposits and redemptions. An existing lender’s share count generally stays unchanged while those shares represent additional assets. Where a protocol interest fee applies, the pair can mint fee shares to itself. Those extra shares reduce the portion of accrued interest attributable to existing lenders. The lending rate consequently reflects borrowing demand, utilization, and applicable protocol fees.

Utilization measures borrowed assets relative to supplied asset accounting. Fraxlend’s rate designs include a linear calculator, a time-weighted variable calculator, and Variable Rate V2, which combines an immediate utilization curve with adjustments to that curve over time. A linear curve responds to utilization. A time-weighted design adjusts rates while utilization remains outside its target range. The selected calculator and its parameters govern each pair; an annualized rate display does not fix future earnings.

Available liquidity and withdrawal limits

Withdrawal capacity depends on unborrowed capital, even when a lender’s accounted claim is larger. A redemption cannot exceed the loan assets currently available in that pair. Asset accounting includes borrowed capital, so total assets differ from immediately available tokens. Repayments and new deposits can replenish liquidity, while further borrowing can reduce it. In the V3 implementation, maxWithdraw and maxRedeem combine the owner’s balance, available assets, and withdrawal pause status. Older implementations can report the owner’s claim without applying the available-liquidity limit. A share valuation preview alone does not establish that the corresponding assets can leave the pool.

Can bad debt reduce the value of lender shares?

Bad debt can reduce share value when a liquidation writes off debt that collateral cannot cover. Borrowers provide collateral and must satisfy the pair’s maximum loan-to-value ratio, which compares debt value with collateral value. Liquidators repay eligible debt and receive collateral under that pair’s liquidation rules. Bad-debt write-offs reduce the underlying asset amount backing outstanding lender shares. A lender’s fToken count can remain unchanged through that loss.

Isolation keeps each pair’s accounting separate from other markets. Lenders nevertheless retain exposure to its collateral valuation and liquidation mechanisms. A loan asset’s market price also affects the value of the underlying funds, even if its quantity per share increases. Temporary withdrawal illiquidity and a credit write-off have different effects: illiquidity restricts access, while a write-off reduces the accounted claim.

Share redemptions and asset withdrawals

A share redemption specifies how many fTokens to burn, while an asset withdrawal specifies how much loan asset to return. The pair translates either target through its share exchange rate and applies the available liquidity check, which constrains the asset amount that either method can return. Both methods reduce the owner’s shares and the market’s accounted assets. Partial removal can leave a continuing lending position. Full removal requires redeeming all remaining shares under the pair’s applicable liquidity and operating conditions.

The standard pair withdraw calculation rounds required shares up, while redeem rounds returned assets down. Those directions matter when a small balance remains. The share owner, transaction caller, and asset receiver are separate address fields. A Withdraw event records the returned asset amount and burned share quantity alongside those addresses. These fields distinguish who called the pair from who received its assets.

Asset-sized deposits and share-sized mints

An asset-sized deposit fixes the loan asset contribution, while a share-sized mint fixes the fToken quantity that the call creates. The deposit function calculates shares from the supplied asset amount; mint calculates the asset amount required for specified shares. Both methods require authorization to transfer the loan asset and follow the pair’s deposit restrictions. A mint target can change its required asset contribution as the exchange rate changes, whereas a deposit keeps its specified asset input fixed.

Fraxfinance lending questions worth asking

Can a Fraxlend deposit send lender shares to a different wallet?

A deposit can credit fTokens to a receiver different from the wallet supplying the loan asset. The pair takes assets from the caller and mints shares to the designated receiver. Older custom pairs that restrict lenders can require both addresses to satisfy their permission checks. The supplying wallet does not own shares that it directs elsewhere.

Will an fToken transfer carry its existing interest claim to the recipient?

Transferred fTokens carry the underlying claim represented by those shares at the pair’s exchange rate. The recipient acquires that claim, including interest already reflected in its asset value. Transferring shares does not separately pay out the underlying loan asset. Redemption still depends on the receiving holder’s market, available liquidity, and applicable withdrawal conditions.

How can I locate lender shares that my wallet does not display?

The Fraxlend pair’s balanceOf record identifies the fToken balance held by an address. The pair contract itself is the ERC-20 share token contract. Its address, network, and share receiver identify the relevant balance. A wallet’s omission of that token from its asset list does not erase the onchain lending record.

Are network fees part of the deposit amount that earns interest?

Network fees do not become Fraxlend loan assets or earn interest through fTokens. The pair calculates shares from the asset contribution transferred into its accounting. Gas pays for transaction execution, including reverted calls that consume execution resources. Approval and deposit transactions, when executed separately, each have their own network cost.

What can change between a deposit preview and the minted share amount?

A deposit preview reads the pair’s state when queried, while the deposit uses its state at execution. Interest accrual, protocol fee shares, or debt write-offs can change the share conversion between those moments. A preview also does not authorize asset spending or establish that the pair’s deposit restrictions will permit the call.

Is a loan-asset approval sufficient for delegated fToken redemption?

Delegated redemption requires the share owner’s fToken allowance to cover the caller’s requested share expenditure. An approval on the underlying loan asset covers a different token and permission. The owner calling redeem directly does not need to grant itself delegated authority. Withdrawal liquidity, the owner’s share balance, and applicable pause checks still constrain redemption.

How private is a Fraxlend deposit?

Fraxlend deposits leave public onchain records of participating addresses and asset and share quantities. Deposit events distinguish the caller from the share receiver, and ERC-20 transfer records expose token movements. Sending shares to another address does not remove the recorded connection between that receiver and the deposit transaction.

Are transfer-fee or rebasing tokens suitable for standard Fraxlend deposits?

Standard Fraxlend pair accounting assumes non-rebasing assets without transfer fees. Transfer fees can make the pair receive fewer assets than its recorded deposit amount. Rebasing can change token balances outside the pair’s accounting operations. Implementing ERC-20 methods alone does not establish that either behavior fits the lending mechanism.