⏳ Historical Data
Historical Data v2

Historical Data v2

To download records of interest, combine the URL Prefix with one of the Route Suffixes in the table below.

URL Prefix: https://drift-historical-data-v2.s3.eu-west-1.amazonaws.com/program/dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH/ (opens in a new tab)

Record TypeRoute SuffixExample
Tradesuser/accountKey/tradeRecords/year/yearmonthdayUser Trades 20240124 (opens in a new tab)
Market Tradesmarket/marketSymbol/tradeRecords/year/yearmonthdayMarket Trades 20240220 (opens in a new tab)
Funding Ratesmarket/marketSymbol/fundingRateRecords/year/yearmonthdayFunding Rates 20240319 (opens in a new tab)
Funding Paymentsuser/accountKey/fundingPaymentRecords/year/yearmonthdayUser Funding Payments 20231224 (opens in a new tab)
Depositsuser/accountKey/depositRecords/year/yearmonthdayUser Deposits 20240215 (opens in a new tab)
Liquidationsuser/accountKey/liquidationRecords/year/yearmonthdayUser Liquidations 20240106 (opens in a new tab)
Settle PNLuser/accountKey/settlePnlRecords/year/yearmonthdayUser Settle PNL 20240124 (opens in a new tab)
LP (BAL)user/accountKey/lpRecord/year/yearmonthdayUser LP 20240119 (opens in a new tab)
Insurance Fundmarket/marketSymbol/insuranceFundRecords/year/yearmonthdayMarket Insurance Fund 20240214 (opens in a new tab)
Insurance Fund Stakeauthority/authorityAccountKey/insuranceFundStakeRecords/year/yearmonthdayInsurance Fund Stake 20240305 (opens in a new tab)

Example:

Get historical trades on SOL-PERP for Jan 1, 2024: https://drift-historical-data-v2.s3.eu-west-1.amazonaws.com/program/dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH/market/SOL-PERP/tradeRecords/2024/20240101 (opens in a new tab)

Variables

variabledescriptionexample
accountKeyuser sub account public key (not authority)
authorityauthority public key
marketSymbolmarket nameSOL-PERP
year2023
month4
dayutc time25
candleResolution1M
⚠️

Your user subaccount public key is not your wallet's public key (authority)!

If you use your wallet's public key instead of user subaccount public key, you will get "Access Denied".

Authority is your wallet's public key, what you see in the URL when you connect your wallet to app.drift.trade (opens in a new tab). Example: https://app.drift.trade/overview?authority=<your-public-key>

User subaccount public key is your subaccount unique identifier and even though one wallet can have multiple subaccounts, each subaccount public key is unique.

Where to find user subaccount public key?

You can find your user subaccount public key in the Settings modal, if you hover over ℹ️ icon:

Historical data in the API documentation (opens in a new tab)