H
H
Hifi v0 Docs
Search…
Protocol Overview
Core concepts and diagrams.

Introduction

Hifi is a fixed-rate, fixed-term lending protocol powered by zero-coupon bonds, as defined in Dan Robinson and Allan Niemerg's paper The Yield Protocol. The protocol is implemented in a system of non-upgradeable smart contracts on the Ethereum blockchain.

Core Concepts

fyTokens are Synthetics

The protocol issues synthetic assets called fyTokens, which track an arbitrary underlying asset.
For instance, imagine fyUSDC. This is a synthetic that would track the USDC stablecoin. Borrowers would mint fyUSDC by depositing collateral, which can be any asset, say ETH. After the expiry date, any holder of fyUSDC would be able to redeem it in exchange for USDC.

Interest Rates

Unlike most other lending protocols in DeFi, interest rates on Hifi are not influenced directly by the protocol developer. It is the market itself that dictates the interest rate that participants pay or receive.
When we issue an fyToken, we go on Balancer to create a pool between the fyToken and the underlying. This way, anyone can provide liquidity to the pool and earn commissions when somebody makes a trade. The effective amount of fyTokens bought or sold in the pool gives the interest rate to the end user.
For example, say you are interested in lending 10,000 USDC on Hifi. You would head to our web interface and you will be quoted an interest rate of 5%. If we suppose expiration is in 1 year, it means that you would get 10,500 fyUSDC in exchange for your 10,000 USDC. Then, you would hold on to your fyUSDC tokens for 1 year, when you can redeem 10,500 USDC.

Collateralization

Now, similar to other lending protocols like Maker, Hifi has over-collateralization rules. That is, borrowers must be over-collateralized before they can mint fyTokens.
While for high-profile assets like ETH, Hifi will use the industry standard of 150%, the margin requirement for an arbitrary collateral depends on several factors:
    Quality of collateral asset
    How reliable the oracle price feed is
    Market conditions (recall Black Thursday)
When the value of the borrower's collateral falls below this collateralization ratio, it is said that the account has fallen "underwater" and it can be liquidated. Read more about this in the Security section.

Codebase

The smart contract code is publicly verifiable on GitHub:
GitHub - hifi-finance/hifi-protocol: The Hifi fixed-rate, fixed-term lending protocol
GitHub
The git commit that we used for deploying on mainnet is b06eda9 (tagged as v1.0.0 on GitHub). All contracts have their source code verified on Etherscan.

Protocol Math

The Hifi protocol uses Compound's Exponential.sol math library to represent fractional quantities with sufficient precision.
Most numbers are represented as a "mantissa", an unsigned integer scaled by 1 * 10 ^ 18, in order to perform basic math at a high level of precision. In other words, amounts in Hifi have 18 decimals of precision, just like ETH is equal to 10^18 wei.

Contract Flowcharts

BalanceSheet

Fintroller

FyToken

RedemptionPool

Last modified 8mo ago