# @cetusprotocol/dca-sdk

**DCA (Dollar-Cost Averaging)** is an efficient and low-risk investment strategy, particularly suitable for markets with high volatility. By using the **DCA SDK**, developers can easily integrate this strategy into their applications, helping users achieve long-term, stable investment growth. Through automation and regular investments, the **DCA SDK** helps users reduce the impact of short-term market fluctuations, leading to better investment outcomes.

### Getting Started

### How to Use the Dca SDK ?

#### Installation

To start using the `Dca SDK`, you first need to install it in your TypeScript project:

npm link: <https://www.npmjs.com/package/@cetusprotocol/dca-sdk>

```bash
npm install @cetusprotocol/dca-sdk
```

#### Setup

Import the SDK into the TypeScript file where you intend to use it:

```typescript
import { CetusDcaSDK } from '@cetusprotocol/dca-sdk'
```

#### Initializing the SDK

Initialize the SDK with the required configuration parameters. This typically includes setting up the network and API keys, if needed.

If you would like to use the mainnet network and the official Sui rpc url, you can do so as follows:

```typescript
const sdk = CetusDcaSDK.createSDK()
```

If you wish to set your own full node URL or network (You have the option to select either 'mainnet' or 'testnet' for the network), you can do so as follows:

```typescript
const env = 'mainnet'
const full_rpc_url = 'YOUR_FULL_NODE_URL'
const wallet = 'YOUR_WALLET_ADDRESS'

const sdk = CetusDcaSDK.createSDK({ env })
```

If you wish to set your own full node URL or SuiClient, you can do so as follows:

```typescript
const sdk = CetusDcaSDK.createSDK({ env, sui_client })
// or
const sdk = CetusDcaSDK.createSDK({ env, full_rpc_url })
```

### Features & Usage

After linking your wallet, you need to set it by `sdk.setSenderAddress`.

```typescript
const wallet = 'YOUR_WALLET_ADDRESS'

sdk.setSenderAddress(wallet)
```
