Oracle v1, live on Miden testnet and mainnet. The 16 pairs are listed in Pairs and keys; entries are published every 3 seconds on mainnet and every 30 seconds on testnet.
- Mainnet oracle:
0x8f8d747477ca171144feadc60a1137(multisig, 2 of 3 signers) - Testnet oracle:
0xf86fe46c20e578513374651ecd6d0f
1. Create your publisher account
Create it once with the Pragma tooling (pm-publisher-cli init, or PragmaMidenClient.initialize() in
pragma-sdk[miden]). It builds a public account with an ECDSA key, a wallet to receive fees, and the
publisher component that stores your entries and answers the oracle.
It writes pragma_miden.json (your account id), keystore/ (your signing key) and a local store.
Back up keystore/: without it you lose the account. Never share it.
The account code is fixed: there is no way to upgrade it, not even by you. The oracle reads your entries by
calling get_entry through its code root, and a call that fails aborts the read of every consumer, so an
account able to change its code could take the oracle down. Before registering an account the signers
check that it runs exactly the reference publisher code (pm-multisig refuses any other), and since the
code cannot change, that check holds for as long as the account is registered.
2. Fund it
Every transaction pays its fee, in the chain’s native fee asset, from your account’s vault. On mainnet the fee asset is USDCx (6 decimals) and there is no faucet: send it to your publisher account from a wallet you control (a public or private note), then have the account consume the note.pm-publisher-cli -n mainnet consume opens the notes waiting for the account, including the private ones a wallet such as Bread sends
through the note transport, and pm-publisher-cli -n mainnet balance shows what it holds. On testnet, fund
asks the public faucet, which is sometimes down: a transfer from another account works too.
On mainnet the account must also be on Miden’s network allowlist before its first transaction. An
invitation code from Miden registers it, once: put the code in a file and run
pm-publisher-cli -n mainnet register-account --code-file code.txt; allowed tells whether an account is
registered. Do this before funding it.
Measured on mainnet, a batch of 15 entries costs about 113 base units of the fee asset (0.000113 USDCx).
One batch per minute is about 163,000 base units a day; one batch every 3 seconds is about 3.25 USDCx a day.
Check balance after your first batches and size your top-ups from the real spend. Keep several days of
runway; an empty account stops publishing and its entries age out.
3. Get registered
Send Pragma your publisher account id and a contact. We check the account, then submit aregister-publisher proposal that two of the three signers of the oracle multisig approve. From that
moment your entries count in the median. You can read your account’s entries with pm-publisher-cli get-entry to check what the oracle will see.
Registration is per account. If you replace your account, it has to be registered again.
4. What to publish
An entry is(pair, price, decimals, timestamp, num_sources):
- pair:
BASE/QUOTEin upper case, for exampleBTC/USD. On chain its key is derived from the name (pair_key), so there is no index to look up and none to get wrong. The tooling derives it for you. - price: an integer scaled by
10^decimals. - decimals:
min(base decimals, quote decimals)of the pair (8 for BTC/USD, 6 for USDT/USD and USDC/USD). This is not a choice: the oracle takes the median across publishers and reads the decimals of the median entry, so a publisher on another scale corrupts the answer for every consumer. - timestamp: the unix time of the price you observed. Use a synchronised clock; never a future time.
- num_sources: how many independent exchanges fed your price. Report it honestly.
- Publish the median (or another outlier-resistant aggregate) of several independent exchanges, not one venue. Skip the pair for that tick when you do not have enough fresh sources rather than publishing a weak price.
- Never publish a placeholder, a stale value with a new timestamp, or a test value.
- Check each price against your previous one; a sudden jump deserves a second look before it is sent.
5. Run it in production
- One process per account. Two processes publishing from the same account conflict (
StateConflict), and an overlapping rollout does it too: stop the old instance before starting the new one. - Keep the keystore, the store is disposable. The store can be rebuilt (
import_account); the keystore cannot. After a long downtime, sync before publishing, or the first transaction fails withblock pruned. - Use a stable outbound IP. Miden’s prover and RPC may refuse unknown addresses (HTTP 403). If you see it, ask the Miden team to allow your address.
- Monitor the fee balance, the age of your last successful publish and the entry you read back with
get-entry. Alert well before the balance runs out.
price-pusher for Starknet, Miden publishing is one more loop of the same process
(--miden-network, --miden-publish-interval): a Miden problem never stops your Starknet push.
6. Replacing your account
A new version of the publisher code, or a lost or compromised key, means a new account: create it (pm-publisher-cli init), fund it, and send us its id. We register the new account and remove the old
one in a single proposal (replace-publisher, two of three signers), so the oracle keeps reading you
throughout and there is no gap. Keep only a few days of fees on the account: that is all there is to move,
and whatever is left on the old account can stay there.
7. Leaving or being removed
Tell us and we remove your account (remove-publisher, two of three signers); you can stop publishing at
any time and your entries age out of the median. Pragma can also remove a publisher whose data is wrong
or who stopped publishing, and can pause the whole oracle in an incident (one signer). If your key may be
compromised, tell us immediately: we remove your account before anything else.