Expand description

Asset Rate Pallet

Overview

The AssetRate pallet provides means of setting conversion rates for some asset to native balance.

The supported dispatchable functions are documented in the Call enum.

Terminology

  • Asset balance: The balance type of an arbitrary asset. The network might only know about the identifier of the asset and nothing more.
  • Native balance: The balance type of the network’s native currency.

Goals

The asset-rate system in Substrate is designed to make the following possible:

  • Providing a soft conversion for the balance of supported assets to a default asset class.
  • Updating existing conversion rates.

Interface

Permissioned Functions

  • create: Creates a new asset conversion rate.
  • remove: Removes an existing asset conversion rate.
  • update: Overwrites an existing assert conversion rate.

Please refer to the Call enum and its associated variants for documentation on each function.

Assumptions

  • Conversion rates are only used as estimates, and are not designed to be precise or closely tracking real world values.
  • All conversion rates reflect the ration of some asset to native, e.g. native = asset * rate.

Re-exports

Modules

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
  • Autogenerated weights for pallet_asset_rate

Traits

  • Trait describing the factory function for the AssetKind parameter.