Fund
The address of the underlying asset.
>>> fund.tokenUnderlying()
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
Getter for one of the addresses of
tranche
: QUEEN (0), BISHOP (1) or ROOK (2).>>> fund.tokenShare(0)
'0x93ef1Ea305D11A9b2a3EbB9bB4FCc34695292E7d'
The address of the primary market contract.
>>> fund.primaryMarket()
'0xcD0B4D35cc6Ec86d1D52b8Eb07b5d029e39bA70E'
Getter for the upcoming primary market upgrade, if any.
The TWAP Oracle of the underlying asset.
>>> fund.twapOracle()
'0x2BaC57D29570Fe56B60216c26dA3C5B5c804B916'
The address of the fee collector of the fund.
>>> fund.feeCollector()
'0xbc428f6573827Db9773F9e4bC1f5C899c884842c'
It calculates the trading day end timestamp of the given
timestamp
. A trading day starts at UTC time SETTLEMENT_TIME
of a day (inclusive) and ends at the same time of the next day (exclusive).>>> fund.endOfDay(1604214000)
'1604239200'
Getter for the total supply of
tranche
.>>> fund.trancheTotalSupply(0)
'144207156642170957094'
Getter for the number of historical rebalances.
>>> fund.getRebalanceSize()
'1'
Getter for the Rebalance parameters of a given rebalance version.
>>> fund.getRebalance(0)
ratioB2Q: '442549502169234'
ratioR2Q: '0'
ratioBR: '474988241234265736'
timestamp: '1668702923'
The end timestamp of the current trading day.
>>> fund.currentDay()
'1670248800'
The amount of BISHOP received by splitting one QUEEN. This ratio changes on every rebalance.
>>> fund.splitRatio()
'594418130555555555274'
Getter for past split ratio of a given rebalance version.
>>> fund.historicalSplitRatio(0)
'805392577500508333333'
Getter for the start timestamp of the current activity window of the fund.
>>> fund.fundActivityStartTime()
'1670162400'
Check if the fund is currently active.
Getter for the equivalent amount of BISHOP supply if all QUEEN are split.
>>> fund.getEquivalentTotalB()
'85719348463971426438951'
Getter for the equivalent amount of QUEEN supply if all BISHOP and ROOK are merged.
>>> fund.getEquivalentTotalQ()
'144207156642170957094'
Getter for the past equivalent total amount of BISHOP on a given
day
.>>> fund.historicalEquivalentTotalB(1669903200)
'85717176424199353954085'
Getter for the past net asset values on a given
day
.>>> fund.historicalNavs(1669903200)
navB: '1002161928302678888'
navR: '1159606682688588925'
It estimates the current net asset values of all tranches, considering the current underlying
price
, the accrued protocol fee and interest since the previous settlement.Getter for the past underlying amount on a given
day
.>>> fund.historicalUnderlying(1669903200)
'144402940283113283926'
Getter for the current total underlying amount.
>>> fund.getTotalUnderlying()
'144439536988113283926'
Getter for the current total underlying amount in strategy contract.
>>> fund.historicalUnderlying()
'128181515724000000000'
Getter for the amount of underlying that the fund owes the primary market for redemption.
>>> fund.getTotalDebt()
'0'
Get the results of share amounts
amountQ
, amountB
, amountR
after performing the rebalance at index
.- Note that this function performs no bounds checking on the given index; the transformation of a non-existent rebalance will result in undefined behavior.
>>> fund.doRebalance(1000000000000000000, 1000000000000000000, 1000000000000000000, 0)
newAmountQ: '1000442549502169234'
newAmountB: '474988241234265736'
newAmountR: '474988241234265736'
Get the results of share amounts
amountQ
, amountB
, amountR
after performing the rebalances from fromIndex
to toIndex
.- Note that this function performs no bounds checking on the given indices. The original amounts are returned if
fromIndex
is no less thantoIndex
. A zero vector is returned iftoIndex
is greater than the number of existing rebalances.
Transform share balances of
account
to a given targetVersion
.- Note that setting
targetVersion
to zero transforms the share balances to the latest version.
Transform share allowances of
spender
approved by owner
to a given targetVersion
.- Note that setting
targetVersion
to zero transforms the share allowances to the latest version.
Get the balance of
tranche
for the account
.Get the balances of all tranches for the
account
.Get the last rebalance version for the
account
.Get the allowance approved to
spender
of tranche
by the owner
.Get the last rebalance version of
spender
's allowance by the owner
.Refresh the balances of
msg.sender
and recipient
, then transfer amount
of tranche
from msg.sender
to recipient
. It enforces the version
to be the current rebalance version.Refresh the balances of
sender
and recipient
and the allowances of msg.sender
approved by sender
, then transfer amount
of tranche
from sender
to recipient
. It enforces the version
to be the current rebalance version.Sets
amount
as the allowance of spender
over tranche
. It enforces the version
to be the current rebalance version.Last modified 15d ago