The factory contract contains functionalities for creating and decommissioning Nebula clusters, as well as distributing LP staking rewards
{
"token_code_id": u64,
"cluster_code_id": u64,
"base_denom": String,
"protocol_fee_rate": String,
"dstribution_schedule": Vec<(u64, u64, Uint128)>
}
Adds necessary factory contract settings after the initialization
{
"post_initialize": {
"owner": String,
"astroport_factory": String,
"nebula_token": String,
"staking_contract": String,
"commission_collector": String
}
}
owner
: address of the owner of thecluster-factory
contractastroport_factory
: address of the Astroportfactory
contractnebula_token
: contract address of Nebula Token (NEB)staking_contract
: address of thelp-staking
contractcommission_collector
: address of thecollector
contract used to send protocol fees to
Updates contract variables
{
"update_config": {
"owner": Option<String>,
"token_code_id": Option<u64>,
"cluster_code_id": Option<u64>,
"distribution_schedule": Option<Vec<(u64, u64, Uint128)>>
}
}
owner
: address of the new owner of thecluster-factory
contracttoken_code_id
: code ID of the CW20 token implementation to use for cluster tokenscluster_code_id
: code ID of the cluster contract implementation to usedistribution_schedule
: distribution schedule for the LP staking NEB token rewards/incentives (list of(start_time, end_time, distribution_amount)
)
Updates the LP rewards distribution weight for a cluster token
{
"update_weight": {
"asset_token": String,
"weight": u32
}
}
asset_token
: address of the Nebula token or cluster tokenweight
: new reward distribution weight
Creates a new cluster. Only callable by the cluster factory's owner.
{
"create_cluster": {
params: Params
}
}
params
: params for the cluster being created
The params
type has the following structure:
{
"name": String,
"symbol": String,
"description": String,
"weight": Option<u32>,
"penalty": Addr,
"pricing_oracle": Addr,
"target_oracle": Addr,
"target": Vec<Asset>
}
name
: cluster namedescription
: cluster descriptionweight
: weight for distributing LP rewardspenalty
: address of penalty functio contract to use with this clusterpricing_oracle
: address of price oracle contract to use with this clustertarget_oracle
: address of the target oracle for this clustertarget
: initial cluster inventory target weights to use when first creating the cluster
Allows the cluster factory to pass ExecuteMsg
to other contracts. Used for contracts in which the cluster factory contract is the owner.
{
"pass_command": {
"contract_addr": String,
"msg": Binary
}
}
contract_addr
: address of the contract to execute themsg
onmsg
: binary-encoded contractExecuteMsg
Decommissions a specific cluster, disabling all of its functionality execpet for pro-rata redeem (to allow users to withdraw assets from the cluster's inventory)
{
"decomission_cluster": {
"cluster_contract": String,
"cluster_token": String
}
}
cluster_contract
: cluster contract address to decomissioncluster_token
: cluster token address to decomission
Distributes rewards to current Cluster-UST and NEB-UST LP stakers. This is done by calculating the amount of NEB tokens to distribute to each pool's stakers using:
- each pool's
weight
: - the
distribution_schedule
- time since the last reward distribution
{
"distribute": {}
}
Returns the current configuration information for the contract
{
"config": {}
}
Returns whether a given cluster exists
{
"cluster_exists": {
"cluster_address": String
}
}
cluster_address
: address of the cluster contract to query
Returns a list of all of the Nebula clusters (that are created through this factory contract) and its status (e.g. active
or decommissioned
).
{
"cluster_list": {}
}
Returns the current LP staking reward distribution info
{
"distribution_info": {}
}