CLI Reference
Anyone can create a private plan by paying a fee. A fixed amount plan plans to distribute amount of coins by a fixed amount defined in
EpochAmount
. Internally, PrivatePlanFarmingPoolAddress
is generated and assigned to the plan. The creator queries the plan and sends amount of coins to the farming pool address so that the plan distributes as intended. To prevent spamming attacks, a PlanCreationFee
fee must be paid on plan creation.Create a
private-fixed-plan.json
file. This private fixed amount farming plan intends to provide 100ATOM per epoch (measured in day), relative to the rate amount of denoms that is defined in staking coin weights.create-private-fixed-plan [plan-file]
name
: the name of the farming plan can be any name to store in a blockchain network, duplicate values are allowedstaking_coin_weights
: the distributing amount for each epoch. An amount must be decimal, not an integer. The sum of total weight must be 1.000000000000000000start_time
: start time of the farming planend_time
: end time of the farming planepoch_amount
: the amount to distribute per epoch as an incentive for staking denoms that are defined in the staking coin weights
{
"name": "This plan intends to provide incentives for liquidity pool investors and ATOM holders",
"staking_coin_weights": [
{
"denom": "pool1",
"amount": "0.800000000000000000"
},
{
"denom": "uatom",
"amount": "0.200000000000000000"
}
],
"start_time": "2021-08-06T09:00:00Z",
"end_time": "2021-08-13T09:00:00Z",
"epoch_amount": [
{
"denom": "uatom",
"amount": "100000000"
}
]
}
# Create a private fixed amount plan
crescentd tx farming create-private-fixed-plan private-fixed-plan.json \
--chain-id localnet \
--from user1 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
Anyone can create this private plan type message. A ratio plan plans to distribute amount of coins by ratio that is defined in
EpochRatio
. Internally, PrivatePlanFarmingPoolAddress
is generated and assigned to the plan. The creator must query the plan and send amount of coins to the farming pool address so that the plan distributes as intended. For a ratio plan, whichever coins that the farming pool address has in balances are used every epoch. To prevent spamming attacks, a PlanCreationFee
fee must be paid on plan creation.Create the
private-ratio-plan.json
file. This private ratio farming plan intends to provide ratio of all coins that farming pool address has per epoch (measured in day). In this example, epoch ratio is 10 percent and 10 percent of all the coins that the creator of this plan has in balances are used as incentives for the denoms that are defined in the staking coin weights.create-private-ratio-plan [plan-file]
name
: the name of the farming plan can be any name to store in a blockchain network, duplicate values are allowedstaking_coin_weights
: the distributing amount for each epoch. An amount must be decimal, not an integer. The sum of total weight must be 1.000000000000000000start_time
: start time of the farming planend_time
: end time of the farming planepoch_ratio
: a ratio to distribute per epoch as an incentive for staking denoms that are defined in staking coin weights. The ratio refers to all coins that the creator has in their account. Note that the total ratio cannot exceed 1.0 (100%).
{
"name": "This plan intends to provide incentives for Cosmonauts!",
"staking_coin_weights": [
{
"denom": "pool1",
"amount": "0.800000000000000000"
},
{
"denom": "uatom",
"amount": "0.200000000000000000"
}
],
"start_time": "2021-08-06T09:00:00Z",
"end_time": "2021-08-13T09:00:00Z",
"epoch_ratio": "0.100000000000000000"
}
# Create a private ratio plan
crescentd tx farming create-private-ratio-plan private-ratio-plan.json \
--chain-id localnet \
--from val1 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
Stake coins to receive farming rewards.
stake [amount]
# Stake pool coin
crescentd tx farming stake 5000000pool1 \
--chain-id localnet \
--from user2 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
Unstake coins from the network.
unstake [amount]
# Unstake coins from the farming plan
crescentd tx farming unstake 2500000pool1 \
--chain-id localnet \
--from user2 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
Harvest farming rewards.
harvest [staking-coin-denoms]
# Harvest farming rewards from the farming plan
# Note that there won't be any rewards if the time hasn't passed by the epoch days
crescentd tx farming harvest uatom \
--chain-id localnet \
--from user2 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
# Harvest all with --all flag
crescentd tx farming harvest \
--all \
--chain-id localnet \
--from user2 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
Remove farming plan.
remove-plan [plan-id]
crescentd tx farming remove-plan 1 \
--chain-id localnet \
--from user2 \
--keyring-backend test \
--broadcast-mode block \
--yes \
--output json | jq
params
# Query the values set as farming parameters
crescentd q farming params --output json | jq
plans [optional flags]
# Query for all farmings plans on a network
crescentd q farming plans --output json | jq
# Query for all farmings plans with the given plan type
# plan type must be either PLAN_TYPE_PUBLIC or PLAN_TYPE_PRIVATE
crescentd q farming plans \
--plan-type PLAN_TYPE_PUBLIC \
--output json | jq
# Query for all farmings plans with the given farming pool address
crescentd q farming plans \
--farming-pool-addr cre13w4ueuk80d3kmwk7ntlhp84fk0arlm3myput62 \
--output json | jq
# Query for all farmings plans with the given termination address
crescentd q farming plans \
--termination-addr cre185fflsvwrz0cx46w6qada7mdy92m6kx4vg42xf \
--output json | jq
# Query for all farmings plans with the given staking coin denom
crescentd q farming plans \
--staking-coin-denom pool1 \
--output json | jq
stakings [farmer]
# Query for all stakings by a farmer
crescentd q farming stakings cre185fflsvwrz0cx46w6qada7mdy92m6kx4vg42xf --output json | jq
# Query for all stakings by a farmer with the given staking coin denom
crescentd q farming stakings cre185fflsvwrz0cx46w6qada7mdy92m6kx4vg42xf \
--staking-coin-denom pool1 \
--output json | jq
total-stakings [staking-coin-denom]
# Query for total stakings by a staking coin denom
crescentd q farming total-stakings pool1 --output json | jq
rewards [farmer]
# Query for all rewards by a farmer
crescentd q farming rewards cre185fflsvwrz0cx46w6qada7mdy92m6kx4vg42xf --output json | jq
# Query for all rewards by a farmer with the staking coin denom
crescentd q farming rewards cre185fflsvwrz0cx46w6qada7mdy92m6kx4vg42xf \
--staking-coin-denom pool1 \
--output json | jq
current-epoch-days
# Query for the current epoch days
crescentd q farming current-epoch-days --output json | jq
Last modified 1yr ago