> For the complete documentation index, see [llms.txt](https://docs.tradecraft.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tradecraft.fi/api/routes/liquidity.md).

# Liquidity

Liquidity provider operations.

## Get liquidity withdrawal quote

> Calculate how much of each token the user will receive when redeeming LP tokens.

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/quoteLPWithdrawal/{tokenA}/{tokenB}":{"get":{"summary":"Get liquidity withdrawal quote","description":"Calculate how much of each token the user will receive when redeeming LP tokens.","operationId":"getQuoteLiquidityWithdrawal","tags":["Liquidity"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"},{"name":"lpTokenAmount","in":"query","required":true,"description":"The amount of LP tokens to redeem","schema":{"type":"number","format":"double","minimum":0,"exclusiveMinimum":true}}],"responses":{"200":{"description":"Liquidity withdrawal quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteLPWithdrawalResponse"}}}},"400":{"description":"Invalid parameters or liquidity 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","EDELx","SBC"]}},"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","EDELx","SBC"]}}},"schemas":{"QuoteLPWithdrawalResponse":{"type":"object","required":["amount_instrument_1","amount_instrument_2"],"properties":{"amount_instrument_1":{"type":"number","format":"double","description":"Amount of instrument 1 to receive."},"amount_instrument_2":{"type":"number","format":"double","description":"Amount of instrument 2 to receive."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get liquidity deposit quote

> Calculate the maximum LP tokens that can be minted given the provided amounts of both instruments.\
> Returns the optimal deposit amounts maintaining the pool ratio.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/quoteLPDeposit/{tokenA}/{tokenB}":{"get":{"summary":"Get liquidity deposit quote","description":"Calculate the maximum LP tokens that can be minted given the provided amounts of both instruments.\nReturns the optimal deposit amounts maintaining the pool ratio.\n","operationId":"getQuoteLiquidityDeposit","tags":["Liquidity"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"},{"name":"instrument1Amount","in":"query","required":true,"description":"The amount of instrument 1 available for deposit","schema":{"type":"number","format":"double","minimum":0}},{"name":"instrument2Amount","in":"query","required":true,"description":"The available amount of instrument 2 available for deposit","schema":{"type":"number","format":"double","minimum":0}}],"responses":{"200":{"description":"Liquidity deposit quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteLPDepositResponse"}}}},"400":{"description":"Invalid parameters or liquidity 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","EDELx","SBC"]}},"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","EDELx","SBC"]}}},"schemas":{"QuoteLPDepositResponse":{"type":"object","required":["lp_tokens_to_mint","instrument_1_to_deposit","instrument_2_to_deposit"],"properties":{"lp_tokens_to_mint":{"type":"number","format":"double","description":"Amount of LP tokens that will be minted."},"instrument_1_to_deposit":{"type":"number","format":"double","description":"Amount of instrument 1 required for deposit."},"instrument_2_to_deposit":{"type":"number","format":"double","description":"Amount of instrument 2 required for deposit."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get pool yield/APY

> Returns annualized percentage yield (APY) calculations for the pool across multiple time periods.\
> APY is calculated based on the growth of value per LP token (k / lpSupply) over time.\
> Requires Apollo DB connection for historical data; returns empty yield data if unavailable.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/yield/{tokenA}/{tokenB}":{"get":{"summary":"Get pool yield/APY","description":"Returns annualized percentage yield (APY) calculations for the pool across multiple time periods.\nAPY is calculated based on the growth of value per LP token (k / lpSupply) over time.\nRequires Apollo DB connection for historical data; returns empty yield data if unavailable.\n","operationId":"getPoolYield","tags":["Liquidity"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"}],"responses":{"200":{"description":"Pool yield data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolYieldResponse"}}}},"400":{"description":"AMM 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","EDELx","SBC"]}},"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","EDELx","SBC"]}}},"schemas":{"PoolYieldResponse":{"type":"object","required":["pool_id","yield"],"properties":{"pool_id":{"type":"string","description":"The AMM pool identifier"},"yield":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Map of time period labels to annualized percentage yield (APY) values.\nKeys are time periods (1h, 4h, 12h, 1d, 2d, 3d, 7d, 14d, 30d).\nValues are APY as decimals (e.g., 0.05 = 5% APY).\nA value of 0 indicates insufficient data for that period.\n"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get historical yield/APY over time

> Returns an array of timestamped APY data points for the pool.\
> Each data point represents the annualized yield during that time interval,\
> calculated based on the growth of value per LP token (sqrt(k) / lpSupply).\
> Timestamps are aligned to interval boundaries (e.g., top of minute, top of hour, midnight).\
> \
> Available windows:\
> \- hour: 60 data points at 1-minute intervals\
> \- day: 288 data points at 5-minute intervals\
> \- week: 168 data points at 1-hour intervals\
> \
> Requires Apollo DB connection for historical data.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/yield_history/{tokenA}/{tokenB}":{"get":{"summary":"Get historical yield/APY over time","description":"Returns an array of timestamped APY data points for the pool.\nEach data point represents the annualized yield during that time interval,\ncalculated based on the growth of value per LP token (sqrt(k) / lpSupply).\nTimestamps are aligned to interval boundaries (e.g., top of minute, top of hour, midnight).\n\nAvailable windows:\n- hour: 60 data points at 1-minute intervals\n- day: 288 data points at 5-minute intervals\n- week: 168 data points at 1-hour intervals\n\nRequires Apollo DB connection for historical data.\n","operationId":"getPoolYieldHistory","tags":["Liquidity"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"},{"name":"window","in":"query","required":true,"description":"The time window for the yield history","schema":{"type":"string","enum":["hour","day","week"]}}],"responses":{"200":{"description":"Historical yield data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolYieldHistoryResponse"}}}},"400":{"description":"AMM not found or invalid window","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","EDELx","SBC"]}},"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","EDELx","SBC"]}}},"schemas":{"PoolYieldHistoryResponse":{"type":"object","required":["pool_id","window","history"],"properties":{"pool_id":{"type":"string","description":"The AMM pool identifier"},"window":{"type":"string","description":"The requested time window","enum":["hour","day","week"]},"history":{"type":"array","description":"Array of timestamped APY data points, ordered from oldest to newest","items":{"$ref":"#/components/schemas/YieldHistoryDataPoint"}}}},"YieldHistoryDataPoint":{"type":"object","required":["timestamp","apy"],"properties":{"timestamp":{"type":"string","format":"date-time","description":"The start of the time interval (RFC3339 format)"},"apy":{"type":"number","format":"double","description":"Annualized percentage yield during this interval (e.g., 0.05 = 5% APY)"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get pool trading volume in USD

> Returns USD-denominated trading volume for the pool across multiple time periods.\
> Volume is calculated by tracking changes in AMM reserves between consecutive states.\
> Each swap is converted to USD at the exchange rate that was active at the time of that swap.\
> USD conversion is performed using:\
> \- Stablecoins (SBC, USDCx): 1:1 with USD\
> \- CC (Canton Coin): Historical exchange rate from OpenMiningRound contracts via Scan ACS API\
> Returns an error if neither token can be converted to USD.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/volume/{tokenA}/{tokenB}":{"get":{"summary":"Get pool trading volume in USD","description":"Returns USD-denominated trading volume for the pool across multiple time periods.\nVolume is calculated by tracking changes in AMM reserves between consecutive states.\nEach swap is converted to USD at the exchange rate that was active at the time of that swap.\nUSD conversion is performed using:\n- Stablecoins (SBC, USDCx): 1:1 with USD\n- CC (Canton Coin): Historical exchange rate from OpenMiningRound contracts via Scan ACS API\nReturns an error if neither token can be converted to USD.\n","operationId":"getPoolVolume","tags":["Liquidity"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"}],"responses":{"200":{"description":"Pool volume data in USD","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolVolumeResponse"}}}},"400":{"description":"AMM not found or cannot calculate USD volume","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","EDELx","SBC"]}},"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","EDELx","SBC"]}}},"schemas":{"PoolVolumeResponse":{"type":"object","required":["pool_id","volume_usd"],"properties":{"pool_id":{"type":"string","description":"The AMM pool identifier"},"volume_usd":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Map of time period labels to USD-denominated trading volume.\nKeys are time periods (1h, 4h, 12h, 1d, 2d, 3d, 7d, 14d, 30d).\nValues are the total swap volume in USD for that period.\nUSD conversion uses stablecoin rates (1:1) or CC exchange rate from Scan API.\n"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get historical trading volume over time

> Returns an array of timestamped volume data points for the pool.\
> Each data point represents the USD-denominated trading volume during that time interval.\
> Timestamps are aligned to interval boundaries (e.g., top of minute, top of hour, midnight).\
> \
> Available windows:\
> \- hour: 60 data points at 1-minute intervals\
> \- day: 288 data points at 5-minute intervals\
> \- week: 168 data points at 1-hour intervals\
> \
> Volume calculation uses the same methodology as /volume endpoint.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/volume_history/{tokenA}/{tokenB}":{"get":{"summary":"Get historical trading volume over time","description":"Returns an array of timestamped volume data points for the pool.\nEach data point represents the USD-denominated trading volume during that time interval.\nTimestamps are aligned to interval boundaries (e.g., top of minute, top of hour, midnight).\n\nAvailable windows:\n- hour: 60 data points at 1-minute intervals\n- day: 288 data points at 5-minute intervals\n- week: 168 data points at 1-hour intervals\n\nVolume calculation uses the same methodology as /volume endpoint.\n","operationId":"getPoolVolumeHistory","tags":["Liquidity"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"},{"name":"window","in":"query","required":true,"description":"The time window for the volume history","schema":{"type":"string","enum":["hour","day","week"]}}],"responses":{"200":{"description":"Historical volume data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolVolumeHistoryResponse"}}}},"400":{"description":"AMM not found, invalid window, or cannot calculate USD volume","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","EDELx","SBC"]}},"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","EDELx","SBC"]}}},"schemas":{"PoolVolumeHistoryResponse":{"type":"object","required":["pool_id","window","history"],"properties":{"pool_id":{"type":"string","description":"The AMM pool identifier"},"window":{"type":"string","description":"The requested time window","enum":["hour","day","week"]},"history":{"type":"array","description":"Array of timestamped volume data points, ordered from oldest to newest","items":{"$ref":"#/components/schemas/VolumeHistoryDataPoint"}}}},"VolumeHistoryDataPoint":{"type":"object","required":["timestamp","volume_usd"],"properties":{"timestamp":{"type":"string","format":"date-time","description":"The start of the time interval (RFC3339 format)"},"volume_usd":{"type":"number","format":"double","description":"Trading volume in USD during this interval"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get V7 concentrated-liquidity deposit quote

> Quotes the largest deposit into a V7 pool whose fixed amount does not\
> exceed the request, at the current pool state.\
> \
> The returned ticks are the narrowest range aligned to the pool's tick\
> spacing that contains both prices. Both amounts are rounded up, as the\
> pool debits them.\
> \
> \`token1\` and \`token2\` must be in the pool's order. Prices are token2\
> per token1. Give exactly one of \`amount1\` and \`amount2\`. All values are\
> scale-10 decimal strings.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/v7/deposit/quote/{token1}/{token2}":{"get":{"summary":"Get V7 concentrated-liquidity deposit quote","description":"Quotes the largest deposit into a V7 pool whose fixed amount does not\nexceed the request, at the current pool state.\n\nThe returned ticks are the narrowest range aligned to the pool's tick\nspacing that contains both prices. Both amounts are rounded up, as the\npool debits them.\n\n`token1` and `token2` must be in the pool's order. Prices are token2\nper token1. Give exactly one of `amount1` and `amount2`. All values are\nscale-10 decimal strings.\n","operationId":"getDepositQuoteV7","tags":["Liquidity"],"parameters":[{"name":"token1","in":"path","required":true,"description":"Instrument id of the pool's first instrument.","schema":{"type":"string"}},{"name":"token2","in":"path","required":true,"description":"Instrument id of the pool's second instrument.","schema":{"type":"string"}},{"name":"minPrice","in":"query","required":true,"description":"Lowest price of the range, in token2 per token1.","schema":{"type":"string"}},{"name":"maxPrice","in":"query","required":true,"description":"Highest price of the range, in token2 per token1.","schema":{"type":"string"}},{"name":"amount1","in":"query","required":false,"description":"Amount of token1 to deposit.","schema":{"type":"string"}},{"name":"amount2","in":"query","required":false,"description":"Amount of token2 to deposit.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deposit quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositQuoteV7Response"}}}},"400":{"description":"Invalid parameters, wrong token order, or quote math error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No V7 pool found for the given token pair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error fetching pool state or computing the quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"DepositQuoteV7Response":{"type":"object","description":"A V7 deposit quote at the current pool state.","required":["currentPrice","tickLower","tickUpper","liquidity","amount1","amount2"],"properties":{"currentPrice":{"type":"string","description":"Current pool price in token2 per token1, scale-10."},"tickLower":{"type":"integer","format":"int64","description":"Inclusive lower tick, aligned to the tick spacing."},"tickUpper":{"type":"integer","format":"int64","description":"Exclusive upper tick, aligned to the tick spacing."},"liquidity":{"type":"string","description":"Liquidity to request in the deposit order, scale-10."},"amount1":{"type":"string","description":"Amount of token1 the pool debits, scale-10."},"amount2":{"type":"string","description":"Amount of token2 the pool debits, scale-10."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## List a party's V7 positions

> Lists the owner's live V7 positions, by pool then tick range. Each\
> position carries what a full withdrawal pays at the current pool\
> state, and its owed fees.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/v7/positions/{owner}":{"get":{"summary":"List a party's V7 positions","description":"Lists the owner's live V7 positions, by pool then tick range. Each\nposition carries what a full withdrawal pays at the current pool\nstate, and its owed fees.\n","operationId":"getPositionsV7","tags":["Liquidity"],"parameters":[{"name":"owner","in":"path","required":true,"description":"The party that owns the positions.","schema":{"type":"string"}}],"responses":{"200":{"description":"The owner's positions; empty when there are none","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsV7Response"}}}},"400":{"description":"Malformed owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error listing or valuing the positions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"PositionsV7Response":{"type":"object","required":["positions"],"properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/PositionV7"}}}},"PositionV7":{"type":"object","description":"One live V7 position, valued at its pool's current state. A pool,\nowner and tick range identify it. Prices are instrument2 per\ninstrument1. All decimals are scale-10 strings.\n","required":["ammId","instrument1","instrument2","tickLower","tickUpper","liquidity","priceLower","priceUpper","inRange","amount1","amount2","fees1","fees2"],"properties":{"ammId":{"type":"string"},"instrument1":{"$ref":"#/components/schemas/InstrumentId"},"instrument2":{"$ref":"#/components/schemas/InstrumentId"},"tickLower":{"type":"integer","format":"int64","description":"Inclusive lower tick."},"tickUpper":{"type":"integer","format":"int64","description":"Exclusive upper tick."},"liquidity":{"type":"string","description":"The position's liquidity, which a full withdrawal order names."},"priceLower":{"type":"string"},"priceUpper":{"type":"string"},"inRange":{"type":"boolean","description":"Whether the current tick is inside the range."},"amount1":{"type":"string","description":"Amount of instrument1 a full withdrawal pays, rounded down."},"amount2":{"type":"string","description":"Amount of instrument2 a full withdrawal pays, rounded down."},"fees1":{"type":"string","description":"Owed instrument1 fees, including those accrued since the\nposition last changed, rounded down. A withdrawal does not pay\nthem. A collect after any withdrawal, even of zero liquidity,\npays all of them. A collect alone pays only the fees stored on\nthe position.\n"},"fees2":{"type":"string","description":"Owed instrument2 fees, as for fees1."}}},"InstrumentId":{"type":"object","description":"Unique identifier for a financial instrument.","required":["admin","id"],"properties":{"admin":{"type":"string","description":"The party administering the instrument"},"id":{"type":"string","description":"The instrument identifier"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## List V7 order factories

> Returns the venue's V7 order factories, one per pool. An order\
> submission discloses the factory of its pool.<br>

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"1.29.0"},"tags":[{"name":"Liquidity","description":"Liquidity provider operations."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"},{"url":"https://tradecraft.validator.test.canton.obsidian.systems/amm-http-api","description":"Testnet"},{"url":"https://tradecraft.validator.dev.canton.obsidian.systems/amm-http-api","description":"Devnet"}],"paths":{"/v7/disclosures/factories":{"get":{"summary":"List V7 order factories","description":"Returns the venue's V7 order factories, one per pool. An order\nsubmission discloses the factory of its pool.\n","operationId":"listFactoriesV7","tags":["Liquidity"],"responses":{"200":{"description":"V7 order factories with their disclosures","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/V7FactoryDisclosure"}}}}}}}}},"components":{"schemas":{"V7FactoryDisclosure":{"type":"object","description":"One pool's order factory, with the disclosure that an order submission needs.","required":["pool","tickSpacing","contractId","disclosure"],"properties":{"pool":{"$ref":"#/components/schemas/V7PoolRef"},"tickSpacing":{"type":"integer","format":"int64"},"contractId":{"type":"string","description":"The factory's contract ID."},"disclosure":{"$ref":"#/components/schemas/DisclosedContract"}}},"V7PoolRef":{"type":"object","description":"The pool reference of a V7 order.","required":["venue","vault","ammId","instrument1","instrument2"],"properties":{"venue":{"type":"string"},"vault":{"type":"string"},"ammId":{"type":"string"},"instrument1":{"$ref":"#/components/schemas/InstrumentId"},"instrument2":{"$ref":"#/components/schemas/InstrumentId"}}},"InstrumentId":{"type":"object","description":"Unique identifier for a financial instrument.","required":["admin","id"],"properties":{"admin":{"type":"string","description":"The party administering the instrument"},"id":{"type":"string","description":"The instrument identifier"}}},"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"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tradecraft.fi/api/routes/liquidity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
