Curve
Last updated
Was this helpful?
Last updated
Was this helpful?
The Curve ADO allows users to to move a value along a curve. The owner of the ADO can specify the exact curve equation they desire. The curve can be either a growth (Value increasing) or decay (Value decreasing) based on what the owner specifies.
Exponential curves have the following form:
Where:
a
is the base value,
b
is the constant value,
and c
is the multiple variable value.
For decay curves, the formula would be:
The constants a
, c
, and b
are defined at instantiation. Users can then query the equation for the y
value given the x
value.
Currently only exponential curves are allowed.
Ado_type: curve
Version: 0.2.0
curve_config
Specifies the curve equation to use.
authorized_operator_addresses
Option<Vec<AndrAddr>>
Optional set of addresses that are authorized to update or reset the curve.
kernel_address
String
owner
Option<String>
Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified.
Specifies the equation of the curve. The equation is of the form:
For decay curves, the formula would be:
curve_id
CurveId
Whether to use a growing curve (multiple variable is taken as positive) or a decaying curve (multiple variable is taken as negative).
base_value
u64
Specifies the a
constant.
multiple_variable_value
Option<u64>
Specifies the c
constant. Defaults to 1 if not specified.
constant_value
Option<u64>
Specifies the b
constant. Defaults to 0 if not specified.
Growth
4
3
10
Decay
7
3
8
Growth
2
undefined
undefined
Updates the curve equation set at instantiation.
Only available to the contract owner or one of the authorized addresses.
Removes the curve data from the ADO. If called, the curve will no longer exist. UpdateCurveConfig can be called to create a new one.
Only available to the contract owner or one of the authorized addresses.
The rest of the execute messages can be found in the ADO Base section.
Queries the curve equation values set by the owner.
Returns a CurveConfig struct.
Specify the X value for the equation and get the Y value.
x_value
String
The x value to be used to compute the y value.
y_value
String
The y value that is computed from the specified x value.
The rest of the query messages can be found in the ADO Base section.
Contract address of the to be used for messaging. Kernel contract address can be found in our .