Formulas
with both
and
interest accrual factors (and not interest rates) and where it is assumed that one full year consists of 31622400 seconds (366 days with 86400 seconds each).
with both
and
interest accrual factors (and not interest rates) and where it is assumed that one full year consists of 31622400 seconds (366 days with 86400 seconds each).
where
is the current
block.timestamp
and is the collateral asset’s
maturity
both expressed in seconds.
where it is assumed that
.
The following correction has to be performed on the resulting amount
to avoid rounding errors due to precision loss:
where
and
are the FIAT/underlying and underlying/collateral exchange rates including price impact and slippage.
where
is the deposited underlier amount and
is the underlying/collateral exchange rate including price impact and slippage.
where
is the deposited underlier amount and
and
are the FIAT/underlying and underlying/collateral exchange rates including price impact and slippage.
where
and
are the position collateral and debt, and
is the withdrawn collateral amount.
where
is the position collateral and
the withdrawn collateral amount.
where
and
are the position collateral and debt, and
is the withdrawn collateral amount. It is thus assumed that
and
as the computation would otherwise yield an invalid result.
where
is the withdrawn collateral amount,
is the flashloan amount used for the withdrawal, and
and
are the underlying/FIAT and collateral/underlying exchange rates including price impact and slippage.
Note that for a collateral asset beyond its maturity the formula remains intact with the difference that the input underlying/collateral exchange rate is fixed, i.e.
.
where
is the estimated underlier amount withdrawn at maturity (i.e. with an input of
and
) and
is the deposited underlier amount. It is further assumed that the collateral token can be redeemed for underlier tokens at a rate of
.
where
is the deposited underlier amount and
is the estimated
profitAtMaturity
.
where
is the estimated
amountOut
without accounting for slippage.Last modified 1d ago