Skip to main content

VoltSystemOracle

contract that receives a fixed interest rate upon construction, and then linearly interpolates that rate over a 30.42 day period into the VOLT price after the oracle start time. Interest can compound annually. Assumption is that this oracle will only be used until Volt 2.0 ships. Maximum amount of compounding periods on this contract at 2% APR is 6192 years, which is more than enough for this use case.

Methods

TIMEFRAME

function TIMEFRAME() external view returns (uint256)

the time frame over which all changes in the APR are applied one month was chosen because this is a temporary oracle

Returns

NameTypeDescription
_0uint256undefined

compoundInterest

function compoundInterest() external nonpayable

public function that allows compounding of interest after duration has passed Sets accumulator to the current accrued interest, and then resets the timer.

getCurrentOraclePrice

function getCurrentOraclePrice() external view returns (uint256)

get the current scaled oracle price applies the change rate smoothly over a 30.42 day period scaled by 18 decimals

Returns

NameTypeDescription
_0uint256undefined

monthlyChangeRateBasisPoints

function monthlyChangeRateBasisPoints() external view returns (uint256)

current amount that oracle price is inflating by monthly in basis points

Returns

NameTypeDescription
_0uint256undefined

oraclePrice

function oraclePrice() external view returns (uint256)

acts as an accumulator for interest earned in previous periods returns the oracle price from the end of the last period

Returns

NameTypeDescription
_0uint256undefined

periodStartTime

function periodStartTime() external view returns (uint256)

start time at which point interest will start accruing, and the current ScalingPriceOracle price will be snapshotted and saved

Returns

NameTypeDescription
_0uint256undefined

Events

InterestCompounded

event InterestCompounded(uint256 periodStart, uint256 newOraclePrice)

event emitted when the Volt system oracle compounds emits the end time of the period that completed and the new oracle price

Parameters

NameTypeDescription
periodStartuint256undefined
newOraclePriceuint256undefined