Creating Standard Pools
This guide explains how to create a new standard liquidity pool (xyk model) on OroSwap. The factory contract allows any user to create pools permissionlessly, provided they follow the required asset and configuration guidelines.
Prerequisites
To create a standard pool on OroSwap testnet, the following conditions must be met:
1. Token Requirements
- You need two native tokens on ZIGChain.
- Quote Token: Must be one of the supported quote assets (
ZIG
orORO
)—these are set by the protocol for stability. - Base Token: Can be a native ZIGChain token created by the user via:
- CLI: Using
zigchaind tx bank
to create and mint a token. - 3rd-party token creation UIs on ZIGChain (community projects).
- CLI: Using
Step-by-Step: Creating a Pool
Step 1: Ensure Token Availability
Make sure you control the wallets holding both tokens, and that they have sufficient balances to provide initial liquidity. The base token must already exist on-chain before proceeding.
Step 2: Select Token Pair
Choose a valid pair where:
- One token is
ZIG
orORO
(quote) - The other is your base token
Example: MYTOKEN / ORO
Step 3: Set Initial Price
Set an initial price ratio between the two tokens. This determines the starting market price in the pool. For instance, if you want:
1 MYTOKEN = 100 ORO
You must provide liquidity in the ratio 1 MYTOKEN : 100 ORO
.
Step 4: Add Initial Liquidity
When creating the pool, you'll be asked to deposit both tokens in the exact ratio matching your initial price. This ensures the x * y = k
invariant is respected from the beginning.
Note: Failing to maintain the correct ratio may result in slippage or rejection of the transaction.
Technical Details
- Pools are created via the
create_pair
message on the OroSwap Factory contract. - The
pair_type
must bexyk
, which is the only supported type currently. - The pool instantiation will automatically:
- Deploy a new pair contract with swap and liquidity functions
- Register the pair in the factory for future queries
- Mint LP tokens to your address representing your liquidity position
Next Steps
Once the pool is created:
- Users can start swapping tokens using the pool
- Other LPs can join by providing assets in the same token ratio
- You can monitor the pool via the OroSwap frontend or CLI queries
Support for more flexible pool types and quote tokens is coming in future releases.