> For the complete documentation index, see [llms.txt](https://doc.torch.finance/dex/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.torch.finance/dex/developer-guide/dex-sdk-guide/setup.md).

# Setup

## Installation

```bash
yarn add @torch-finance/sdk @ton/ton @ton/crypto @ton/core
```

## Initialize (Mainnet)

```typescript
import { TorchSDK } from '@torch-finance/sdk';
const sdk = new TorchSDK();
```

## Initialize (Testnet / Custom Network)

```typescript
import { TonClient4 } from '@ton/ton';
import { TorchSDK, TorchSDKOptions } from '@torch-finance/sdk';

const tonClient = new TonClient4({ endpoint: "https://testnet-v4.tonhubapi.com/" });
const factoryAddress = Address.parse("testnet factory address")
const testnetOracle = "https://testnet-oracle.torch.finance"
const testnetAPI = "https://testnet-api.torch.finance"
const config: TorchSDKOptions = {
    tonClient: tonClient,
    factoryAddress: factoryAddress,
    oracleEndpoint: testnetOracle,
    apiEndpoint: testnetAPI,
  };
const sdk = new TorchSDK(config)
```

## Configuration

* Factory Address

<table><thead><tr><th width="199">Network</th><th>Factory Address</th></tr></thead><tbody><tr><td>Mainnet</td><td>EQDQIhFLSzUlaHKM9L2ZQS-o0iNHTbOSBtzNC0VLxPbNFH6E</td></tr><tr><td>Testnet</td><td>EQCNvyhu-VxeL7i-Uk5Uu0m7TO0qQaWQlHmGOUyUh1hoF7au</td></tr></tbody></table>

* Indexer Endpoint

<table><thead><tr><th width="168">Network</th><th>Indexer Endpoint</th></tr></thead><tbody><tr><td>Mainnet</td><td><a href="https://testnet-indexer.torch.finance/">https://indexer.torch.finance/</a></td></tr><tr><td>Testnet</td><td><a href="https://testnet-indexer.torch.finance/">https://testnet-indexer.torch.finance/</a></td></tr></tbody></table>

* Oracle Endpoint

<table><thead><tr><th width="173">Network</th><th>Oracle Endpoint</th></tr></thead><tbody><tr><td>Mainnet</td><td><a href="https://oracle.torch.finance">https://oracle.torch.finance</a></td></tr><tr><td>Testnet</td><td><a href="https://oracle.torch.finance">https://testnet-oracle.torch.finance</a></td></tr></tbody></table>
