Doppler

Quickstart

Generate a custom Doppler program and deploy in seconds.

Doppler generates a custom Solana oracle program and optional SDKs from a fixed-size payload schema.

1. Install the Generator

Run the generator with your preferred package runner:

npx @blueshift-gg/doppler-cli

2. Initialize a Payload Schema

Create a starter payload.ts file:

npx @blueshift-gg/doppler-cli init

The generated schema looks like this:

export default {
  payload: {
    price: "u64",
  },
} as const;

Payload fields must be fixed-size. Supported scalar types are u8, u16, u32, u64, i8, i16, i32, i64, and bool. Fixed-size arrays use { type, length }.

3. Generate Bytecode and SDKs

Generate deployable bytecode, manifest.json, assembly output, and client SDKs:

npx @blueshift-gg/doppler-cli generate ./payload.ts

On the first run, generate creates programId and admin keypairs under ./keys/ and writes their public keys into manifest.json. The generated program embeds the admin address and payload size. The program ID is written into the manifest.

4. Deploy Bytecode

Deploy the compiled .so with the generator deploy command. This uses your installed Solana CLI configuration unless you pass --network, --signer, or --config.

npx @blueshift-gg/doppler-cli deploy ./sol-usdc-feed.so \
  --program-keypair ./keys/sol-usdc-feed-program-keypair.json \
  --admin <admin-address-from-manifest>

5. Fetch an Oracle with Web3.js

After the program and oracle account exist, use the generated web3.js SDK to read the feed:

import { Doppler, PriceFeedSerializer, PROGRAM_ID } from "@blueshift-gg/doppler-web3js";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const signer = Keypair.generate();
const oracleAddress = new PublicKey("...");

const client = new Doppler(connection, signer, {
  programId: PROGRAM_ID,
  admin: signer.publicKey,
});

const oracle = await client.fetchOracle(oracleAddress, new PriceFeedSerializer());

console.log(oracle.sequence);
console.log(oracle.payload.price);

Next Steps

Use the SDK-specific guides for production update flows, signer setup, compute budget instructions, and transaction sending:

On this page