RoC Stable Platform - Collateral RIF Token
  • Introduction
  • RIF On Chain platform
    • Main concepts
    • System states
    • Public actions
      • User actions
      • Process actions
    • Contracts architecture
      • MoC
      • CommissionSplitter
      • MoCState
      • MoCBucketContainer
      • MoCSettlement
      • MoCHelperLib
      • MoCLibConnection
      • MoCConverter
      • MoCExchange
      • MoCConnector
      • MoCRiskProxManager
      • MoCInrate
      • MoCVendors
      • MoCWhitelist
      • MoCBase
      • OwnerBurnableToken
      • RiskProToken
      • StableToken
      • MoCToken
      • PriceProvider
    • Contract mocks
    • Relevant patterns and choices
    • Data dictionary
    • Getting started
  • Integration with RoC platform
    • Introduction to RoC
      • The MoC Contract
      • RoC Precisions
      • RoC State Contracts
    • Getting RIFPros
      • Minting RIFPros
      • Redeeming RIFPros
    • Getting USDRIF
      • Minting USDRIF
      • Redeeming USDRIF
        • On Settlement: redeemStableTokenRequest
        • On Settlement: alterRedeemRequestAmount
        • Outside Settlement: redeemFreeStableToken
        • On Liquidation State: redeemAllStableToken
        • How-to
    • Commission fees values
    • Vendors
    • Fees calculation
    • From outside the blockchain
      • Using RSK nodes
      • Using web3
      • Official RIF On Chain ABIs
      • Events
      • Example code minting RIFPros
      • Example code minting RIFPros without Truffle
      • Example code redeeming RIFPros
      • Example code redeeming RIFPros without Truffle
      • Example code minting USDRIF
      • Example code redeeming free USDRIF
      • Example code redeeming USDRIF Request
      • Example code redeeming all USDRIF
  • Smart contracts
    • Contracts verification
    • ABIs documentation
      • Blockable
      • Blocker
      • ERC20Mintable
      • Governed
      • Initializable
      • MakeStoppable
      • MakeUnstoppable
      • MoC
      • MoCBucketContainer
      • MoCConnector
      • MoCConverter
      • MoCEMACalculator
      • MoCExchange
      • MoCHelperLib
      • MoCHelperLibMock
      • MoCInrate
      • MoCInrateRiskproxChanger
      • MoCLibConnection
      • MoCPriceProviderMock
      • MoCReserve
      • MoCRiskProxManager
      • MoCSettlement
      • MoCSettlementMock
      • MoCState
      • MoCStateMock
      • MoCToken
      • MoCVendors
      • MoCWhitelist
      • MocInrateStableChanger
      • MockBlocker
      • MockMakeStoppable
      • MockMakeUnstoppable
      • MockStopper
      • MockUpgradeDelegator
      • MockUpgraderTemplate
      • OwnerBurnableToken
      • Pausable
      • PriceFeed
      • PriceFeederAdder
      • PriceFeederRemover
      • PriceProvider
      • PriceProviderChanger
      • PriceProviderMock
      • ReserveToken
      • RiskProToken
      • StableToken
      • Stoppable
      • Stopper
      • UpgradeDelegator
      • UpgraderTemplate
Powered by GitBook
On this page
  • Structs
  • MocLibConfig
  • Contract Members
  • Functions
  • getMaxInt
  • inrateAvg
  • spotInrate
  • potential
  • avgInt
  • integral
  • abundanceRatio
  • riskProSpotDiscountRate
  • maxRiskProWithDiscount
  • maxRiskProWithDiscountAux
  • lockedReserveTokens
  • liquidationPrice
  • riskProTecPrice
  • riskProxRiskProPrice
  • applyDiscountRate
  • getInterestCost
  • coverage
  • leverageFromCoverage
  • leverage
  • stableTokensResTokensValue
  • riskProResTokensValuet
  • maxStableToken
  • maxStableTokenAux
  • maxRiskPro
  • totalRiskProInResTokens
  • maxStableTokensWithResTokens
  • maxRiskProWithResTokens
  • bucketTransferAmount
  • maxRiskProxResTokenValue
  • maxMoCWithReserveToken
  • mocReserveTokenValue
  • mulr
  • pow
  1. Smart contracts
  2. ABIs documentation

MoCHelperLib

