# SDK Initialization

### Basic Setup

```typescript
import { initFerraDlmmSDK } from '@ferra-labs/dlmm'

const sdk = initFerraDlmmSDK({
  network: 'mainnet',
  fullNodeUrl: 'https://fullnode.mainnet.sui.io:443',
  wallet: '0x...' // Your wallet address
})
```

### Configuration Options

#### Required Parameters

| Parameter       | Type                     | Description                     |
| --------------- | ------------------------ | ------------------------------- |
| `network`       | `'mainnet' \| 'testnet'` | Target network                  |
| `fullNodeUrl`   | `string`                 | Sui RPC endpoint URL            |
| `senderAddress` | `string`                 | Default sender for transactions |

#### Network Configurations

**Mainnet**

```typescript
const sdk = initFerraDlmmSDK({
  network: 'mainnet',
  fullNodeUrl: 'https://fullnode.mainnet.sui.io:443',
  wallet: '0x...'
})
```

**Testnet**

```typescript
const sdk = initFerraDlmmSDK({
  network: 'testnet', 
  fullNodeUrl: 'https://fullnode.testnet.sui.io:443',
  wallet: '0x...'
})
```

**Custom RPC**

```typescript
const sdk = initFerraDlmmSDK({
  network: 'mainnet',
  fullNodeUrl: 'https://your-custom-rpc.com',
  wallet: '0x...'
})
```

### Error Handling

```typescript
try {
  const sdk = initFerraDlmmSDK({
    network: 'mainnet',
    fullNodeUrl: 'invalid-url',
    wallet: '0x...'
  })
} catch (error) {
  if (error.message.includes('Invalid RPC')) {
    console.error('Please check your RPC URL')
  }
}
```

### Best Practices

1. **Single Instance**: Create one SDK instance per app
2. **Error Handling**: Always wrap initialization in try-catch
3. **Network Matching**: Ensure wallet and SDK use same network
4. **RPC Selection**: Use reliable RPC providers for production
5. **Address Validation**: Validate sender address format

### Next Steps

SDK initialized! Continue to:

* [Key Concepts](/integration/dlmm/typescript-sdk/getting-started/key-concepts.md) - Understand DLMM fundamentals
* [Create Pair](/integration/dlmm/typescript-sdk/trading-pairs/create-lb-pair.md) - Deploy a trading pair
* [Get All Pairs](/integration/dlmm/typescript-sdk/trading-pairs/get-all-pairs.md) - Explore existing pairs


---

# 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.ferra.ag/integration/dlmm/typescript-sdk/getting-started/sdk-initialization.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.
