Skip to main content

Factory

Overview​

The factory creates new Astroport pools (and their LP tokens) and keeps the registry of pools, one per set of assets. It also holds the configuration of every pool type it can create: the code ID, the fees and whether anyone can create that type.

The factory owner is the protocol owner on each chain: the satellite ("Astroport Assembly") on Terra and the Assembly on Neutron, both run by the Astroport Contributors DAO (see Access Controls and Permissions). Only the owner can change the configuration or deregister pools.

Pool types and fees configured on mainnet (2026-11-04):

Pair typeTerra (factory 1.8.0)Neutron (factory 1.9.0)
{"xyk": {}}30 bps, 1/3 to Maker (maker_fee_bps 3333)30 bps, 1/3 to Maker
{"stable": {}}5 bps, 1/2 to Maker (5000)5 bps, 1/2 to Maker
{"custom": "concentrated"} (PCL)Fee set per pool by its parameters, 1/2 to MakerSame
Concentrated with Duality orderbookn/aFee set per pool, 1/2 to Maker
TransmuterPermissioned, no feesPermissioned
xASTRO pair (xASTRO is retired)n/aPermissioned, can't be incentivized
XYK with sale taxn/aDisabled
NOTE

This page documents the messages of astroport-factory 1.10.0 in astroport-core main. The deployed factories are 1.8.0 (Terra) and 1.9.0 (Neutron). The 1.10.0 migration from 1.8/1.9 adds the whitelist field of PairConfig; the deployed factories don't have it. The generator_address field keeps its old name but holds the Incentives contract address.

InstantiateMsg​

Initializes the factory with the pool types it can create, the Maker (fee_address), the Incentives contract, the coin registry and the owner.

json
factory.rs
Copy

_25
{
_25
"pair_configs": [
_25
{
_25
"code_id": 123,
_25
"pair_type": {
_25
"xyk": {}
_25
},
_25
"total_fee_bps": 30,
_25
"maker_fee_bps": 3333,
_25
"is_disabled": false,
_25
"is_generator_disabled": false,
_25
"permissioned": false
_25
}
_25
],
_25
"token_code_id": 69,
_25
"fee_address": "terra1ygcvxp9s054q8u2q4hvl52ke393zvgj0sllahlycm4mj8dm96zjsa45rzk",
_25
"generator_address": "terra1eywh4av8sln6r45pxq45ltj798htfy0cfcf7fy3pxc2gcv6uc07se4ch9x",
_25
"owner": "terra1k9j8rcyk87v5jvfla2m9wp200azegjz0eshl7n2pwv852a7ssceqsnn7pq",
_25
"whitelist_code_id": 70,
_25
"coin_registry_address": "terra1zuf8fla02926nhpfvk09k2pg6qv9aayflp0qt4a0msppu2h4exqs6af275",
_25
"tracker_config": {
_25
"code_id": 123,
_25
"token_factory_addr": "terra1..."
_25
}
_25
}

ParamsTypeDescription
pair_configsVec<PairConfig>The pool types the factory can create
token_code_idu64CW20 token code ID, used by pool versions that issue a CW20 LP token
fee_addressOption<String>The Maker contract, which receives the Maker share of swap fees
generator_addressOption<String>The Incentives contract. Pools stake LP tokens there when auto_stake is set, and deregister deactivates the pool there
ownerStringAddress allowed to change the factory configuration
whitelist_code_idu64CW1 whitelist code ID, used to store third-party staking rewards
coin_registry_addressStringThe native coin registry, which stores the decimals of native denoms
tracker_configOption<TrackerConfig>Code ID of the tokenfactory tracker and the tokenfactory module address, for pools that track LP balances

PairConfig​

The configuration of a pool type.

json
factory.rs
Copy

_12
{
_12
"code_id": 123,
_12
"pair_type": {
_12
"xyk": {}
_12
},
_12
"total_fee_bps": 30,
_12
"maker_fee_bps": 3333,
_12
"is_disabled": false,
_12
"is_generator_disabled": false,
_12
"permissioned": false,
_12
"whitelist": null
_12
}

ParamsTypeDescription
code_idu64Code ID used to instantiate pools of this type
pair_typePairTypeThe pool type
total_fee_bpsu16Total swap fee in basis points (at most 10,000). Pool types with their own fee model, such as PCL, set fees in the pool parameters instead
maker_fee_bpsu16Share of the swap fee sent to the Maker, in basis points of the fee (10,000 = 100%)
is_disabledboolIf true, no new pools of this type can be created. Existing pools keep working
is_generator_disabledboolIf true, pools of this type can't be incentivized in the Incentives contract
permissionedboolIf true, only the owner (or, from 1.10.0, an address in whitelist) can create pools of this type
whitelistOption<Vec<String>>1.10.0 only. Addresses allowed to create pools of a permissioned type

PairType​

The pool type, as stored in pair configs and returned by pools in PairInfo.

factory.rs
Copy

_6
#[cw_serde]
_6
pub enum PairType {
_6
Xyk {},
_6
Stable {},
_6
Custom(String),
_6
}

VariantsDescription
xykConstant product pool: {"xyk": {}}
stableStableswap pool: {"stable": {}}
customAny other type, named by a string, for example {"custom": "concentrated"}

TrackerConfig​

json
factory.rs
Copy

_4
{
_4
"code_id": 123,
_4
"token_factory_addr": "terra1..."
_4
}

ParamsTypeDescription
code_idu64Code ID of the tokenfactory tracker contract
token_factory_addrStringThe tokenfactory module address

ExecuteMsg​

update_config​

Updates the factory configuration. Only the owner can call it. Every field is optional; omitted fields are unchanged.

json
factory.rs
Copy

_9
{
_9
"update_config": {
_9
"token_code_id": 69,
_9
"fee_address": "terra1ygcvxp9s054q8u2q4hvl52ke393zvgj0sllahlycm4mj8dm96zjsa45rzk",
_9
"generator_address": "terra1eywh4av8sln6r45pxq45ltj798htfy0cfcf7fy3pxc2gcv6uc07se4ch9x",
_9
"whitelist_code_id": 70,
_9
"coin_registry_address": "terra1zuf8fla02926nhpfvk09k2pg6qv9aayflp0qt4a0msppu2h4exqs6af275"
_9
}
_9
}

ParamsTypeDescription
token_code_idOption<u64>CW20 token code ID
fee_addressOption<String>The Maker contract
generator_addressOption<String>The Incentives contract
whitelist_code_idOption<u64>CW1 whitelist code ID
coin_registry_addressOption<String>The native coin registry

update_tracker_config​

Sets the tokenfactory tracker code ID. Only the owner can call it. token_factory_addr is required the first time and ignored afterwards.

json
factory.rs
Copy

_6
{
_6
"update_tracker_config": {
_6
"tracker_code_id": 123,
_6
"token_factory_addr": "terra1..."
_6
}
_6
}

ParamsTypeDescription
tracker_code_idu64Code ID of the tokenfactory tracker contract
token_factory_addrOption<String>The tokenfactory module address

update_pair_config​

Adds a pool type or replaces its configuration: code ID, fees, and whether it is disabled, can be incentivized or is permissioned. Only the owner can call it. Fee changes apply to existing pools of the type, since pools read their fees from the factory.

As an example, a pool type that charges 30 bps and sends 1/3 of it to the Maker has total_fee_bps 30 and maker_fee_bps 3333: 3333 / 10,000 * 30 bps = 0.1% of each swap goes to the Maker.

json
factory.rs
Copy

_15
{
_15
"update_pair_config": {
_15
"config": {
_15
"code_id": 123,
_15
"pair_type": {
_15
"xyk": {}
_15
},
_15
"total_fee_bps": 30,
_15
"maker_fee_bps": 3333,
_15
"is_disabled": false,
_15
"is_generator_disabled": false,
_15
"permissioned": false
_15
}
_15
}
_15
}

ParamsTypeDescription
configPairConfigThe new configuration of the pool type

create_pair​

Creates a pool and registers it. Anyone can call it unless the pool type is permissioned. It fails if a pool for these assets already exists or if the type is disabled. The pool is instantiated with the factory owner as its admin. Pools mint a tokenfactory LP denom, so attach the chain's tokenfactory denom creation fee, if any, as funds; the factory passes them to the pool.

Custom pool types may need extra parameters, packed in init_params (see each pool page).

json
factory.rs
Copy

_20
{
_20
"create_pair": {
_20
"pair_type": {
_20
"xyk": {}
_20
},
_20
"asset_infos": [
_20
{
_20
"native_token": {
_20
"denom": "uluna"
_20
}
_20
},
_20
{
_20
"native_token": {
_20
"denom": "ibc/E8481AD838C31D4FC12A504B10F9B4E2F830F8818D2735C2FFC707579B5FA60B"
_20
}
_20
}
_20
],
_20
"init_params": null
_20
}
_20
}

ParamsTypeDescription
pair_typePairTypeThe pool type
asset_infosVec<AssetInfo>The assets of the pool
init_paramsOption<Binary>Base64-encoded pool parameters for types that need them

deregister​

Removes a pool from the registry, so a new pool (of any type) can be created for the same assets. Only the owner can call it. The factory also deactivates the pool in the Incentives contract. The pool contract itself keeps working.

json
factory.rs
Copy

_16
{
_16
"deregister": {
_16
"asset_infos": [
_16
{
_16
"native_token": {
_16
"denom": "uluna"
_16
}
_16
},
_16
{
_16
"native_token": {
_16
"denom": "ibc/E8481AD838C31D4FC12A504B10F9B4E2F830F8818D2735C2FFC707579B5FA60B"
_16
}
_16
}
_16
]
_16
}
_16
}

ParamsTypeDescription
asset_infosVec<AssetInfo>The assets of the pool to deregister

propose_new_owner​

Creates an offer to change the factory owner. Only the owner can call it. The offer expires after expires_in seconds.

json
factory.rs
Copy

_6
{
_6
"propose_new_owner": {
_6
"owner": "terra1...",
_6
"expires_in": 604800
_6
}
_6
}

ParamsTypeDescription
ownerStringNewly proposed owner
expires_inu64Seconds until the offer expires

drop_ownership_proposal​

Removes an existing offer to change the owner. Only the owner can call it.

json
factory.rs
Copy

_3
{
_3
"drop_ownership_proposal": {}
_3
}

claim_ownership​

Accepts an offer. Only the proposed owner can call it.

json
factory.rs
Copy

_3
{
_3
"claim_ownership": {}
_3
}

QueryMsg​

config​

Returns the factory configuration.

json
factory.rs
Copy

_3
{
_3
"config": {}
_3
}

ConfigResponse​

Example from the Terra factory (pair configs shortened).

json
factory.rs
Copy

_32
{
_32
"owner": "terra1k9j8rcyk87v5jvfla2m9wp200azegjz0eshl7n2pwv852a7ssceqsnn7pq",
_32
"pair_configs": [
_32
{
_32
"code_id": 123,
_32
"pair_type": {
_32
"stable": {}
_32
},
_32
"total_fee_bps": 5,
_32
"maker_fee_bps": 5000,
_32
"is_disabled": false,
_32
"is_generator_disabled": false,
_32
"permissioned": false
_32
},
_32
{
_32
"code_id": 123,
_32
"pair_type": {
_32
"xyk": {}
_32
},
_32
"total_fee_bps": 30,
_32
"maker_fee_bps": 3333,
_32
"is_disabled": false,
_32
"is_generator_disabled": false,
_32
"permissioned": false
_32
}
_32
],
_32
"token_code_id": 69,
_32
"fee_address": "terra1ygcvxp9s054q8u2q4hvl52ke393zvgj0sllahlycm4mj8dm96zjsa45rzk",
_32
"generator_address": "terra1eywh4av8sln6r45pxq45ltj798htfy0cfcf7fy3pxc2gcv6uc07se4ch9x",
_32
"whitelist_code_id": 70,
_32
"coin_registry_address": "terra1zuf8fla02926nhpfvk09k2pg6qv9aayflp0qt4a0msppu2h4exqs6af275"
_32
}

ParamsTypeDescription
ownerAddrThe factory owner
pair_configsVec<PairConfig>The configured pool types
token_code_idu64CW20 token code ID
fee_addressOption<Addr>The Maker contract
generator_addressOption<Addr>The Incentives contract
whitelist_code_idu64CW1 whitelist code ID
coin_registry_addressAddrThe native coin registry

pair​

Returns the PairInfo of the registered pool for the given assets.

json
factory.rs
Copy

_16
{
_16
"pair": {
_16
"asset_infos": [
_16
{
_16
"native_token": {
_16
"denom": "uluna"
_16
}
_16
},
_16
{
_16
"native_token": {
_16
"denom": "ibc/E8481AD838C31D4FC12A504B10F9B4E2F830F8818D2735C2FFC707579B5FA60B"
_16
}
_16
}
_16
]
_16
}
_16
}

ParamsTypeDescription
asset_infosVec<AssetInfo>The assets of the pool

pairs​

Returns registered pools, paginated. Results start after the pool whose assets are start_after. limit defaults to 10 and is capped at 30.

json
factory.rs
Copy

_17
{
_17
"pairs": {
_17
"start_after": [
_17
{
_17
"native_token": {
_17
"denom": "uluna"
_17
}
_17
},
_17
{
_17
"native_token": {
_17
"denom": "ibc/E8481AD838C31D4FC12A504B10F9B4E2F830F8818D2735C2FFC707579B5FA60B"
_17
}
_17
}
_17
],
_17
"limit": 30
_17
}
_17
}

ParamsTypeDescription
start_afterOption<Vec<AssetInfo>>The assets of the pool to start after
limitOption<u32>The maximum number of pools to return

PairsResponse​

json
factory.rs
Copy

_23
{
_23
"pairs": [
_23
{
_23
"asset_infos": [
_23
{
_23
"native_token": {
_23
"denom": "uluna"
_23
}
_23
},
_23
{
_23
"native_token": {
_23
"denom": "ibc/E8481AD838C31D4FC12A504B10F9B4E2F830F8818D2735C2FFC707579B5FA60B"
_23
}
_23
}
_23
],
_23
"contract_addr": "terra1...pool",
_23
"liquidity_token": "factory/terra1...pool/astroport/share",
_23
"pair_type": {
_23
"xyk": {}
_23
}
_23
}
_23
]
_23
}

ParamsTypeDescription
pairsVec<PairInfo>The pools

fee_info​

Returns the fee configuration of a pool type.

json
factory.rs
Copy

_7
{
_7
"fee_info": {
_7
"pair_type": {
_7
"xyk": {}
_7
}
_7
}
_7
}

ParamsTypeDescription
pair_typePairTypeThe pool type

FeeInfoResponse​

json
factory.rs
Copy

_5
{
_5
"fee_address": "terra1ygcvxp9s054q8u2q4hvl52ke393zvgj0sllahlycm4mj8dm96zjsa45rzk",
_5
"total_fee_bps": 30,
_5
"maker_fee_bps": 3333
_5
}

ParamsTypeDescription
fee_addressOption<Addr>The Maker contract
total_fee_bpsu16Total swap fee in basis points
maker_fee_bpsu16Share of the swap fee sent to the Maker, in basis points of the fee

blacklisted_pair_types​

Returns the pool types that are disabled or can't be incentivized, as a Vec<PairType>.

json
factory.rs
Copy

_3
{
_3
"blacklisted_pair_types": {}
_3
}

tracker_config​

Returns the TrackerConfig. Fails if none is set.

json
factory.rs
Copy

_3
{
_3
"tracker_config": {}
_3
}