PreviousMoCExchangeNextMoCHelperLibMock

Last updated 2 years ago

View Source:

MoCHelperLib - version: 0.1.10

Structs

MocLibConfig

struct MocLibConfig {
 uint256 reservePrecision,
 uint256 dayPrecision,
 uint256 mocPrecision
}

Contract Members

Constants & Variables

uint256 internal constant UINT256_MAX;

Functions

getMaxInt

Returns max uint256 value constant.

function getMaxInt(struct MoCHelperLib.MocLibConfig ) public pure
returns(uint256)

Returns

max uint256 value constant

Arguments

Name
Type
Description

struct MoCHelperLib.MocLibConfig

inrateAvg

Calculates average interest using integral function: T = Rate = a * (x ** b) + c

function inrateAvg(struct MoCHelperLib.MocLibConfig config, uint256 tMax, uint256 power, uint256 tMin, uint256 abRat1, uint256 abRat2) public view
returns(uint256)

Returns

average interest rate [using mocPrecision]

Arguments

Name
Type
Description

config

struct MoCHelperLib.MocLibConfig

tMax

uint256

maxInterestRate [using mocPrecision]

power

uint256

factor [using noPrecision]

tMin

uint256

minInterestRate C0 stableToken amount [using mocPrecision]

abRat1

uint256

initial abundance ratio [using mocPrecision]

abRat2

uint256

final abundance ratio [using mocPrecision]

spotInrate

Calculates spot interest rate that RiskProx owners should pay to RiskPro owners: Rate = tMax * (abRatio ** power) + tMin

function spotInrate(struct MoCHelperLib.MocLibConfig config, uint256 tMax, uint256 power, uint256 tMin, uint256 abRatio) public view
returns(uint256)

Arguments

Name
Type
Description

config

struct MoCHelperLib.MocLibConfig

tMax

uint256

max interest rate [using mocPrecision]

power

uint256

power to use in the formula [using NoPrecision]

tMin

uint256

min interest rate [using mocPrecision]

abRatio

uint256

bucket C0 abundance Ratio [using mocPrecision]

potential

Calculates potential interests function with given parameters: Rate = a * (x ** b) + c

function potential(struct MoCHelperLib.MocLibConfig config, uint256 a, uint256 b, uint256 c, uint256 value) public view
returns(uint256)

Arguments

Name
Type
Description

config

struct MoCHelperLib.MocLibConfig

a

uint256

maxInterestRate [using mocPrecision]

b

uint256

factor [using NoPrecision]

c

uint256

minInterestRate C0 stableToken amount [using mocPrecision]

value

uint256

global stableToken amount [using mocPrecision]

avgInt

Calculates average of the integral function: T = ( (c * xf + ((a * (xf ** (b + 1))) / (b + 1))) - (c * xi + ((a * (xi ** (b + 1))) / (b + 1))) ) / (xf - xi)

function avgInt(struct MoCHelperLib.MocLibConfig config, uint256 a, uint256 b, uint256 c, uint256 value1, uint256 value2) public view
returns(uint256)

Returns

average interest rate [using mocPrecision]

Arguments

Name
Type
Description

config

struct MoCHelperLib.MocLibConfig

a

uint256

maxInterestRate [using mocPrecision]

b

uint256

factor [using NoPrecision]

c

uint256

minInterestRate C0 stableToken amount [using mocPrecision]

value1

uint256

value to put in the function [using mocPrecision]

value2

uint256

value to put in the function [using mocPrecision]

integral

Calculates integral of the exponential function: T = c * (value) + (a * value ** (b + 1)) / (b + 1))

function integral(struct MoCHelperLib.MocLibConfig config, uint256 a, uint256 b, uint256 c, uint256 value) public view
returns(uint256)

Returns

integration result [using mocPrecision]

Arguments

Name
Type
Description

config

struct MoCHelperLib.MocLibConfig

a

uint256

maxInterestRate [using mocPrecision]

b

uint256

factor [using NoPrecision]

c

uint256

minInterestRate C0 stableToken amount [using mocPrecision]

value

uint256

value to put in the function [using mocPrecision]

abundanceRatio

Relation between stableTokens in bucket 0 and StableToken total supply

function abundanceRatio(struct MoCHelperLib.MocLibConfig config, uint256 stableToken0, uint256 stableTokent) public view
returns(uint256)

