Lybrafinance redemption exchanged stablecoins for eligible providers' collateral in the 2023 V2 contract design

Lybrafinance redemption in the June 2023 V2 contract design exchanged eUSD for an eligible provider's stETH. An oracle price and a configurable fee determined the payout. The exchange reduced the provider's debt and paid collateral to the caller, while peUSD had separate collateral-redemption and eUSD-conversion paths.

- updated
Bottom line: In the June 2023 V2 design, provider debt limited redemption size, while oracle prices and the configurable fee determined collateral payouts.

Stablecoin balances reduced provider debt and released collateral

The caller supplied eUSD, while the selected provider supplied a collateral-backed borrowing position. The vault reduced that provider's debt by the redeemed eUSD amount and transferred collateral to the caller, provided the borrower had opted into redemption.

Holding eUSD did not require the caller to own the provider's deposit or share its borrowing history. The authorized vault burned eUSD from the caller's balance while reducing the selected provider's outstanding loan and recording the collateral leaving that position. stETH was a liquid staking token (LST), so its recipient held tokenized staking exposure.

How did the redemption fee affect the collateral payout?

The redemption fee reduced the collateral units paid after the vault converted the stablecoin amount using its oracle price. In human units, the payout equaled the stablecoin amount divided by the collateral's dollar price, multiplied by one minus the fee rate. This calculation used the stablecoin's dollar target.

Asset prices converted dollars into token units

stETH used the Ether oracle price

The 2023 stETH vault returned its Ether oracle price as the collateral price. With the redeemed eUSD amount unchanged, a higher price meant fewer stETH units and a lower price meant more. The calculation did not consult a market quote for selling the received stETH.

Non-rebasing collateral prices included exchange ratios

Other V2 collateral contracts combined the Ether price with their token's conversion ratio. The wstETH vault used the amount of stETH represented by each wrapped token. rETH and wbETH vaults used their respective Ether exchange ratios. Those ratios changed the dollar value assigned to a collateral unit, so the number of LST units paid depended on each vault's price calculation.

The fee setting reduced the amount transferred

The June 2023 V2 fee configuration initialized the redemption charge at 0.5% of the gross collateral payout. Its setter capped the permitted value at 5% and allowed the historical starting value to change. A later fee change altered the fraction reaching the redeemer even when the oracle price stayed unchanged.

Visual outline: The fee setting reduced the amount transferred (Lybrafinance redemption)

View image file


Which provider positions qualified for redemption?

The eUSD redemption call required an opted-in provider with sufficient recorded debt and an oracle-valued collateral ratio of at least 100%. The requested amount could not exceed that provider's eUSD loan balance. Its ratio compared recorded collateral value with recorded borrowing, and equality passed the code's coverage check. These conditions applied to the selected position in the selected vault. The token burn also depended on the caller's share balance and the vault's burn permission. Loan repayment or another redemption could change the provider's remaining debt before execution.

Redemption eligibility and liquidation status used different collateral tests. In the June 2023 eUSD vault, the redemption guard accepted 100% coverage, while liquidation targeted borrower ratios below 150%. A position could satisfy both conditions, so redemption eligibility did not remove liquidation exposure.


Provider debt and oracle prices could change before execution

For an eUSD redemption, keep the requested amount unchanged when comparing a quote with execution conditions. Sufficient provider debt allowed the amount check to pass; a higher Ether oracle price still reduced the stETH payout.

The June 2023 call rejected a request exceeding the provider's debt instead of partially filling it. Reducing the amount or changing providers required a fresh request at the price in effect when it executed.

The June 2023 vault method itself accepted no minimum-output or deadline argument, so passing its checks did not enforce a quoted stETH amount. A successful receipt and collateral transfer established the executed payout; a submitted transaction hash alone did not establish receipt of collateral.


peUSD collateral redemption and eUSD conversion returned different assets

Collateral redemption used a peUSD borrowing position

The 2023 non-rebasing vault base also exposed rigid redemption. It accepted peUSD against an opted-in provider and transferred that vault's collateral after applying the price and redemption fee.

