Skip to main content

LeverageRatioStrategy

LeverageRatioStrategy​

LEVERAGE_RATIO_DECIMALS​

uint256 LEVERAGE_RATIO_DECIMALS

invest​

function invest(contract ISeniorPool, contract ITranchedPool pool) public view returns (uint256)

Determines how much money to invest in the senior tranche based on what is committed to the junior tranche, what is committed to the senior tranche, and a leverage ratio to the junior tranche. Because it takes into account what is already committed to the senior tranche, the value returned by this function can be used "idempotently" to achieve the investment target amount without exceeding that target.

Parameters​

NameTypeDescription
contract ISeniorPool
poolcontract ITranchedPoolThe tranched pool to invest into (as the senior)

Return Values​

NameTypeDescription
[0]uint256

estimateInvestment​

function estimateInvestment(contract ISeniorPool, contract ITranchedPool pool) public view returns (uint256)

A companion of invest(): determines how much would be returned by invest(), as the value to invest into the senior tranche, if the junior tranche were locked and the senior tranche were not locked.

Parameters​

NameTypeDescription
contract ISeniorPool
poolcontract ITranchedPoolThe tranched pool to invest into (as the senior)

Return Values​

NameTypeDescription
[0]uint256The amount of money to invest into the tranched pool's senior tranche, from the senior pool

_invest​

function _invest(contract ITranchedPool pool, struct ITranchedPool.TrancheInfo juniorTranche, struct ITranchedPool.TrancheInfo seniorTranche) internal view returns (uint256)

_getTranchesInSlice​

function _getTranchesInSlice(contract ITranchedPool pool, uint256 sliceIndex) internal view returns (struct ITranchedPool.TrancheInfo, struct ITranchedPool.TrancheInfo)

Return the junior and senior tranches from a given pool in a specified slice

Parameters​

NameTypeDescription
poolcontract ITranchedPoolpool to fetch tranches from
sliceIndexuint256slice index to fetch tranches from

Return Values​

NameTypeDescription
[0]struct ITranchedPool.TrancheInfo(juniorTranche, seniorTranche)
[1]struct ITranchedPool.TrancheInfo

_sliceIndexToJuniorTrancheId​

function _sliceIndexToJuniorTrancheId(uint256 index) internal pure returns (uint256)

Returns the junior tranche id for the given slice index

Parameters​

NameTypeDescription
indexuint256slice index

Return Values​

NameTypeDescription
[0]uint256junior tranche id of given slice index

_sliceIndexToSeniorTrancheId​

function _sliceIndexToSeniorTrancheId(uint256 index) internal pure returns (uint256)

Returns the senion tranche id for the given slice index

Parameters​

NameTypeDescription
indexuint256slice index

Return Values​

NameTypeDescription
[0]uint256senior tranche id of given slice index