Historical Data v2
To download records of interest, combine the URL Prefix with one of the Route Suffixes in the table below.
Record Type | Route Suffix | Example |
---|---|---|
Trades | user/accountKey /tradeRecords/year /yearmonthday | User Trades 20240124 (opens in a new tab) |
Market Trades | market/marketSymbol /tradeRecords/year /yearmonthday | Market Trades 20240220 (opens in a new tab) |
Funding Rates | market/marketSymbol /fundingRateRecords/year /yearmonthday | Funding Rates 20240319 (opens in a new tab) |
Funding Payments | user/accountKey /fundingPaymentRecords/year /yearmonthday | User Funding Payments 20231224 (opens in a new tab) |
Deposits | user/accountKey /depositRecords/year /yearmonthday | User Deposits 20240215 (opens in a new tab) |
Liquidations | user/accountKey /liquidationRecords/year /yearmonthday | User Liquidations 20240106 (opens in a new tab) |
Settle PNL | user/accountKey /settlePnlRecords/year /yearmonthday | User Settle PNL 20240124 (opens in a new tab) |
LP (BAL) | user/accountKey /lpRecord/year /yearmonthday | User LP 20240119 (opens in a new tab) |
Insurance Fund | market/marketSymbol /insuranceFundRecords/year /yearmonthday | Market Insurance Fund 20240214 (opens in a new tab) |
Insurance Fund Stake | authority/authorityAccountKey /insuranceFundStakeRecords/year /yearmonthday | Insurance 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
variable | description | example |
---|---|---|
accountKey | user sub account public key (not authority) | |
authority | authority public key | |
marketSymbol | market name | SOL-PERP |
year | 2023 | |
month | 4 | |
day | utc time | 25 |
candleResolution | 1M |
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)