Assets Module
Overview
The Assets module within PRYZM manages refractable assets, their maturity levels, and the exchange rates between each base asset and its refracted form.
Concepts
Refractable Asset
Refractable assets are assets refracted by PRYZM. They can be registered or disabled via governance proposals. These assets encompass the following details:
- Id: A unique identifier provided by the user, used in the p/y token denom.
- Token Denom: Denomination of the refractable token, e.g., cLuna.
- Host Chain Id: The id for the host chain where the asset is staked. This is left blank for external assets.
- Disabled: If an asset is disabled via governance, this property is set. Subsequently, no new maturity for this asset will be introduced, and the tokens of this asset will no longer be refracted in PRYZM. However, the refracted tokens can still be merged and redeemed even if the asset is disabled.
- Maturity Parameters: Parameters that control the generation of maturities for the asset.
- Fee Ratios: Fee ratios used in various modules to collect protocol fees.
Below is the structure of a refractable asset:
// The properties of a supported asset
message RefractableAsset {
// A unique user-provided identifier. Is used in the p/y token denom
string id = 1;
// The denomination of the token on Pryzm. This may be an icstaking cToken or an IBC transferred token denom for external assets.
string token_denom = 2;
// The id for the host chain on which the asset is staked. This is empty if the asset is external.
string host_chain_id = 3;
// Disabled assets cannot be refracted, but can still be redeemed.
bool disabled = 4;
MaturityParams maturity_params = 5 [(gogoproto.nullable) = false];
// The amount of fee for each operation on the asset.
FeeRatios fee_ratios = 6 [(gogoproto.nullable) = false];
}
// The parameters based on which new maturities are introduced
message MaturityParams {
// The number of maturities per year: can be 0, 1, 2, 4, 12
// note: levels_per_year should be zero, if and only if years is 0 (which means no automatic maturity creation)
int32 levels_per_year = 1 [(amino.dont_omitempty) = true];
// The number of years in advance that maturities are made available for
// note: years should be zero, if and only if levels_per_year is 0 (which means no automatic maturity creation)
int32 years = 2 [(amino.dont_omitempty) = true];
}
// Fee ratio per each operation
message FeeRatios {
string yield = 1 [
(gogoproto.nullable) = true,
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
];
string refractor_refract = 2 [
(gogoproto.nullable) = true,
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
];
string refractor_merge = 3 [
(gogoproto.nullable) = true,
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
];
string refractor_redeem = 4 [
(gogoproto.nullable) = true,
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
];
string y_staking_claim_reward = 5 [
(gogoproto.nullable) = true,
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
];
}
Maturity Level
Maturity levels are automatically generated maturities, allowing users to refract their assets. They're governed by two parameters: the number of maturities per year and the number of years in advance that maturities are available. The former can be discrete values of 1, 2, 4, or 12 - representing annually, semi-annually, quarterly, or monthly maturities. The latter can be any number from 1 to 10.
These values are set per asset and can be updated through governance proposals. If a proposal to change these parameters is passed, the protocol will instantly verify the new maturities that should be listed against the outstanding maturities. Outstanding maturities are never deleted; they can be used as long as they're not expired and the asset remains refractable. As time progresses, new maturity levels are added based on the updated parameters.
Maturity levels are stored using the following structure:
message MaturityLevel {
bool active = 1;
string asset_id = 2;
string symbol = 3;
google.protobuf.Timestamp introduction_time = 4 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp expiration_time = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
}
The symbol of the maturity level is the expiration time of the maturity, formatted as 02Jan2006
.