tags: tinlake

Tinlake 0.3.0 Audit

Executive Summary

Tinlake v3 enables revolving investment pools, meaning that investors can redeem and invest TIN and DROP tokens on an ongoing basis.

The investment and redeemtion of tokens is executed in periodically epochs (e.g 24h) for which investors can place orders. The calculation of the token prices for an investment or redeemtion requires a net asset value (NAV) evaluation of the ongoing loans based on the underlying collaterals.

In the scope of the audit are the new contracts in Tinlake to enable a revolving pool and the contract which can calculate the current NAV.

Timeline

  • Audit Kickoff: 8. September

New Contracts to be audited

The NFT Feed contract that manages the collateral appraisals and based on that returns the current Net Asset Value (NAV) of the entire Tinlake pool

NAV Feed Contract: https://github.com/centrifuge/tinlake-nftfeed/blob/master/src/feed.sol

Model in Google Sheets

Tranche Contract (REFACTORED)

The tranche contract allows users to place orders for investment and token redeemtions for epochs. After an epoch is over and has been executed by the epoch contract users can disburse their tokens or currency.

The fulfillment of an order depends on the currency available and the minimum junior tranche ratio (as known from the Tinlake v2 spec).

Tinlake will run to instance of the contract one for the senior and one for the junior tranche.

Link: Tranche Contract

Epoch Coordinator Contract (NEW)

The epoch coordinator calculates the token price and percentage of reedemention & investment orders which can be fulfilled in an epoch for each tranche. The calculation is based on the total amount of invest and redeem orders, the current equity ratio, total amount of repayments, currency available and the priority of order types (Example: redeem comes before invest).

All users that place orders within the same epoch are treated equaly independant order volume and submission time don’t result in preferences.

Link: Coordinator Contract
Link: Assessor Contract

Reserve (NEW)

The reserve contract holds & keeps track of all the available currency inside Tinlake.

Link: Reserve Contract

Repositories

Tinlake NAV Feed: Link

Revolving Pool Contracts will be in the main Tinlake repository: Link

What we will provide

In addition to the source code we will provide the following document before the audit starts.

  • Updated contract system diagram
  • Tinlake v3 documentation
  • Revolving Pool Tech Spec
    • Flowcharts of the critical functions
  • Revolving Pool Model in excel
    • Simulation of the financial behaviour in Excel
  • NAV Tech Spec
  • Nav Model in excel
  • Contract System Tests

Note

Overall we reduced the code complexity of Tinlake by removing all the modular contracts.

Lender Contracts Removed

  • Distributor Contract
  • Assessor Contract
  • FullInvestment Assessor
  • Whitelist Operator Contract
  • Approval Operator Contract

Borrower Contracts Removed

  • Principal Contract
  • CreditLine Contract
  • Threshold Contract
  • PricePool

Additional Material

Contact Centrifuge

Manuel - manuel@centrifuge.io
Alina - alina@centrifuge.io

Select a repo