Created
November 7, 2025 19:55
-
-
Save wphan/7c9c39e3505955c17612cf961579f90b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DriftClient, Wallet } from "@drift-labs/sdk"; | |
| import { Connection, Keypair } from "@solana/web3.js"; | |
| const RPC_URL = process.env.RPC_URL!; | |
| const main = async () => { | |
| const dc = new DriftClient({ | |
| env: 'mainnet-beta', | |
| connection: new Connection(process.env.RPC_URL!), | |
| wallet: new Wallet(Keypair.generate()), | |
| }); | |
| await dc.subscribe(); | |
| const perpMarkets = dc.getPerpMarketAccounts().map(mkt => mkt.pubkey.toBase58()); | |
| console.log(perpMarkets); | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment