# Pools

Liquidity Pool information and listing.

## List all liquidity pools

> Returns information about all available liquidity pools.

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"0.1.8.7"},"tags":[{"name":"Pools","description":"Liquidity Pool information and listing."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"}],"paths":{"/pools":{"get":{"summary":"List all liquidity pools","description":"Returns information about all available liquidity pools.","operationId":"listPools","tags":["Pools"],"responses":{"200":{"description":"List of liquidity pools","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPoolsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"ListPoolsResponse":{"type":"object","required":["pools"],"properties":{"pools":{"type":"array","items":{"$ref":"#/components/schemas/PoolInfo"},"description":"Array of pool information objects."}}},"PoolInfo":{"type":"object","required":["token1","token2","lp_token_name","token1_holdings","token2_holdings","total_lp_tokens","lp_fee_percent","operator_fee_percent"],"properties":{"token1":{"type":"string","description":"The symbol/code of the first token in the pool."},"token2":{"type":"string","description":"The symbol/code of the second token in the pool."},"lp_token_name":{"type":"string","description":"The liquidity pool token name/identifier."},"token1_holdings":{"type":"number","format":"double","description":"Amount of token1 held in the pool."},"token2_holdings":{"type":"number","format":"double","description":"Amount of token2 held in the pool."},"total_lp_tokens":{"type":"number","format":"double","description":"Total supply of LP tokens for this pool."},"lp_fee_percent":{"type":"number","format":"double","description":"Liquidity provider fee as a percentage (e.g., 0.3 means 0.3%)."},"operator_fee_percent":{"type":"number","format":"double","description":"Operator fee as a percentage (e.g., 0.1 means 0.1%)."},"yield24h":{"type":"number","format":"double","nullable":true,"description":"24-hour annualized yield (APY) for the pool. Null if unavailable."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get a liquidity pool's ID

> Returns the liquidity pool identifier for a token pair.

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"0.1.8.7"},"tags":[{"name":"Pools","description":"Liquidity Pool information and listing."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"}],"paths":{"/ammid/{tokenA}/{tokenB}":{"get":{"summary":"Get a liquidity pool's ID","description":"Returns the liquidity pool identifier for a token pair.","operationId":"getAmmId","tags":["Pools"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"}],"responses":{"200":{"description":"Liquidity pool ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmmIdResponse"}}}},"400":{"description":"Liquidity pool not found or invalid token names given","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"parameters":{"tokenA":{"name":"tokenA","in":"path","required":true,"description":"The name/symbol of the first token (URL encoded).","schema":{"type":"string","enum":["CC","USDCx","CBTC","CETH","HANDL"]}},"tokenB":{"name":"tokenB","in":"path","required":true,"description":"The name/symbol of the second token (URL encoded).","schema":{"type":"string","enum":["CC","USDCx","CBTC","CETH","HANDL"]}}},"schemas":{"AmmIdResponse":{"type":"object","required":["amm_id"],"properties":{"amm_id":{"type":"string","description":"The AMM pool identifier"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get liquidity pool state

> Returns detailed information about the liquidity pool state including holdings, supply, and the constant product K.

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"0.1.8.7"},"tags":[{"name":"Pools","description":"Liquidity Pool information and listing."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"}],"paths":{"/inspect/{tokenA}/{tokenB}":{"get":{"summary":"Get liquidity pool state","description":"Returns detailed information about the liquidity pool state including holdings, supply, and the constant product K.","operationId":"inspectAmm","tags":["Pools"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"}],"responses":{"200":{"description":"Pool state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmmInspectResponse"}}}},"400":{"description":"Pool not found or token unknown","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"parameters":{"tokenA":{"name":"tokenA","in":"path","required":true,"description":"The name/symbol of the first token (URL encoded).","schema":{"type":"string","enum":["CC","USDCx","CBTC","CETH","HANDL"]}},"tokenB":{"name":"tokenB","in":"path","required":true,"description":"The name/symbol of the second token (URL encoded).","schema":{"type":"string","enum":["CC","USDCx","CBTC","CETH","HANDL"]}}},"schemas":{"AmmInspectResponse":{"type":"object","description":"Detailed AMM pool state (V4 contract format).","required":["total_lp_token_supply","token_a_id","token_a_holdings","token_b_id","token_b_holdings","k","unclaimed_operator_fees","updated_at"],"properties":{"total_lp_token_supply":{"type":"number","format":"double","description":"Total supply of LP tokens."},"token_a_id":{"type":"string","description":"Identifier for token A."},"token_a_holdings":{"type":"number","format":"double","description":"Amount of token A in the pool."},"token_b_id":{"type":"string","description":"Identifier for token B."},"token_b_holdings":{"type":"number","format":"double","description":"Amount of token B in the pool."},"k":{"type":"number","format":"double","description":"The constant product (token_a_holdings * token_b_holdings)."},"unclaimed_operator_fees":{"type":"number","format":"double","description":"Accumulated operator fees awaiting claim (V4)."},"updated_at":{"type":"string","format":"date-time","description":"Timestamp of the last pool operation (V4)."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get pool disclosures

> Returns disclosed contract blobs for the pool's AMM, AMMFees, AMMRules, LP instrument config,\
> allocation factory, and featured app right contracts. These disclosures are required by clients\
> to submit transactions (swaps, deposits, withdrawals) against the pool.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"0.1.8.7"},"tags":[{"name":"Pools","description":"Liquidity Pool information and listing."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"}],"paths":{"/disclosures/{tokenA}/{tokenB}":{"get":{"summary":"Get pool disclosures","description":"Returns disclosed contract blobs for the pool's AMM, AMMFees, AMMRules, LP instrument config,\nallocation factory, and featured app right contracts. These disclosures are required by clients\nto submit transactions (swaps, deposits, withdrawals) against the pool.\n","operationId":"getPoolDisclosures","tags":["Pools"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"}],"responses":{"200":{"description":"Pool disclosures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolDisclosuresResponse"}}}},"404":{"description":"Pool not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"parameters":{"tokenA":{"name":"tokenA","in":"path","required":true,"description":"The name/symbol of the first token (URL encoded).","schema":{"type":"string","enum":["CC","USDCx","CBTC","CETH","HANDL"]}},"tokenB":{"name":"tokenB","in":"path","required":true,"description":"The name/symbol of the second token (URL encoded).","schema":{"type":"string","enum":["CC","USDCx","CBTC","CETH","HANDL"]}}},"schemas":{"PoolDisclosuresResponse":{"type":"object","description":"Disclosed contracts needed to submit transactions against this pool.\nIncludes the AMM, fees, rules, LP instrument config, allocation factory,\nand optionally the featured app right contract.\n","required":["amm","amm_fees","instrument_config","allocation_factory","amm_data","amm_fees_data"],"properties":{"amm":{"$ref":"#/components/schemas/DisclosedContract"},"amm_fees":{"$ref":"#/components/schemas/DisclosedContract"},"amm_rules":{"$ref":"#/components/schemas/DisclosedContract"},"instrument_config":{"$ref":"#/components/schemas/DisclosedContract"},"allocation_factory":{"$ref":"#/components/schemas/DisclosedContract"},"featured_app_right":{"$ref":"#/components/schemas/DisclosedContract"},"amm_data":{"type":"object","description":"Parsed V4 AMM contract data"},"amm_fees_data":{"type":"object","description":"Parsed V4 AMMFees contract data"},"amm_rules_data":{"type":"object","description":"Parsed AMMRules contract data (if present)"},"featured_app_right_id":{"type":"string","nullable":true,"description":"Contract ID of the FeaturedAppRight (if present)"}}},"DisclosedContract":{"type":"object","description":"A disclosed contract blob from the Canton ledger, required for submitting transactions.","required":["templateId","contractId","createdEventBlob","synchronizerId"],"properties":{"templateId":{"type":"string","description":"Fully qualified template identifier (packageId:moduleName:entityName)"},"contractId":{"type":"string","description":"The contract ID on the ledger"},"createdEventBlob":{"type":"string","format":"byte","description":"Base64-encoded created event blob"},"synchronizerId":{"type":"string","description":"The synchronizer (domain) ID where this contract lives"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tradecraft.fi/api/routes/pools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
