Skip to content

tranche-jibrel/tranche-yearn-protocol

Repository files navigation

Yearn Tranche Protocol

Tranche Logo

Yearn Tranche is a decentralized protocol for managing risk and maximizing returns. The protocol integrates with Yearn's yTokens and yVaults, to create two new interest-bearing instruments, one with a fixed-rate, Tranche A, and one with a variable rate, Tranche B.

Info URL: https://docs.tranche.finance/tranchefinance/

Development

Install Dependencies

npm i

Compile project

truffle compile --all

Run test

truffle run test

Code Coverage

truffle run coverage

or to test a single file:

truffle run coverage --network development --file="<filename>"   

Test coverage on JYearn contract: 94.41%

(Back to top)

Tranche Yearn Protocol Usage

Please refer to ./migrations/1_deploy_contracts.js file to see how the system could be deployed on the blockchain

Users can now call buy and redeem functions for tranche A & B tokens

Note: if ETH tranche is deployed, please deploy ETHGateway contract without a proxy, then set its address in JCompound with setETHGateway function.

(Back to top)

Tranche Migration to new Yearn version

You can migrate to a different Yearn version vault or token simply calling the following function:

migrateYTranche(uint256 _trancheNum, address _newYTokenAddress, bool _isVault)

All values will be sent to new vault and tokens inside contract will be switched with the new one, no other change

(Back to top)

Test Coverage

Name Test % Notes
JAdminTools 57.89% ---
JFeesCollector 6.25% ---
JTrancheDeployer 80% ---
JTrancheTokens 100% ---
JYearn 91.88% ---

(Back to top)

Main contracts - Name, Size and Description

Name Size (KiB) Description
JAdminTools 2.27 Contract for administrative roles control (implementation), allowing the identification of addresses when dealing with reserved methods. Upgradeable.
JAdminToolsStorage 0.72 Contract for administrative roles control (storage)
JFeesCollector 9.29 Fees collector and uniswap swapper (implementation), it changes all fees and extra tokens into new interests for token holders, sending back extra mount to Compound protocol contract. Upgradeable.
JFeesCollectorStorage 0.82 Fees collector and uniswap swapper (storage)
JTrancheAToken 6.84 Tranche A token, with a non decreasing price, making possible for holders to have a fixed interest percentage. Not upgradeable.
JTrancheBToken 6.84 Tranche B token, with a floating price, making possible for holders to have a variable interest percentage. Not upgradeable.
JTranchesDeployer 18.46 Tranche A & B token deployer (implementation): this contract deploys tranche tokens everytime a new tranche is opened by the core protocol contract. Upgradeable.
JTranchesDeployerStorage 0.17 Tranche A & B token deployer (storage)
JYearn 19.17 Core contract protocol (implementation). It is responsible to make all actions to give the exact amount of tranche token to users, connecting with Yearn to have interest rates and other informations to give tokens the price they should have block by block. It also opens new tranches, and, via Tranche Deployer contract, it deploys new tranche tokens. Upgradeable.
JYearnStorage 1.74 Core contract protocol (storage)

(Back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published