That path could return wstETH, rETH or wbETH through their respective vault implementations. The request could not exceed the provider's recorded principal. Its eligibility check required at least 100% oracle-valued collateral coverage against that principal, excluding accrued borrowing fees. Accrued borrowing fees could therefore make its calculated coverage look stronger than fee-inclusive coverage.

Conversion recovered an account's deposited eUSD shares

The 2023 mainnet conversion contract limited peUSD-to-eUSD conversion to the caller's recorded conversion balance. It burned peUSD and returned a proportional share of that account's deposited eUSD, preserving the deposit's exposure to rebases. Acquiring peUSD alone did not transfer another account's conversion record.

Collateral redemption delivered an LST from a provider's vault position. Conversion delivered eUSD from the caller's recorded deposit.


Repayment and withdrawal changed the borrower's own position

Repaying an eUSD loan reduced the debt assigned to the repayment's named account. The repayment call itself did not transfer collateral. A separate withdrawal drew from the depositing caller's recorded assets and checked the remaining borrowing position against its safe collateral ratio. Rigid redemption instead reduced the selected provider's debt by the redeemed amount while releasing collateral to the redeemer. Redeeming against another provider therefore did not repay the caller's unrelated loan.

esLBR vesting converted escrowed rewards into LBR on its own schedule. Its timing rules did not control collateral redemption or the account record governing recovery of deposited eUSD.

Oracle value and market proceeds remained separate

The redemption formula valued eUSD at its dollar target, while market trading could price it differently. A discount could create an arbitrage opportunity when the collateral received exceeded the acquisition cost and other transaction costs. The fee reduced that margin, and the collateral's resale price affected realizable proceeds. A market discount alone did not establish a profitable exit. A 1:1 dollar conversion described gross oracle value; the historical 0.5% fee reduced the actual collateral payout.

Lybrafinance redemption - common questions

Did a rigid-redemption call automatically combine several providers?

The June 2023 vault call accepted one provider address per redemption request. Its amount limit applied to that selected position. Additional provider positions required additional calls to the vault method, which included no logic for combining their debt capacity.

Could the redeemer choose a different address for the collateral payout?

The June 2023 rigid-redemption function transferred collateral to its caller and offered no separate recipient argument. If a contract invoked the function, that contract was the caller. The vault's ordinary withdrawal function had a recipient parameter, so its ability to direct withdrawals elsewhere did not describe rigid-redemption behavior.

Did eUSD rigid redemption require an ERC-20 spending approval?

The 2023 eUSD rigid-redemption path used an authorized vault burn without checking a spending allowance. The token required the vault to have permission to burn and sufficient shares in the caller's balance. Depositing eUSD for peUSD conversion used transferFrom, which followed a different authorization path.

Would a vault-specific burn pause block eUSD redemption?

The 2023 eUSD token rejected the burn when its configuration paused burns for the calling vault. Rigid redemption depended on that burn, so the paused state prevented the exchange from completing. Provider eligibility and sufficient collateral did not override this vault-specific control.

Where did the fee remain after an eUSD collateral redemption?

The eUSD implementation left the fee's collateral equivalent in the provider's recorded deposit. It reduced the provider's debt by the redeemed eUSD amount while subtracting only the net collateral payout from the deposit. The caller received fewer stETH units; the function did not transfer a separate redemption-fee payment to a collector.

Was the three-day withdrawal charge added to rigid redemption?

The June 2023 eUSD vault did not apply its early-withdrawal charge inside rigid redemption. Ordinary collateral withdrawal reduced the amount transferred by 0.1% within three days of deposit. Rigid redemption used the separate redemption-fee calculation. The deposit timestamp therefore affected that withdrawal rule, rather than adding a second fee to this historical redemption call.

Why could a manual payout calculation differ by tiny token fractions?

The 2023 payout formula used integer division, which discarded fractional remainders during the price conversion and fee calculation. A decimal calculator could retain fractions the contract omitted. Token balances also used their underlying integer precision, so a displayed decimal result could differ slightly from the amount the contract calculated.