Skip to main content

Maker

The Maker contract collects part of Astroport's pair fees (according to the factory's maker_fee). The accrued fees are swapped to ASTRO and then send to stakers and governance (according to the governance_percent).

InstantiateMsg

Initializes the contract with required addresses and the governance_percent.

json
maker.rs
Copy

_9
{
_9
"owner": "...",
_9
"astro_token_contract": "...",
_9
"factory_contract": "...",
_9
"staking_contract": "...",
_9
"governance_contract": "...",
_9
"governance_percent": "20",
_9
"max_spread": "23.3"
_9
}

ParamsTypeDescription
ownerStringAddress that's allowed to change contract parameters
astro_token_contractStringThe ASTRO token contract address
factory_contractStringThe factory contract address
staking_contractStringThe xASTRO staking contract address
governance_contractOption<String>The governance contract address (fee distributor for vxASTRO)
governance_percentOption<Uint64>The percentage of fees that go to governance_contract
max_spreadOption<Decimal>The maximum spread used when swapping fee tokens to ASTRO

ExecuteMsg

collect

Swaps accrued fee tokens to ASTRO.

json
maker.rs
Copy

_23
{
_23
"collect": {
_23
"assets": [
_23
{
_23
"asset_info": {
_23
"token": {
_23
"contract_addr": "..."
_23
}
_23
},
_23
"limit": "1000000"
_23
},
_23
{
_23
"asset_info": {
_23
"native_token": {
_23
"denom": "..."
_23
}
_23
},
_23
"limit": "1000000"
_23
},
_23
etc...
_23
]
_23
}
_23
}

ParamsTypeDescription
assetsVec<AssetWithLimit>The assets to swap to ASTRO

AssetWithLimit

This struct holds parameters to help with swapping a specific amount of a fee token to ASTRO.

json
maker.rs
Copy

_8
{
_8
"asset_info": {
_8
"token": {
_8
"contract_addr": "..."
_8
}
_8
},
_8
"limit": "10000"
_8
}

update_config

Updates the contract's general settings. All fields are optional.

json
maker.rs
Copy

_11
{
_11
"update_config": {
_11
"factory_contract": "...",
_11
"staking_contract": "...",
_11
"governance_contract": {
_11
"set": "..."
_11
},
_11
"governance_percent": "20",
_11
"max_spread": "12.3"
_11
}
_11
}

ParamsTypeDescription
factory_contractOption<String>The factory contract address
staking_contractOption<String>The xASTRO staking contract address
governance_contractOption<UpdateAddr>The governance contract address (fee distributor for vxASTRO)
governance_percentOption<Uint64>The percentage of fees that go to governance_contract
governance_contractOption<Decimal>The maximum spread used when swapping fee tokens to ASTRO

UpdateAddr

This is an enum used for setting and removing a contract address.

factory.rs
Copy

_5
#[cw_serde]
_5
pub enum UpdateAddr {
_5
Set(String),
_5
Remove {},
_5
}

VariantsDescription
SetSets a new contract address
RemoveRemoves a contract address

swap_bridge_assets

Swap fee tokens via bridge assets.

json
maker.rs
Copy

_17
{
_17
"swap_bridge_assets": {
_17
"assets": [
_17
{
_17
"native_token": {
_17
"denom": "..."
_17
}
_17
},
_17
{
_17
"native_token": {
_17
"denom": "..."
_17
}
_17
}
_17
],
_17
"depth": "12345"
_17
}
_17
}

ParamsTypeDescription
assetsVec<AssetInfo>Information about an asset stored in a AssetInfo struct
depthu64Swap depth

distribute_astro

Distribute ASTRO to stakers and to governance.

json
maker.rs
Copy

_3
{
_3
"distribute_astro": {}
_3
}

propose_new_owner

Creates a proposal to change contract ownership. The proposal validity period is set in the expires_in variable.

json
maker.rs
Copy

_6
{
_6
"propose_new_owner": {
_6
"owner": "...",
_6
"expires_in": 1234567
_6
}
_6
}

ParamsTypeDescription
ownerStringThe newly proposed owner
expires_inu64The validity period of the proposal to change the owner

drop_ownership_proposal

Removes the existing proposal to change contract ownership.

json
maker.rs
Copy

_3
{
_3
"drop_ownership_proposal": {}
_3
}

claim_ownership

Used to claim contract ownership, thus changing the contract's owner.

json
maker.rs
Copy

_3
{
_3
"claim_ownership": {}
_3
}

enable_rewards

Enables the distribution of current fees accrued in the contract over "blocks" number of blocks.

json
maker.rs
Copy

_5
{
_5
"enable_rewards": {
_5
"blocks": 1000000
_5
}
_5
}

ParamsTypeDescription
blocksu64Number of blocks

QueryMsg

config

Queries information about the Maker's configuration.

json
maker.rs
Copy

_3
{
_3
"config": {}
_3
}

balances

Queries token balances for each specified asset held by the Maker.

json
maker.rs
Copy

_17
{
_17
"balances": {
_17
"assets": [
_17
{
_17
"native_token": {
_17
"denom": "..."
_17
}
_17
},
_17
{
_17
"token": {
_17
"contract_addr": "..."
_17
}
_17
},
_17
etc...
_17
]
_17
}
_17
}

ParamsTypeDescription
assetsVec<AssetInfo>Assets held in Maker contract

BalancesResponse

A custom struct used to return multiple asset balances.

json
maker.rs
Copy

_21
{
_21
"balances": [
_21
{
_21
"info": {
_21
"native_token": {
_21
"denom": "..."
_21
}
_21
},
_21
"amount": "1000000"
_21
},
_21
{
_21
"info": {
_21
"token": {
_21
"contract_addr": "..."
_21
}
_21
},
_21
"amount": "1000000"
_21
},
_21
etc...
_21
]
_21
}

ParamsTypeDescription
balancesVec<Asset>Holds the balance for assets held in the Maker contract

bridges

Queries availiable bridges.

json
maker.rs
Copy

_3
{
_3
"bridges": {}
_3
}

Returns a vector containing assets of types (String, String)