SupplySchedule¶

Description¶

Defines the Synthetix inflationary supply schedule, according to which the synthetix inflationary supply is released.

Minting is performed in increments of a week whenever recordMintEvent is called from Synthetix.mint. Minting can be called weekly after the time elapses for more than 7 days. These accrue so that no tokens are lost even if minting is not performed for several periods; the accrued total is minted at the next invocation. These computations are covered in more detail in the mintableSupply description.

The supply decay follows an exponential decay formula calculated for each week.

supplyForWeek = Initial Weekly Supply * (1 - rate of decay) ^ number of weeks

Source: contracts/SupplySchedule.sol

Architecture¶

Inheritance Graph¶

graph TD SupplySchedule[SupplySchedule] --> Owned[Owned]

Constants¶

DECAY_RATE¶

Source

Type: uint256

INFLATION_START_DATE¶

Source

The timestamp at which the inflationary SNX supply began to be minted.

Value: 1551830400 (2019-03-06T00:00:00+00:00)

Type: uint256

INITIAL_WEEKLY_SUPPLY¶

Source

The amount of tokens being issued weekly before exponential decay started. Used to calculate the supply each week once decay starts.

Value: 1442307692307692307692307 - 75e6 / 52

Type: uint256

MAX_MINTER_REWARD¶

Source

Type: uint256

MINT_BUFFER¶

Source

A buffer added to the lastMintEvent to ensure that synthetix rewards are issued after a feePeriod closes.

Value: 1 days

Type: uint256

MINT_PERIOD_DURATION¶

Source

The duration of each minting period. This is constant at one week.

Value: 1 weeks

Type: uint256

SUPPLY_DECAY_END¶

Source

Week number when supply decay ends. Used along with weekCounter to determine when decay supply should end.

Inflation after this week would become be on the terminal inflation schedule.

Value: 234

Type: uint8

SUPPLY_DECAY_START¶

Source

Week number when supply decay starts. Used along with weekCounter to determine when decay supply starts.

Value: 40

Type: uint8

TERMINAL_SUPPLY_RATE_ANNUAL¶

Source

Type: uint256

Variables¶

lastMintEvent¶

Source

The timestamp when new supply was last minted - Is set to the number of weeks since inflation start date plus a minting buffer to allow feePeriod to close first.

Type: uint256

minterReward¶

Source

Used as the quantity of SNX to reward the caller of Synthetix.mint, which incentivises users to continue minting the inflationary supply over time. Initialised to 200 SNX.

Type: uint256

synthetixProxy¶

Source

The address of the main SynthetixProxy contract.

Type: address payable

weekCounter¶

Source

Counter to record the number of weeks inflation has been issued and calculate the applicable supply to add based on the current weekCounter.

Type: uint256

Constructor¶

constructor¶

Source

Sets up the minting schedule and the inherited Owned instance.

Details

Signature

(address _owner, uint256 _lastMintEvent, uint256 _currentWeek)

Visibility

public

State Mutability

nonpayable

Views¶

isMintable¶

Source

Returns true if minting from the inflationary supply is permitted at the present time.

This means that tokens are only mintable once a week.

Details

Signature

isMintable() returns (bool)

Visibility

public

State Mutability

view

mintableSupply¶

Source

Returns the number of tokens currently mintable from the inflationary supply.

If isMintable returns false, this is $0$. Otherwise, it is the number of tokens accruing per week in the current year, multiplied by the number of whole weeks since the last mint event.

Details

Signature

mintableSupply() returns (uint256)

Visibility

external

State Mutability

view

terminalInflationSupply¶

Source

Details

Signature

terminalInflationSupply(uint256 totalSupply, uint256 numOfWeeks) returns (uint256)

Visibility

public

State Mutability

pure

tokenDecaySupplyForWeek¶

Source

Details

Signature

tokenDecaySupplyForWeek(uint256 counter) returns (uint256)

Visibility

public

State Mutability

pure

weeksSinceLastIssuance¶

Source

This just returns its argument floor divided by MINT_PERIOD_DURATION. Since this is only used in mintableSupply() it seems as if a variable would have done better than a public function.

Details

Signature

weeksSinceLastIssuance() returns (uint256)

Visibility

public

State Mutability

view

Restricted Functions¶

recordMintEvent¶

Source

This is called within Synthetix.mint to declare that the outstanding inflationary supply of tokens has been minted before they are actually distributed.

When called, this function adds a quantity of mintableSupply() tokens to the current schedule.totalSupplyMinted entry, and updates the lastMintEvent timestamp.

Although this function has no check that any tokens actually are mintable when it is called, the Synthetix contract requires it to be the case, so double calls should not occur. Similarly, the function does not itself enforce that the actual token supply has been increased by Synthetix in a manner consistent with the defined schedule and must simply trust that this compact is observed.

The function always returns true if the transaction was not reverted.

Details

Signature

recordMintEvent(uint256 supplyMinted) returns (bool)

Visibility

external

State Mutability

nonpayable

Modifiers

Emits

setMinterReward¶

Source

Allows the owner to set the current minter reward.

Details

Signature

setMinterReward(uint256 amount)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

setSynthetixProxy¶

Source

Allows the owner to set the synthetix address.

Details

Signature

setSynthetixProxy(contract ISynthetix _synthetixProxy)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

Modifiers¶

onlySynthetix¶

Source

Reverts the transaction if msg.sender is not the synthetix address. Synthetix address is found by lookup to the proxy.target().

Events¶

MinterRewardUpdated¶

Source

Records that the minter reward was updated.

Signature: MinterRewardUpdated(uint256 newRewardAmount)

SupplyMinted¶

Source

Records that a quantity of new tokens was minted.

Signature: SupplyMinted(uint256 supplyMinted, uint256 numberOfWeeksIssued, uint256 lastMintEvent, uint256 timestamp)

SynthetixProxyUpdated¶

Source

Signature: SynthetixProxyUpdated(address newAddress)