Rates
The Rates ADO is a smart contract that can be used to hold rates configurations for other ADOs. Instead of setting up the rate on the ADO itself, the ADO can reference this ADO to extract the rates set up and apply them on the ADO. These rates can be used to add a fee that is payed on a messages whether a tax or royalty.
We have seen in the AndromedaMsg section that rates can be applied on ADOs that have the rates feature enabled. This ADO can be referenced by those ADOs to apply the rates specified here.
ado_type: rates
Version: 2.0.1-beta.1
InstantiateMsg
By actions, we are referring to execute messages.
Name | Type | Description |
---|---|---|
| String | The message to apply the rates on. |
| The rate configurations. | |
| String | Contract address of the kernel contract to be used for AMP messaging. Kernel contract address can be found in our deployed contracts. |
| Option<String> | Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified. |
ExecuteMsg
SetRate
Only available to the ADO owner
Sets a rate on the specified action.
Name | Type | Description |
---|---|---|
| String | The execute message to add rates on. |
| The rate configurations. |
LocalRate
Name | Type | Description |
---|---|---|
| The type of rate. | |
| Vec<Recipient> | The addresses to recieve the rates. Each address specified will receive the full amount of rate. For example, having a rate of 5% and 2 recipients means each address will receive a 5% rate. |
| The amount of funds taken. | |
| Option<String> | Optional description for the purpose of the rate. |
LocalRateType
An enum specifying the type of the rate.
Additive: The rate amount acts as a tax and is added to the price and payed by the buyer. For example a 10% additive rate (with one recipient) on a price of 1000 uandr means the buyer has to send 1100 uandr.
Deductive: The rate amount acts as a royalty and is deducted from the price. For example a 10% deductive rate on a price of 1000 uandr means the buyer needs to send 1000 uand and 100 will be taken to the recipient of the rate.
LocalRateValue
Percentage is specified as a decimal. This means a rate of 10% is specified as 0.1 and not 10.
Percent: The rate is specified as a percentage of the price using decimal.
Flat: The rate is specified as a fixed amount of Coin.
RemoveRate
Only available to the ADO owner.
Removes the rate set on the specified action.
Name | Type | Description |
---|---|---|
| String | The execute message to remove the rates from. |
Base Executes
The rest of the execute messages can be found in the ADO Base section.
QueryMsg
Rate
Queries the rates applied for the specified action.
Returns a LocalRate struct containing the configurations of the rate.
Base Queries
The rest of the query messages can be found in the ADO Base section.