addresses
dust is live on devnet only, with test USDC. mainnet is not live. mainnet addresses: published at launch.
devnet
| what | address |
|---|---|
| program id | q8WWu9FefmPYtLrz4mKRBYVEX5apB4UmRW1F3TxmaW3 |
| ProgramData | 9UTLFdZ8deTMzRGWaT5hPQ4x9GbQ9gMbS45EfBnUDHha |
| Exchange PDA | ETYuskLBg5HTDaWU9KTfePcBrUPXUDrSs164Z2AuqPNf |
| USDC vault PDA | 8rzjRDh2cj19roocRi1T8hBHki2SBZYxJiMu7Wc3E78R |
| $DUST mint PDA | 5YjhqMawE6HTwjgj5Wvf4o5J48jJMnkWFaC2Dx1v46ug |
| QueueRing | 3REUZKjNjGVJaesLomNUbasAwUcJex6EjMFSSgTz8EcL |
| BTC instrument, id 0 | 8hS6QWYq5cGvu5QaQEt86ZKLz6UrfcuJ1QJYuB3hcSs2 |
| ETH instrument, id 1 | HCayMtvKa5smx9aoXDoA3icaftHYCy8gkiULzy7fawpX |
| SOL instrument, id 2 | D47KJzioStAzdSvsNqSJaRjHpQu6NjG6F2FjToBJdHkg |
| test USDC mint | 3EPseTLLJFT1RRueYadnoCPnRL3zRo4QDC9pgjM4qZ28 |
the test USDC mint is a classic SPL Token mint with 6 decimals. it has no value. devnet players get test USDC from the app's faucet.
the QueueRing is a plain program owned account created before initialize. its address is stored in Exchange.queue, so read it from there.
instrument ids are PDA seeds. they are not Pyth feed ids. the feed ids are BTC 1, ETH 2, SOL 6.
the Pyth Pro accounts
| what | address |
|---|---|
| verifier program | pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt |
| storage account, pinned in the program | 3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL |
| devnet treasury | opsLibxVY7Vz5eYMmSfX8cLFCFVYTtH6fr6MiifMpA7 |
the treasury is different on mainnet. never hard code it. read it from the storage account, bytes 40 to 72. DustClient.connect does this for you.
the keys on devnet
on devnet the owner, the pause guardian, the risk keeper, the dev recipient and the upgrade authority are one deploy wallet (mainnet uses five separate keys): 46Ghpy4Wry7xXL6pkyCFpwg8wJFyMpDGfaUqNHLDZLF8. the house keeper is the zero key 11111111111111111111111111111111, which means the fallback settle is off. see security. mainnet keys: set at launch.
the seeds
| account | seeds | notes |
|---|---|---|
| Exchange | "exchange" | one per program |
| USDC vault | "vault" | a token account. its token authority is the Exchange PDA |
| $DUST mint | "dust_mint" | Token-2022, 6 decimals, authority is the Exchange PDA |
| Instrument | "instrument", id as one byte | 0 BTC, 1 ETH, 2 SOL |
| UserAccount | "user", the owner's public key | the wallet's balance, $DUST and keys |
| Position | "pos", the owner's public key, id as a u64 in little endian | a Core position or a resting limit order |
| Request | "req", the owner's public key, id as a u64 in little endian | a Core position and its open or close request share one id. a DUST MODE round is a Request with its own id |
id comes from UserAccount.next_id. it counts up for every position, order and round of a wallet.
ts
import { PublicKey } from '@solana/web3.js';
const program = new PublicKey('q8WWu9FefmPYtLrz4mKRBYVEX5apB4UmRW1F3TxmaW3');
const find = (seeds: Uint8Array[]) => PublicKey.findProgramAddressSync(seeds, program)[0];
const utf8 = (s: string) => new TextEncoder().encode(s);
const exchange = find([utf8('exchange')]);
const vault = find([utf8('vault')]);
const dustMint = find([utf8('dust_mint')]);
const btc = find([utf8('instrument'), Uint8Array.of(0)]);
const u64le = (n: bigint) => {
const b = new Uint8Array(8);
new DataView(b.buffer).setBigUint64(0, n, true);
return b;
};
const user = (owner: PublicKey) => find([utf8('user'), owner.toBytes()]);
const position = (owner: PublicKey, id: bigint) => find([utf8('pos'), owner.toBytes(), u64le(id)]);
const request = (owner: PublicKey, id: bigint) => find([utf8('req'), owner.toBytes(), u64le(id)]);the SDK has the same helpers: exchangePda, vaultPda, dustMintPda, instrumentPda, userPda, positionPda, requestPda. see SDK.
other program ids
| program | address |
|---|---|
| System | 11111111111111111111111111111111 |
| SPL Token | TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA |
| Token-2022 | TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb |
| Associated Token | ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL |
| ed25519 precompile | Ed25519SigVerify111111111111111111111111111 |
| Instructions sysvar | Sysvar1nstructions1111111111111111111111111 |
| Compute Budget | ComputeBudget111111111111111111111111111111 |
all from the SDK constants.
check it yourself
- derive the PDAs above from the program id. they must match this table
- read the Exchange account and compare
vault,dust_mintandqueuewith the table - read the ProgramData account for the upgrade authority
- the program build hash for mainnet: published at launch
the SDK build checks its copy of the IDL against the program's IDL by hash, so a mismatch is caught before release.
