Skip to content
Itamar Reif edited this page Nov 12, 2021 · 1 revision

Welcome to the TezFin wiki!

This project is the implementation of Compound Protocol on Tezos chain using SmartPy language.

The diagram demonstrates relations between contracts

The platform consists of the following contracts

  • Governance - admin contract that has the ability to change parameters in Comptroller and CTokens. The first version of Tezfin has a centralized Governance that works as an admin proxy
  • Comptroller - the risk management layer. It determines how much collateral a user is required to maintain, and whether (and by how much) a user can be liquidated. Each time a user interacts with a cToken, the Comptroller is asked to approve or deny the transaction
    • Price oracle - third-party contract that provides price data. Used by Comptroller for liquidity calculation
  • CToken - Tezfin market for the underlying token
    • Interest Rate Model - specifies rules of acquiring interest rate and borrow rate
    • Underlying token - the contract of the actual asset. Tezfin supports both FA1.2 and FA2 tokens

Project structure

SmartPy CLI is required to interact with contracts. For installation please refer to https://smartpy.io/cli/

Code is organized in the following structure

General information

How to run Unit-tests

How to Compile and Deploy contracts

Code description

The description of error codes returned by the contracts: Error-codes

Basic usage description: Usage

CToken description: CToken

Comptroller description: Comptroller