VRGDA
Authors: transmissions11 t11s@paradigm.xyz, FrankieIsLost frankie@paradigm.xyz
Sell tokens roughly according to an issuance schedule.
State Variables
targetPrice
Target price for a token, to be scaled according to sales pace.
Represented as an 18 decimal fixed point number.
int256 public immutable targetPrice;
decayConstant
Precomputed constant that allows us to rewrite a pow() as an exp().
Represented as an 18 decimal fixed point number.
int256 internal immutable decayConstant;
Functions
constructor
Sets target price and per time unit price decay for the VRGDA.
constructor(int256 _targetPrice, int256 _priceDecayPercent);
Parameters
Name | Type | Description |
---|---|---|
_targetPrice | int256 | The target price for a token if sold on pace, scaled by 1e18. |
_priceDecayPercent | int256 | The percent price decays per unit of time with no sales, scaled by 1e18. |
getVRGDAPrice
Calculate the price of a token according to the VRGDA formula.
function getVRGDAPrice(int256 timeSinceStart, uint256 sold) public view virtual returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
timeSinceStart | int256 | Time passed since the VRGDA began, scaled by 1e18. |
sold | uint256 | The total number of tokens that have been sold so far. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The price of a token according to VRGDA, scaled by 1e18. |
getTargetSaleTime
Given a number of tokens sold, return the target time that number of tokens should be sold by.
function getTargetSaleTime(int256 sold) public view virtual returns (int256);
Parameters
Name | Type | Description |
---|---|---|
sold | int256 | A number of tokens sold, scaled by 1e18, to get the corresponding target sale time for. |
Returns
Name | Type | Description |
---|---|---|
<none> | int256 | The target time the tokens should be sold by, scaled by 1e18, where the time is relative, such that 0 means the tokens should be sold immediately when the VRGDA begins. |