###### 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.
- Audit Kickoff: 8. September
## New Contracts to be audited
### NAV Feed (NEW)
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](https://docs.google.com/spreadsheets/d/1O124ru0MsdKLsOjRRUqlb4zAoIC5RNgNfQpxbAv1wNw/edit)
### 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](https://github.com/centrifuge/tinlake/blob/develop/src/lender/tranche.sol)
### 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 ](https://github.com/centrifuge/tinlake/blob/develop/src/lender/coordinator.sol)
Link: [Assessor Contract ](https://github.com/centrifuge/tinlake/blob/develop/src/lender/assessor.sol)
### Reserve (NEW)
The reserve contract holds & keeps track of all the available currency inside Tinlake.
Link: [Reserve Contract](https://github.com/centrifuge/tinlake/blob/develop/src/lender/reserve.sol)
Tinlake NAV Feed: [Link](https://github.com/centrifuge/tinlake-nftfeed)
Revolving Pool Contracts will be in the main Tinlake repository: [Link](https://github.com/centrifuge/tinlake)
## 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
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
## Additional Material
- [Tinlake 0.2.0 Documentation](https://tinlake.centrifuge.io/)
- [Tinlake 0.2.0 (Previous Audit)](https://docs.google.com/presentation/d/1XyWHoNVJEhSYDWJkKypg63rWloDgZ2tcH8epHSoE7JQ/edit#slide=id.p)
- Blog Posts NAV
- [Part I](https://medium.com/centrifuge/tinlake-pricing-and-valuation-series-part-1-how-to-price-real-world-assets-cf6655132bef)
- [Part II](https://medium.com/centrifuge/tinlake-pricing-and-valuation-series-part-2-valuing-an-asset-portfolio-247d8f2f0d5)
## Contact Centrifuge
Manuel - firstname.lastname@example.org
Alina - email@example.com