Developer
Integration guide
The reserve state on Solana can be reproduced from standard RPC token-account reads and live price quotes.
Read-only queries
// 15 stock-token balances held by the reserve
getTokenAccountsByOwner
params: [<BACKING_POOL>, { programId: <TOKEN_PROGRAM> }, { encoding: "jsonParsed" }]
// circulating $STOCKED supply
getTokenSupply
params: [<TOKEN_MINT>]
// a wallet's $STOCKED balance
getTokenAccountsByOwner
params: [<WALLET>, { mint: <TOKEN_MINT> }, { encoding: "jsonParsed" }]
// backed value per token
B = sum(stock amount × live USD price)
P = B / total supplyConfiguration
VITE_SOLANA_NETWORK mainnet-beta | devnet | testnet VITE_SOLANA_RPC_URL Solana RPC endpoint VITE_ASSET_MINT $STOCKED SPL mint VITE_BACKING_POOL 15-stock reserve wallet VITE_FEE_RECEIVER designated creator-fee destination VITE_PROGRAM_ID redemption program id VITE_TREASURY treasury account VITE_TOKEN_DECIMALS default 6 VITE_DEPLOYMENT_ENV production | staging | development VITE_LINK_X | _TELEGRAM | _DISCORD | _GITHUB
Protocol events
- FeeClaimed: creator fees collected in SOL by the protocol wallet.
- BackingAdded: confirmed stock acquisition added to the reserve.
- Redeemed: proportional 15-stock payout, cumulative redeemed value and resulting pool value.
- EligibilityUpdated: verified purchase, sale or transfer changing an eligible balance.
Transaction example
redeem(amount) ├─ assert caller signature and cooldown elapsed (24h) ├─ E = eligible balance, B = stock reserve value, S = total supply ├─ gross = floor(E * B / S) ├─ available = max(0, gross - already_redeemed) ├─ assert amount > 0 and amount <= floor(available * 10%) ├─ already_redeemed += amount (never reset, no burn) └─ transfer the proportional quantity of every stock to the caller
