Skip to main content

Create Pool

Creates a new liquidity pool between two tokens.

Related Queries
  • All Tokens: Use this query to fetch valid token IDs for pair.token_1.token and pair.token_2.token.
  • Token Denoms: Use this query to fetch the correct token_type values for each token in pair.
  • All Chains: Use this query to validate supported chain UIDs. In most integrations, sender.chain_uid is derived from the connected wallet or source chain context.

Request URL​

Method: POST

https://api.euclidprotocol.com/api/v1/execute/pool/create

Examples​

curl --request POST \
  --url https://api.euclidprotocol.com/api/v1/execute/pool/create \
  --header 'content-type: application/json' \
  --data '{
  "sender": {
    "address": "0x1111111111111111111111111111111111111111",
    "chain_uid": "polygon"
  },
  "pair": {
    "token_1": {
      "token": "usdt",
      "token_type": {
        "smart": {
          "contract_address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f"
        }
      },
      "amount": "1000000"
    },
    "token_2": {
      "token": "usdc",
      "token_type": {
        "smart": {
          "contract_address": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"
        }
      },
      "amount": "1000000"
    }
  },
  "slippage_tolerance_bps": 30,
  "lp_token_name": "USDT-USDC",
  "lp_token_decimal": 18,
  "lp_token_symbol": "USDTUSDC",
  "pool_config": {
    "pool_type": "stable",
    "amp_factor": null
  },
  "timeout": "3600"
}'
{
  "msgs": [
    {
      "chainId": "137",
      "data": "0x095ea7b300000000000000000000000008e6604931e9c2a978d4861b912f7894cc6063f700000000000000000000000000000000000000000000000000000000000f4240",
      "gasLimit": "0x186A0",
      "to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
      "value": "0x0"
    },
    {
      "chainId": "137",
      "data": "0x095ea7b300000000000000000000000008e6604931e9c2a978d4861b912f7894cc6063f700000000000000000000000000000000000000000000000000000000000f4240",
      "gasLimit": "0x186A0",
      "to": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
      "value": "0x0"
    },
    {
      "chainId": "137",
      "data": "0x2037cccf00000000000000000000000000000000000000000000000000000000000000e0...",
      "gasLimit": "0x493E0",
      "to": "0x08E6604931E9c2a978D4861b912f7894CC6063F7",
      "value": "0x0"
    }
  ],
  "type": "evm"
}
curl -X 'POST'   'https://api.euclidprotocol.com/api/v1/execute/pool/create'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
    "sender": {
      "chain_uid": "nibiru",
      "address": "nibi1l0wgje0y43007xpdqkuxaxluffuxj7fy7eccns"
    },
    "pair": {
      "token_1": {
        "token": "usdt",
        "token_type": {
          "native": {
            "denom": "uusdt"
          }
        },
        "amount": "1000000"
      },
      "token_2": {
        "token": "euclid",
        "token_type": {
          "smart": {
            "contract_address": "nibi17zymknww0ynlgtad22dzgy6kp6qzeg28gmvm5aq32avf9248rvasxtgxuv"
          }
        },
        "amount": "500000"
      }
    },
    "lp_token_name": "USDT.EUCLID",
    "lp_token_decimal": 6,
    "lp_token_symbol": "USDTEUCLID",
    "lp_token_marketing": {
      "project": "Euclid Protocol",
      "description": "Liquidity pool token for USDT-EUCLID on Nibiru",
      "marketing": "contact@euclidprotocol.com",
      "logo": {
        "url": "https://example.com/logo.png"
      }
    },
    "timeout": "3600",
    "slippage_tolerance_bps": 100
}'
{
  "type": "cosmwasm",
  "sender": {
    "chain_uid": "nibiru",
    "address": "nibi1l0wgje0y43007xpdqkuxaxluffuxj7fy7eccns"
  },
  "contract": "nibi1ljsgwzz4zwzuk96f6s20rfemddn6m5lrkmsdyms8at7j5jvk67rqqjl6lq",
  "chain_id": "nibiru-testnet-2",
  "rpc_url": "https://rpc.testnet-2.nibiru.fi",
  "rest_url": "https://lcd.testnet-2.nibiru.fi",
  "msgs": [
    {
      "contractAddress": "nibi1ljsgwzz4zwzuk96f6s20rfemddn6m5lrkmsdyms8at7j5jvk67rqqjl6lq",
      "msg": {
        "request_pool_creation": {
          "lp_token_decimal": 6,
          "lp_token_marketing": {
            "project": "Euclid Protocol",
            "description": "Liquidity pool token for USDT-EUCLID on Nibiru",
            "marketing": "contact@euclidprotocol.com",
            "logo": {
              "url": "https://example.com/logo.png"
            }
          },
          "lp_token_name": "USDT.EUCLID",
          "lp_token_symbol": "USDTEUCLID",
          "pair": {
            "token_1": {
              "token": "euclid",
              "token_type": {
                "smart": {
                  "contract_address": "nibi17zymknww0ynlgtad22dzgy6kp6qzeg28gmvm5aq32avf9248rvasxtgxuv"
                }
              },
              "amount": "500000"
            },
            "token_2": {
              "token": "usdt",
              "token_type": {
                "native": {
                  "denom": "uusdt"
                }
              },
              "amount": "1000000"
            }
          },
          "timeout": "3600"
        }
      },
      "funds": []
    }
  ]
}

Parameters​

FieldTypeDescription
senderCrossChainUserWithAmountAddress and chain initiating the transaction. Defaults to sender.
pairPairWithDenomContains both tokens with types and amounts.
slippage_tolerance_bpsu64Slippage tolerance in basis points (e.g., 30 = 0.3%).
lp_token_namestringName of the liquidity pool token.
lp_token_symbolstringSymbol of the liquidity pool token.
lp_token_decimalu8Number of decimals used in the LP token (typically 18 for EVM).
lp_token_marketingInstantiateMarketingInfo(Ignored in EVM) Optional marketing information for the LP token such as project name and description. Used only in Cosmos deployments.
pool_configPoolConfigConfig for the pool, such as pool type (e.g., stable, constant product) and amplification factor. Only used in EVM.
timeoutu64 (optional)Expiry timeout in seconds for this operation.

pool_config​

FieldTypeDescription
poolTypePoolTypeEnumThe type of pool. Can be Stable or ConstantProduct.
ampFactoruint64Optional amplification factor value. Required for Stable pools. Defaults to 1000 if not specified.

PoolTypeEnum​

ValueDescription
StableUsed for stable pools where price impact is minimized.
ConstantProductUsed for classic x*y=k constant product pools.