38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
# Trading Workflows
|
|
|
|
This page is for builders who want to execute trades programmatically (with or without a bot). It focuses on the core SDK flow: connect → read markets → place orders → manage risk → manage collateral.
|
|
|
|
<Steps>
|
|
### Set up the SDK + wallet
|
|
|
|
You'll create a `DriftClient`, connect to RPC, and initialize your wallet and environment.
|
|
|
|
- [SDK setup](/developers/drift-sdk/setup)
|
|
|
|
### Read markets + oracles
|
|
|
|
Fetch market metadata, oracle prices, and subscriptions before trading.
|
|
|
|
- [Markets](/developers/drift-sdk/markets)
|
|
|
|
### Place and cancel orders
|
|
|
|
Use order helpers for limit/market/oracle/trigger orders, and handle cancels/edits.
|
|
|
|
- [Orders](/developers/drift-sdk/orders)
|
|
- [Users](/developers/drift-sdk/users)
|
|
|
|
### Monitor PnL and risk
|
|
|
|
Track margin, health, and PnL before and after trades.
|
|
|
|
- [PnL & risk](/developers/drift-sdk/pnl-risk)
|
|
- [Events](/developers/drift-sdk/events)
|
|
|
|
### Manage collateral and exits
|
|
|
|
Deposit/withdraw collateral, settle PnL, and close positions safely.
|
|
|
|
- [Deposits & withdrawals](/developers/drift-sdk/deposits-withdrawals)
|
|
</Steps>
|