Core.sol
The user accessible functions in the core contract.
Deposit Function
To deposit underlying
ERC20 Token into the respective stream.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._amountUnderlying
: the quantity of underlying tokens user wishes to deposit
Redeem Yield Function
To Redeem underlying yield for corresponding YT.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._epoch
: the index of the future against which yield will be redeemed.
Redeem Principle Function
To Redeem underlying principle for corresponding OT.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._epoch
: the index of the future against which principle will be redeemed.
Expire Epoch Function
Expires the previous epoch so that the funds can become claimable.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._epoch
: the index of the future against which principle will be redeemed._epochAddress
: address of the expired future instance
Get Current Epoch Function
Get the current future index for a given stream.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together.
Get Epoch Address Function
Get the address of future for a given stream and index.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._epoch
: the index of the future.
getOTYTCount Function
Returns the amount of Ot and Yt tokens a user would receive on depositing the money at a given instance.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._amountUnderlying
: the underlying amount the user is going to deposit.
IsStreamInitialized Function
Check if a given stream is initialized.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together.
getYieldRemaining Function
Get the yield generated in a given epoch of a stream.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._epoch
: the index of the future.
getPrincipleRemaining Function
Get the principle remaining in a given epoch of a stream.
_streamKey
: name of the stream, created by hashing protocol, underlying, duration together._epoch
: the index of the future.
getStreamKey Function
Get the unique name of the stream, created by hashing protocol, underlying, duration.
_protocol
: name of the protocol. eg - AAVE/COMP._underlying
: address of the token kept as underlying. eg - DAI._duration
: number of blocks the future will run before renewing.
Last updated