Skip to main content
GLAM integrates with Drift Protocol for spot trading, perpetual trading, and Drift Vaults. The SDK provides two sub-clients:
  • drift — Drift Protocol v2 (spot and perp trading)
  • driftVaults — Drift Vaults (managed vault deposits)

Drift Protocol

Initialize User

Before trading on Drift, initialize a Drift user account for the vault:

Deposit

Deposit assets into a Drift spot market:

Withdraw

Withdraw assets from a Drift spot market:

Place Order

Place a spot or perpetual order:

Cancel Orders

Cancel orders by market or by specific order IDs:

Settle PnL

Settle profit and loss for a perpetual market position:

Configure User

Update margin and trading settings:

Delete User

Delete a Drift user account when no longer needed:

Drift Vaults

Initialize Depositor

Initialize a vault depositor account before depositing:

Deposit

Deposit assets into a Drift Vault:

Withdraw

Drift Vault withdrawals follow a request-withdraw-claim flow: