# SDK Functions

The Carbon DeFi SDK's main point of interaction is exposed through the functions in **index.ts:**

| Name                                                                                                                    | Description                                                                                                |
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [`constructor`](/developer-guides/carbon-defi-sdk/sdk-functions/constructor.md)                                         | Initializes the SDK.                                                                                       |
| [`startDataSync`](/developer-guides/carbon-defi-sdk/sdk-functions/startdatasync.md)                                     | Fetches event data to create a representation of all Carbon DeFi strategies.                               |
| [`pairs`](/developer-guides/carbon-defi-sdk/sdk-functions/getcachedpairs.md)                                            | Gets a list of all active token pairs.                                                                     |
| [`hasLiquidityByPair`](/developer-guides/carbon-defi-sdk/sdk-functions/hasliquiditybypair.md)                           | Checks if a pair currently has liquidity in one or more strategies.                                        |
| [`getLiquidityByPair`](/developer-guides/carbon-defi-sdk/sdk-functions/getliquiditybypair.md)                           | Returns the total amount of liquidity in Carbon DeFi strategies for a given pair.                          |
| [`getUserStrategies`](/developer-guides/carbon-defi-sdk/sdk-functions/getuserstrategies.md)                             | Gets the list of strategies owned by an address.                                                           |
| [`getTradeData`](/developer-guides/carbon-defi-sdk/sdk-functions/gettradedata.md)                                       | Generates and returns a trade route for a trade, including an unsigned transaction to execute the trade.   |
| [`composeTradeByTargetTransaction`](/developer-guides/carbon-defi-sdk/sdk-functions/composetradebytargettransaction.md) | Creates an unsigned trade transaction for trading by target amount.                                        |
| [`composeTradeBySourceTransaction`](/developer-guides/carbon-defi-sdk/sdk-functions/composetradebysourcetransaction.md) | Creates an unsigned trade transaction for trading by source amount.                                        |
| [`createBuySellStrategy`](/developer-guides/carbon-defi-sdk/sdk-functions/createbuysellstrategy.md)                     | Creates a Carbon DeFi strategy, formatted for smart contract input, and generates an unsigned transaction. |
| [`updateStrategy`](/developer-guides/carbon-defi-sdk/sdk-functions/updatestrategy.md)                                   | Generates an unsigned transaction with updated order parameters.                                           |
| [`deleteStrategy`](/developer-guides/carbon-defi-sdk/sdk-functions/deletestrategy.md)                                   | Generates an unsigned transaction to delete a strategy.                                                    |
| [`getRateLiquidityDepthByPair`](/developer-guides/carbon-defi-sdk/sdk-functions/getrateliquiditydepthbypair.md)         | This returns the amount of liquidity available for a token pair at a specific trade-rate.                  |
| [`getMinRateByPair`](/developer-guides/carbon-defi-sdk/sdk-functions/getminratebypair.md)                               | Gets the current lowest trade price for a given token pair.                                                |
| [`getMaxRateByPair`](/developer-guides/carbon-defi-sdk/sdk-functions/getmaxratebypair.md)                               | Gets the current highest trade price for a given token pair.                                               |


---

# 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.carbondefi.xyz/developer-guides/carbon-defi-sdk/sdk-functions.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.
