# Prices

Price and ratio queries.

## Get price ratio

> Returns the current price ratio of token B in terms of token A. Note that token A and token B do not always correlate to the first and second tokens in the pool name.

```json
{"openapi":"3.0.3","info":{"title":"Tradecraft AMM HTTP API","version":"0.1.8.7"},"tags":[{"name":"Prices","description":"Price and ratio queries."}],"servers":[{"url":"https://api.tradecraft.fi/v1","description":"Mainnet"}],"paths":{"/ratio/{tokenA}/{tokenB}":{"get":{"summary":"Get price ratio","description":"Returns the current price ratio of token B in terms of token A. Note that token A and token B do not always correlate to the first and second tokens in the pool name.","operationId":"getRatio","tags":["Prices"],"parameters":[{"$ref":"#/components/parameters/tokenA"},{"$ref":"#/components/parameters/tokenB"}],"responses":{"200":{"description":"Price ratio","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioResponse"}}}},"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"]}},"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":{"RatioResponse":{"type":"object","required":["price_of_b_in_a"],"properties":{"price_of_b_in_a":{"type":"number","format":"double","description":"The price of token B expressed in token A (tokenB_holdings / tokenA_holdings)."}}},"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/prices.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.
