Skip to main content
This example shows how to initialize Drift Client, connect your wallet, and deposit collateral.

Complete Example

connect-deposit.ts

Step-by-Step

1

Initialize SDK Config

Gets the correct program IDs and addresses for the environment.
2

Create Connection

Connects to Solana RPC.
3

Initialize DriftClient

4

Deposit Collateral

Creates account and deposits in one transaction.

Next Steps

Place Order

Place your first order

Account Management

Learn more about accounts