Skip to main content
This guide covers advanced features of the Drift SDK including custom transaction handling, event processing, high-leverage mode, and advanced order types.

Custom Transaction Handling

Custom Transaction Sender

Implement custom transaction submission logic:

Priority Fees

Add compute budget and priority fees to transactions:

Dynamic Priority Fees

Event Processing

Transaction Event Parsing

Parse Transaction Logs

High Leverage Mode

High Leverage Mode allows increased position leverage with specific margin requirements:
High Leverage Mode has higher margin requirements and liquidation risk. Only use if you understand the risks.

Advanced Order Features

Place and Take

Place an order and immediately attempt to fill it against the book:

Protected Maker Mode

Protected Maker Mode prevents your maker orders from being filled by your own taker orders:

Maker Order Referrals

Set maker referral for order rebates:

Bulk Operations

Cancel Multiple Orders

Batch Place Orders

Spot Swaps

Swap between spot assets:

With Slippage Protection

Address Lookup Tables

Use address lookup tables to reduce transaction size:

Custom Confirmations

Rate Limiting

Best Practices

Different operations require different compute budgets. Monitor your transactions and adjust accordingly.
Always listen to event logs to confirm your operations executed as expected.
Use batch operations like placeOrders to save on transaction fees and reduce latency.

Next Steps

Examples

Real-world implementation examples

API Reference

Complete API documentation

Trading API

Advanced trading features

Event Listening

Process transaction events