Curvefinance

Curvefinance combines StableSwap and CryptoSwap pools with collateralized lending

Curvefinance uses StableSwap and CryptoSwap pools for decentralized token exchange and offers borrowing markets backed by collateral. StableSwap serves assets with closely related values; CryptoSwap accommodates changing relative prices. Its ecosystem also includes the crvUSD stablecoin, Llamalend lending markets and CRV governance. Liquidity providers earn a share of pool trading fees and may receive separate incentives. A swap’s total cost reflects pool settings, trading liquidity and blockchain gas.

Updated ·

Pool fees and the swap quote

Pool fees vary by contract and configuration, and dynamic-fee pools adjust their charge as balances change, so the rate that applies to a trade can differ from the base fee. StableSwap-NG can increase fees when the pool becomes imbalanced. CryptoSwap uses mid-fee and out-fee settings to shape its balance-sensitive charge. Governance can change configurable parameters, making the selected pool’s settings relevant to the quote.

Price impact measures how a trade changes the pool’s exchange price. Slippage describes the difference between a quote and execution. A minimum-output condition makes a swap revert if execution would return fewer tokens than permitted. The reverted transaction can still consume network gas. An attractive fee alone cannot establish the final exchange rate.

Gas pays the blockchain network separately from pool fees. The swap router can route through multiple pools, while a direct pool swap uses that pool’s liquidity. Aggregators provide another access path. Route complexity affects gas consumption, so the quoted token output and network cost answer different parts of the cost question.

How do StableSwap and CryptoSwap differ?

StableSwap targets assets expected to maintain a stable relative value, while CryptoSwap accommodates assets whose relative prices move substantially and adjusts the center of liquidity through its rebalancing mechanism. Both are automated market makers: contracts calculate exchange prices using pool balances and a pricing formula.

StableSwap concentrates liquidity near the assets’ expected exchange rate. Its amplification parameter, A, controls that concentration. A depeg changes the relationship that makes this design useful. StableSwap-NG also supports specific token behaviors, including rebasing assets and supported vault tokens. Rate-oracle assets introduce dependence on the accuracy and behavior of that oracle.

CryptoSwap tracks changing prices through an internal price oracle and a configurable rebalancing process. FXSwap addresses markets whose main price discovery happens elsewhere. Its oracle-guided recentering can use finite external refuel subsidies. Refuels help fund rebalancing without fixing the market price or guaranteeing LP income.

Diagram: Curvefinance - How do StableSwap and CryptoSwap differ?

View full-size image

A metapool pairs an asset with LP tokens from an approved base pool. This structure connects new trading liquidity to an existing pool. Metapool LPs consequently depend on the assets and contracts of that base pool as well.

What does a liquidity provider earn from a pool?

A liquidity provider earns the portion of trading fees allocated to LPs, with returns changing as trading activity, pool balances and their share of total liquidity change. Deposits receive LP tokens representing a proportional interest in the pool. Swap activity changes the underlying asset mix, so an LP position can differ from simply holding the deposited tokens.

Pool accounting incorporates the fees that belong to LPs into their position. Admin-fee allocations support the protocol’s separate revenue system. Withdrawal value also reflects the assets that remain in the pool.

Active gauge rewards require eligible LP or vault tokens to be staked in the relevant gauge contract. A gauge measures staked liquidity and distributes its configured incentives. Those incentives can include CRV or externally supplied rewards. Staking introduces the gauge contract alongside the pool contract, and reward availability can change.

A quoted annual yield can change with reward prices and deposits. Fee income can coexist with losses from a depeg or contract exploit.

crvUSD issuance and Llamalend markets

crvUSD is a stablecoin targeting the US dollar, with borrowing markets that accept governance-approved collateral. Borrowers obtain crvUSD against that collateral and owe interest on the debt. Debt ceilings and collateral requirements constrain borrowing capacity. PegKeepers help stabilize its market price; a dollar target does not make every swap execute at exactly one dollar.

Llamalend loans draw their borrowed assets from lender-supplied liquidity. Lenders hold vault shares that accrue borrower interest. Llamalend v1 required crvUSD on one side of a market. New v2 markets support other eligible token combinations and separate market parameters. The v1 system is being phased out, and new deployments use v2.

LLAMMA is the band-based automated market maker that manages loan collateral. Within the liquidation range, it progressively exchanges collateral into the borrowed asset. Price recovery can reverse the direction of conversion, while earlier trading losses remain. Soft liquidation can erode collateral value, and sufficiently unhealthy positions can still undergo hard liquidation. Individual markets have their own collateral, oracle and interest-rate conditions.

Savings crvUSD, or scrvUSD, gives depositors vault shares that earn an allocation of crvUSD borrowing interest.

CRV and veCRV governance

CRV is the governance token, and locking it creates veCRV voting power that declines as the remaining lock time shortens. The maximum lock lasts four years. veCRV cannot be transferred between wallets. Holders vote on governance proposals and gauge weights that influence CRV emissions. They can also receive allocated protocol revenue and boost eligible gauge rewards. The boost depends on the applicable gauge mechanics and voting balance, so holding CRV without locking it provides different rights.

Which pool conditions matter before a deposit?

A low swap fee alone cannot establish whether a pool suits a deposit because its LPs take exposure to pool assets, changing balances and the conditions that generate income.

  • Identify each asset’s backing, redemption terms and dependence on any external rate oracle.
  • Match the pool’s pricing design to the assets’ expected price relationship.
  • Read the pool’s configured fees alongside the quote for the intended swap.
  • Separate trading-fee income from gauge incentives and their staking requirements.
  • Check the supported withdrawal method and the assets that it returns.

Holding the same assets outside a pool avoids its automated exchanges but forgoes pool trading-fee income. A StableSwap deposit supplies near-peg liquidity, with exposure to changing balances if an asset depegs.

Frequently asked questions about Curvefinance

Must I hold CRV to use token swaps?

CRV ownership is not a requirement for ordinary token swaps. A swap uses the selected input asset, any necessary token allowance and funds for network gas. CRV locking concerns governance and eligible incentives.

Is approving an ERC-20 token the same as swapping it?

An ERC-20 approval grants a specified contract a token allowance; it does not execute the swap. The allowance determines how much that spender can transfer. A successful approval confirms permission, while the swap has its own execution result.

Why can withdrawing into one token reduce the amount I receive?

A single-token withdrawal can include fees and pricing effects from converting the pool position into that asset. TwoCrypto-NG supports both proportional withdrawals and single-token withdrawals. Their different output calculations make the selected method relevant to the withdrawal quote.

Can anyone deploy a Curvefinance liquidity pool?

Supported factory contracts allow permissionless pool deployment, subject to their token and configuration requirements. Deploying a pool does not automatically qualify its gauge for CRV emissions. Eligibility for those emissions has a separate governance process.

Does holding crvUSD in a wallet earn savings yield?

Holding ordinary crvUSD does not automatically earn the scrvUSD savings return. Depositing into the savings vault produces scrvUSD shares. Those shares participate in the vault’s allocated rewards, whose amount varies with borrowing interest and allocation settings.

What limits withdrawals from a Llamalend v2 vault?

Available unborrowed liquidity limits a lender’s immediate withdrawal. Tokens that borrowers currently owe cannot be withdrawn until liquidity becomes available. The vault’s maxWithdraw and maxRedeem functions account for the available amount, which can be less than the full position.

When can a deployed Llamalend v2 market block new borrowing?

A Llamalend v2 market can block new borrowing when its borrow cap is zero or the cap has been reached. Deployment alone does not establish borrowing availability. Separate supply limits govern whether the vault accepts additional lender deposits.

How does a gauge become eligible to distribute CRV?

A gauge needs DAO approval and whitelisting before it can receive CRV emissions. Gauge-weight voting then determines its allocation. A deployed gauge can distribute funded external rewards without that CRV approval, so gauge existence and CRV eligibility are distinct.