Skip to content

On-chain balances

There are two kinds of balance in PrimeDelta, and it's easy to confuse them:

  • On-chain — what your wallet holds on the chain.
  • Custodial ledger — what the mint platform holds for you (your available/total cash and stock balances).

This page is about the on-chain ones.

All balances in one call

balances = pd.get_onchain_balances()
# {"dUSD": Decimal("125.4"), "AMMT1": Decimal("3.0"), ...}
  • Takes no arguments; returns a dict[str, Decimal] keyed by symbol.
  • Reads everything in a single Multicall3 call (with a per-token fallback on networks that lack Multicall3).
  • "dUSD" is always present. Stock and AMM tokens are included only when their balance is greater than zero, so a symbol missing from the dict means a zero balance.

Single-token reads

pd.get_onchain_stablecoin_balance()      # dUSD in the wallet, Decimal
pd.get_onchain_stock_balance("AMMT1")    # a specific token, Decimal
pd.get_native_del_balance()              # native gas token, Decimal

Custodial-ledger balances

If you're trading on the mint platform, the relevant balances are the custodial ones, not the wallet:

pd.get_stablecoin_available_balance()    # cash you can spend now
pd.get_stablecoin_total_balance()
pd.get_stock_available_balance(symbol)
pd.get_stock_total_balance(symbol)

A quick rule: DEX swaps spend and receive your on-chain balances; mint-platform activity settles against your custodial balances. See What is PrimeDelta.

Portfolio

For a combined view:

pd.portfolio()

See the full API → SDK reference