How the Protocol Works
As a decentralized credit protocol, the Goldfinch Protocol is a medium through which lenders and borrowers come together and exchange value across time. This guide explains how the set of smart contracts1 that comprise the Protocol work together to accomplish this.
The nexus through which lending and borrowing occurs is the TranchedPool contract. Every loan in the Protocol exists as an instance of this contract, deployed on the blockchain. At a high level, the lifecycle of a loan modeled by the TranchedPool contract is:
- lenders supply capital to the contract;
- the borrower draws down (i.e. borrows) this capital, as the principal of the loan;
- the borrower periodically pays interest on this borrowed principal;
- the borrower eventually repays the principal;
- lenders withdraw their portion of the supplied capital, plus their portion of the interest paid by the borrower.
The TranchedPool contract is called "tranched" because it distinguishes two classes of lender capital: senior and junior.
Junior capital is first-loss capital, in the event of a writedown by the borrower of the value of the loan. Junior capital is supplied by Backers, who provide their capital by interacting directly with the contract.
Senior capital is supplied to the TranchedPool contract by the SeniorPool contract. The amount supplied to the tranched pool by the SeniorPool contract is equal to the amount of junior capital supplied to the tranched pool, multiplied by a Protocol-maintained value called the leverage ratio, which defines the proportion of senior vs. junior capital in the tranched pool. Currently, the Protocol uses the FixedLeverageRatioStrategy contract to provide this leverage ratio value: it is a value set by Governance.2
TranchedPool and SeniorPool are the essence of the Protocol. The remaining contracts in the Protocol exist to support them, in one way or another. Let's explore those other contracts.
Each instance of the TranchedPool contract has its own instance of the CreditLine contract. CreditLine models the terms of the loan and is the workhorse for loan mechanics (e.g. calculating interest due, receiving borrower payments).
Supplying to the TranchedPool contract mints, via the PoolTokens contract, an ERC721 token representing the lender's position in the tranched pool. This token confers the ability to withdraw the lender's principal plus their share of interest repaid by the borrower.
Fidu is an ERC20 contract (ticker: FIDU) for representing user positions in the SeniorPool. FIDU is minted upon supplying USDC to, and burned upon withdrawing USDC from, the SeniorPool. The exchange rate between FIDU and USDC is the sharePrice
in the Fidu contract. sharePrice
is incremented upon interest repayments and decremented upon writedowns.
The UniqueIdentity and Go contracts provide a means for permissioning the actions that a user of the Protocol may take with the TranchedPool and SeniorPool contracts. UniqueIdentity mints and burns non-transferrable UID tokens, ownership of which is required for supplying to and withdrawing from TranchedPool and SeniorPool. The Go contract provides a convenient interface for reading the UniqueIdentity contract.
The Zapper contract improves Protocol UX by enabling users to move their funds in the Protocol in certain ways without incurring the costs they otherwise would (for example, eliminating the withdrawal fee when moving funds between a TranchedPool and the SeniorPool).
Lastly, the Protocol's governance token provides the foundation from which the Protocol is able to operate in a decentralized fashion. The GFI contract is the non-upgradeable ERC20 contract that provides this governance token (ticker: GFI). GFI is disbursed to Protocol participants in three ways:
- via airdrop
- MerkleDistributor, MerkleDirectDistributor, BackerMerkleDistributor, BackerMerkleDirectDistributor, and CommunityRewards are the Protocol's contracts for distributing GFI via Merkle trees.
- via the StakingRewards contract
- StakingRewards manages the disbursement of GFI for providers of SeniorPool liquidity. Capital providers earn GFI for staking their FIDU or staking their Curve LP tokens.
- via the BackerRewards contract
- BackerRewards manages the disbursement of GFI for Backers, i.e. suppliers of junior capital to a TranchedPool. Over the loan term of a TranchedPool, Backers earn GFI upon interest payments by the borrower. Backers earn this GFI at the same rate as disbursed by StakingRewards for staking FIDU, plus an additional amount of GFI that depends on the amount of interest repaid. See here for further discussion.
- This guide describes the Protocol's operation as of the time of writing (May 2022). It does not describe legacy / deprecated Protocol functionality.↩
- The DynamicLeverageRatioStrategy contract affords the option that, in future, the Protocol could use for this leverage ratio a value that is verifiably calculated off-chain and that dynamically adjusts to the composition of Backers in a given TranchedPool.↩