Client
Clients can interact with the mint module through:
CLI
The command-line interface provides query commands to inspect the mint module state.
Query Commands
Query Params
Get the current mint module parameters:
d q mint params
Example Output:
params:
mint_denom: udt
genesis_epoch_provisions: "76923076923075.000000000000000000"
epoch_identifier: week
reduction_period_in_epochs: 52
reduction_factor: "0.800000000000000000"
distribution_proportions:
staking: "1.000000000000000000"
community_pool: "0.000000000000000000"
minting_rewards_distribution_start_epoch: 27
max_supply: "100000000000000000.000000000000000000"
Query Epoch Provisions
Get the current epoch provisions (amount minted per epoch):
d q mint epoch-provisions
Example Output:
epoch_provisions: "76923076923075.000000000000000000"
This value changes over time as reductions are applied.
Transaction Commands
The mint module does not provide direct transaction commands. Parameter updates must be done through governance proposals using the standard governance module commands.
Example governance proposal to update mint params:
d tx gov submit-proposal /path/to/proposal.json --from=<key>
Where proposal.json
contains:
{
"messages": [
{
"@type": "/d.mint.v1.MsgUpdateParams",
"authority": "dchain10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
"params": {
"mint_denom": "udt",
"genesis_epoch_provisions": "76923076923075",
"epoch_identifier": "week",
"reduction_period_in_epochs": 52,
"reduction_factor": "0.8",
"distribution_proportions": {
"staking": "0.9",
"community_pool": "0.1"
},
"minting_rewards_distribution_start_epoch": 27,
"max_supply": "100000000000000000"
}
}
],
"metadata": "ipfs://CID",
"deposit": "10000000udt",
"title": "Update Mint Distribution",
"summary": "Allocate 10% of minted tokens to community pool"
}
gRPC
Query Service
The mint module provides a gRPC query service defined in d/mint/v1/query.proto
.
Params
Get module parameters:
grpcurl -plaintext localhost:9090 d.mint.v1.Query/Params
Request:
message QueryParamsRequest {}
Response:
message QueryParamsResponse {
Params params = 1;
}
EpochProvisions
Get current epoch provisions:
grpcurl -plaintext localhost:9090 d.mint.v1.Query/EpochProvisions
Request:
message QueryEpochProvisionsRequest {}
Response:
message QueryEpochProvisionsResponse {
bytes epoch_provisions = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
REST
Query Endpoints
REST endpoints are available via the gRPC-gateway.
GET /d/mint/v1/params
Get the current mint module parameters.
Example:
curl http://localhost:1317/d/mint/v1/params
Response:
{
"params": {
"mint_denom": "udt",
"genesis_epoch_provisions": "76923076923075.000000000000000000",
"epoch_identifier": "week",
"reduction_period_in_epochs": "52",
"reduction_factor": "0.800000000000000000",
"distribution_proportions": {
"staking": "1.000000000000000000",
"community_pool": "0.000000000000000000"
},
"minting_rewards_distribution_start_epoch": "27",
"max_supply": "100000000000000000.000000000000000000"
}
}
GET /d/mint/v1/epoch_provisions
Get the current epoch provisions.
Example:
curl http://localhost:1317/d/mint/v1/epoch_provisions
Response:
{
"epoch_provisions": "76923076923075.000000000000000000"
}
Monitoring and Analytics
Useful Queries for Monitoring
Check if max supply is approaching:
# Get current supply
d q bank total --denom=udt
# Get max supply
d q mint params | grep max_supply
# Calculate percentage
# percentage = (current_supply / max_supply) * 100
Track minting history:
# Query events from recent blocks
d q txs --events 'mint_epoch_end.epoch_number=79'
Monitor current minting rate:
# Get current epoch provisions
d q mint epoch-provisions
# Calculate annual minting (assuming weekly epochs)
# annual_minting = epoch_provisions * 52
Check when next reduction occurs:
# Get current epoch
d q epochs current-epoch week
# Get last reduction epoch (from state or events)
# next_reduction = last_reduction + reduction_period_in_epochs
Event Monitoring
Monitor minting events in real-time:
# Subscribe to new blocks and filter for mint events
d q block --height=<height> | jq '.result.events[] | select(.type=="mint_epoch_end")'
Event attributes to monitor:
epoch_number
: Track minting epochsepoch_provisions
: Monitor current provisions (detects reductions)amount
: Actual minted amounttotal_supply_after
: Track supply growthlast_reduction_epoch
: Identify reduction events
Common Use Cases
1. Check Current Minting Status
# Get all relevant minting info
d q mint params
d q mint epoch-provisions
d q bank total --denom=udt
2. Verify Reduction Applied Correctly
# After a reduction epoch, verify:
# 1. Epoch provisions decreased
d q mint epoch-provisions
# 2. Check event was emitted
d q txs --events 'mint_epoch_end.epoch_number=<reduction_epoch>'
3. Estimate Time Until Max Supply
# Get current supply and provisions
current_supply=$(d q bank total --denom=udt -o json | jq -r '.supply[0].amount')
epoch_provisions=$(d q mint epoch-provisions -o json | jq -r '.epoch_provisions')
max_supply=$(d q mint params -o json | jq -r '.params.max_supply')
# Calculate remaining supply and epochs
# remaining = max_supply - current_supply
# epochs_remaining ≈ remaining / epoch_provisions (simplified, doesn't account for reductions)
4. Propose Parameter Changes
See the governance proposal example in the Transaction Commands section above.