Returns

abundance ratio [using mocPrecision]

Arguments

Name
Type
Description

config

struct MoCHelperLib.MocLibConfig

stableToken0

uint256

stableToken count in bucket 0 [using mocPrecision]

stableTokent

uint256

total stableToken supply [using mocPrecision]

riskProSpotDiscountRate

Returns the Ratio to apply to RiskPro Price in discount situations: SpotDiscountRate = TPD * (utpdu - cob) / (uptdu -liq)

function riskProSpotDiscountRate(struct MoCHelperLib.MocLibConfig libConfig, uint256 riskProLiqDiscountRate, uint256 liq, uint256 utpdu, uint256 cov) public view
returns(uint256)

Returns

Spot discount rate [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

riskProLiqDiscountRate

uint256

Discount rate applied at Liquidation level coverage [using mocPrecision]

liq

uint256

Liquidation coverage threshold [using mocPrecision]

utpdu

uint256

Discount coverage threshold [using mocPrecision]

cov

uint256

Actual global Coverage threshold [using mocPrecision]

maxRiskProWithDiscount

Max amount of RiskPro to available with discount: MaxRiskProWithDiscount = (uTPDU * nStableToken * PEG - (nReserve * B)) / (TPusd * TPD)

function maxRiskProWithDiscount(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 nStableToken, uint256 utpdu, uint256 peg, uint256 reservePrice, uint256 riskProUsdPrice, uint256 spotDiscount) public view
returns(uint256)

Returns

Total RiskPro amount [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

Total ReserveTokens amount [using reservePrecision]

nStableToken

uint256

StableToken amount [using mocPrecision]

utpdu

uint256

Discount coverage threshold [using mocPrecision]

peg

uint256

peg value

reservePrice

uint256

ReserveTokens price [using mocPrecision]

riskProUsdPrice

uint256

riskProUsdPrice [using mocPrecision]

spotDiscount

uint256

spot discount [using mocPrecision]

maxRiskProWithDiscountAux

Max amount of RiskPro to available with discount: MaxRiskProWithDiscount = (uTPDU * nStableToken * PEG - (nReserve * B)) / (TPusd * TPD)

function maxRiskProWithDiscountAux(struct MoCHelperLib.MocLibConfig libConfig, uint256 nbUsdValue, uint256 nStableToken, uint256 utpdu, uint256 peg, uint256 riskProDiscountPrice) internal view
returns(uint256)

Returns

Total RiskPro amount [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nbUsdValue

uint256

Total amount of ReserveTokens in USD [using mocPrecision]

nStableToken

uint256

StableToken amount [using mocPrecision]

utpdu

uint256

Discount coverage threshold [using mocPrecision]

peg

uint256

peg value

riskProDiscountPrice

uint256

riskProUsdPrice with discount applied [using mocPrecision]

lockedReserveTokens

Calculates Locked ReserveTokens

function lockedReserveTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 reservePrice, uint256 nStableToken, uint256 peg) public view
returns(uint256)

Returns

Locked ReserveTokens [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

reservePrice

uint256

ReserveTokens price [using mocPrecision]

nStableToken

uint256

StableTokens amount [using mocPrecision]

peg

uint256

peg value

liquidationPrice

Calculates price at liquidation event as a relation between the stableToken total supply and the amount of ReserveTokens available to distribute

function liquidationPrice(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokenAmount, uint256 nStableToken) public view
returns(uint256)

Returns

Price at liquidation event [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

resTokenAmount

uint256

ReserveTokens to distribute [using reservePrecision]

nStableToken

uint256

StableTokens amount [using mocPrecision]

riskProTecPrice

Calculates RiskPro ReserveTokens: (nReserve-LB) / nTP

function riskProTecPrice(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 lb, uint256 nTP) public view
returns(uint256)

Returns

RiskPro ReserveTokens price [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

Total ReserveTokens amount [using reservePrecision]

lb

uint256

Locked ReserveTokens amount [using reservePrecision]

nTP

uint256

RiskPro amount [using mocPrecision]

riskProxRiskProPrice

Calculates RiskPro ReserveToken price: RiskProxInRiskPro = riskProxTecPrice / riskProPrice

function riskProxRiskProPrice(struct MoCHelperLib.MocLibConfig libConfig, uint256 riskProxTecPrice, uint256 riskProPrice) public view
returns(uint256)

Returns

RiskProx price in RiskPro [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

riskProxTecPrice

uint256

RiskProx ReserveTokens price [using reservePrecision]

riskProPrice

uint256

Trog ReserveTokens price [using reservePrecision]

applyDiscountRate

Returns a new value with the discountRate applied: (price)* (1 - discountRate)

function applyDiscountRate(struct MoCHelperLib.MocLibConfig libConfig, uint256 price, uint256 discountRate) public view
returns(uint256)

Returns

Price with discount applied [using SomePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

price

uint256

Price [using SomePrecision]

discountRate

uint256

Discount rate to apply [using mocPrecision]

getInterestCost

Returns the amount of interest to pay: = price * interestRate

function getInterestCost(struct MoCHelperLib.MocLibConfig libConfig, uint256 value, uint256 interestRate) public view
returns(uint256)

Returns

Interest cost based on the value and interestRate [using SomePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

value

uint256

Cost to apply interest [using SomePrecision]

interestRate

uint256

Interest rate to apply [using mocPrecision]

coverage

Calculates Coverage: nReserve / LB

function coverage(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 lB) public view
returns(uint256)

Returns

Coverage [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

Total ReserveTokens amount [using reservePrecision]

lB

uint256

Locked ReserveTokens amount [using reservePrecision]

leverageFromCoverage

Calculates Leverage from Coverage: Leverage = C / (C - 1)

function leverageFromCoverage(struct MoCHelperLib.MocLibConfig libConfig, uint256 cov) public view
returns(uint256)

Returns

Leverage [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

cov

uint256

Coverage [using mocPrecision]

leverage

Calculates Leverage: Leverage = nReserve / (nReserve - lB)

function leverage(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 lB) public view
returns(uint256)

Returns

Leverage [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

Total ReserveTokens amount [using reservePrecision]

lB

uint256

Locked ReserveTokens amount [using reservePrecision]

stableTokensResTokensValue

Price in ReserveTokens of the amount of StableTokens

function stableTokensResTokensValue(struct MoCHelperLib.MocLibConfig libConfig, uint256 amount, uint256 peg, uint256 reservePrice) public view
returns(uint256)

Returns

Total value [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

amount

uint256

Total ReserveTokens amount [using reservePrecision]

peg

uint256

reservePrice

uint256

ReserveTokens price [using mocPrecision]

riskProResTokensValuet

Price in ReserveTokens of the amount of RiskPros

function riskProResTokensValuet(struct MoCHelperLib.MocLibConfig libConfig, uint256 riskProAmount, uint256 riskProResTokenPrice) public view
returns(uint256)

Returns

Total value [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

riskProAmount

uint256

amount of RiskPro [using mocPrecision]

riskProResTokenPrice

uint256

RiskPro price in ReserveTokens [using reservePrecision]

maxStableToken

Max amount of Docs to issue: MaxStableToken = ((nReserveB)-(CobjB/BconsnStableTokenPEG))/(PEG*(Cobj*B/BCons-1))

function maxStableToken(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 cobj, uint256 nStableToken, uint256 peg, uint256 reservePrice, uint256 bCons) public view
returns(uint256)

Returns

Total StableTokens amount [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

Total ReserveTokens amount [using reservePrecision]

cobj

uint256

Target Coverage [using mocPrecision]

nStableToken

uint256

StableToken amount [using mocPrecision]

peg

uint256

peg value

reservePrice

uint256

ReserveTokens price [using mocPrecision]

bCons

uint256

ReserveTokens conservative price [using mocPrecision]

maxStableTokenAux

function maxStableTokenAux(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 adjCobj, uint256 nStableToken, uint256 peg, uint256 reservePrice) internal view
returns(uint256)

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

adjCobj

uint256

nStableToken

uint256

peg

uint256

reservePrice

uint256

maxRiskPro

Max amount of RiskPro to redeem: MaxRiskPro = ((nReserveB)-(CobjnStableToken*PEG))/TPusd

function maxRiskPro(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 cobj, uint256 nStableToken, uint256 peg, uint256 reservePrice, uint256 bCons, uint256 riskProUsdPrice) public view
returns(uint256)

Returns

Total RiskPro amount [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nReserve

uint256

Total ReserveTokens amount [using reservePrecision]

cobj

uint256

Target Coverage [using mocPrecision]

nStableToken

uint256

Target Coverage [using mocPrecision]

peg

uint256

peg value

reservePrice

uint256

ReserveTokens price [using mocPrecision]

bCons

uint256

ReserveTokens conservative price [using mocPrecision]

riskProUsdPrice

uint256

riskProUsdPrice [using mocPrecision]

totalRiskProInResTokens

Calculates the total ReserveTokens price of the amount of RiskPros

function totalRiskProInResTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 amount, uint256 riskProPrice) public view
returns(uint256)

Returns

RiskPro total value in ReserveTokens [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

amount

uint256

Amount of RiskPro [using mocPrecision]

riskProPrice

uint256

RiskPro ReserveTokens Price [using reservePrecision]

maxStableTokensWithResTokens

Calculates the equivalent in StableTokens of the resTokensAmount

function maxStableTokensWithResTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokensAmount, uint256 reservePrice) public view
returns(uint256)

Returns

Equivalent StableToken amount [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

resTokensAmount

uint256

ReserveTokens amount [using reservePrecision]

reservePrice

uint256

ReserveTokens price [using mocPrecision]

maxRiskProWithResTokens

Calculates the equivalent in RiskPro of the resTokensAmount

function maxRiskProWithResTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokensAmount, uint256 riskProPrice) public view
returns(uint256)

Returns

Equivalent RiskPro amount [using mocPrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

resTokensAmount

uint256

ReserveTokens amount [using reservePrecision]

riskProPrice

uint256

RiskPro ReserveTokens price [using reservePrecision]

bucketTransferAmount

Calculates the ResToken amount to move from C0 bucket to an L bucket when a RiskProx minting occurs: toMove = resTokensAmount * (lev - 1)

function bucketTransferAmount(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokensAmount, uint256 lev) public view
returns(uint256)

Returns

resTokens to move [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

resTokensAmount

uint256

Total ReserveTokens amount [using reservePrecision]

lev

uint256

L bucket leverage [using mocPrecision]

maxRiskProxResTokenValue

Max amount of ReserveTokens allowed to be used to mint riskProx: MaxriskProx = nStableToken/ (PEGB(lev-1))

function maxRiskProxResTokenValue(struct MoCHelperLib.MocLibConfig libConfig, uint256 nStableToken, uint256 peg, uint256 reservePrice, uint256 lev) public view
returns(uint256)

Returns

Max riskProx ReserveTokens value [using reservePrecision]

Arguments

Name
Type
Description

libConfig

struct MoCHelperLib.MocLibConfig

nStableToken

uint256

number of StableToken [using mocPrecision]

peg

uint256

peg value

reservePrice

uint256

ReserveTokens price [using mocPrecision]

lev

uint256

leverage [using mocPrecision]

maxMoCWithReserveToken

Calculates the equivalent in MoC of the reserve token

function maxMoCWithReserveToken(struct MoCHelperLib.MocLibConfig , uint256 resTokensAmount, uint256 reservePrice, uint256 mocPrice) public pure
returns(uint256)

Returns

Equivalent MoC amount

Arguments

Name
Type
Description

struct MoCHelperLib.MocLibConfig

resTokensAmount Total ReserveTokens amount

resTokensAmount

uint256

Total ReserveTokens amount

reservePrice

uint256

ReserveTokens price

mocPrice

uint256

MoC price

mocReserveTokenValue

Calculates the equivalent in reserve token of the MoC amount

function mocReserveTokenValue(struct MoCHelperLib.MocLibConfig , uint256 amount, uint256 reservePrice, uint256 mocPrice) public pure
returns(uint256)

Returns

Equivalent ReserveToken amount

Arguments

Name
Type
Description

struct MoCHelperLib.MocLibConfig

amount MoC amount

amount

uint256

MoC amount

reservePrice

uint256

ReserveTokens price

mocPrice

uint256

MoC price

mulr

Rounding product adapted from DSMath but with custom precision

function mulr(uint256 x, uint256 y, uint256 precision) internal pure
returns(z uint256)

Returns

Product

Arguments

Name
Type
Description

x

uint256

Multiplicand

y

uint256

Multiplier

precision

uint256

pow

Potentiation by squaring adapted from DSMath but with custom precision

function pow(uint256 x, uint256 n, uint256 precision) internal pure
returns(z uint256)

Returns

power

Arguments

Name
Type
Description

x

uint256

Base

n

uint256

Exponent

precision

uint256

⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.

⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.

Proposal to remove leveraged positions
Proposal to remove leveraged positions
contracts/MoCHelperLib.sol
getMaxInt(struct MoCHelperLib.MocLibConfig )
inrateAvg(struct MoCHelperLib.MocLibConfig config, uint256 tMax, uint256 power, uint256 tMin, uint256 abRat1, uint256 abRat2)
spotInrate(struct MoCHelperLib.MocLibConfig config, uint256 tMax, uint256 power, uint256 tMin, uint256 abRatio)
potential(struct MoCHelperLib.MocLibConfig config, uint256 a, uint256 b, uint256 c, uint256 value)
avgInt(struct MoCHelperLib.MocLibConfig config, uint256 a, uint256 b, uint256 c, uint256 value1, uint256 value2)
integral(struct MoCHelperLib.MocLibConfig config, uint256 a, uint256 b, uint256 c, uint256 value)
abundanceRatio(struct MoCHelperLib.MocLibConfig config, uint256 stableToken0, uint256 stableTokent)
riskProSpotDiscountRate(struct MoCHelperLib.MocLibConfig libConfig, uint256 riskProLiqDiscountRate, uint256 liq, uint256 utpdu, uint256 cov)
maxRiskProWithDiscount(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 nStableToken, uint256 utpdu, uint256 peg, uint256 reservePrice, uint256 riskProUsdPrice, uint256 spotDiscount)
maxRiskProWithDiscountAux(struct MoCHelperLib.MocLibConfig libConfig, uint256 nbUsdValue, uint256 nStableToken, uint256 utpdu, uint256 peg, uint256 riskProDiscountPrice)
lockedReserveTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 reservePrice, uint256 nStableToken, uint256 peg)
liquidationPrice(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokenAmount, uint256 nStableToken)
riskProTecPrice(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 lb, uint256 nTP)
riskProxRiskProPrice(struct MoCHelperLib.MocLibConfig libConfig, uint256 riskProxTecPrice, uint256 riskProPrice)
applyDiscountRate(struct MoCHelperLib.MocLibConfig libConfig, uint256 price, uint256 discountRate)
getInterestCost(struct MoCHelperLib.MocLibConfig libConfig, uint256 value, uint256 interestRate)
coverage(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 lB)
leverageFromCoverage(struct MoCHelperLib.MocLibConfig libConfig, uint256 cov)
leverage(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 lB)
stableTokensResTokensValue(struct MoCHelperLib.MocLibConfig libConfig, uint256 amount, uint256 peg, uint256 reservePrice)
riskProResTokensValuet(struct MoCHelperLib.MocLibConfig libConfig, uint256 riskProAmount, uint256 riskProResTokenPrice)
maxStableToken(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 cobj, uint256 nStableToken, uint256 peg, uint256 reservePrice, uint256 bCons)
maxStableTokenAux(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 adjCobj, uint256 nStableToken, uint256 peg, uint256 reservePrice)
maxRiskPro(struct MoCHelperLib.MocLibConfig libConfig, uint256 nReserve, uint256 cobj, uint256 nStableToken, uint256 peg, uint256 reservePrice, uint256 bCons, uint256 riskProUsdPrice)
totalRiskProInResTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 amount, uint256 riskProPrice)
maxStableTokensWithResTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokensAmount, uint256 reservePrice)
maxRiskProWithResTokens(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokensAmount, uint256 riskProPrice)
bucketTransferAmount(struct MoCHelperLib.MocLibConfig libConfig, uint256 resTokensAmount, uint256 lev)
maxRiskProxResTokenValue(struct MoCHelperLib.MocLibConfig libConfig, uint256 nStableToken, uint256 peg, uint256 reservePrice, uint256 lev)
maxMoCWithReserveToken(struct MoCHelperLib.MocLibConfig , uint256 resTokensAmount, uint256 reservePrice, uint256 mocPrice)
mocReserveTokenValue(struct MoCHelperLib.MocLibConfig , uint256 amount, uint256 reservePrice, uint256 mocPrice)
mulr(uint256 x, uint256 y, uint256 precision)
pow(uint256 x, uint256 n, uint256 precision)