# SDK Functions

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

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