peard
Programs

peard_perps

Synthetic perpetuals on a pairable with no mint behind it.


peard_perps is the venue's own perpetuals engine. The curve is virtual and prices size only; the collateral is real and lives in a token vault. Funding is what manufactures a counterparty when no spot market exists to arbitrage against, which is what lets a market open with no liquidity provider and nothing to custody.

This program deliberately inverts peard's core property: the oracle is in the settlement path here, because the index decides funding and decides who is liquidatable.

Every name, account, argument and error on this page is generated from target/idl/peard_perps.json, the IDL Anchor emits at build time. It is what the deployed bytes actually accept, not a recollection of it.

Program id

AddressAZdLGAaYiie1mwuhHUfHM9zA9CC3F3BP5tJoUiAE3umZ
Deployeddevnet only. 49 markets, all migrated to the 395-byte layout on 2026-08-26 and re-read to confirm it. Deliberately left off mainnet: perps need a funded insurance fund and an exercised liquidator, and neither exists
Instructions17
Account types3
Events10
Error codes22

Counts and the instruction list below are read from target/idl/peard_perps.json as of 2026-08-25. set_market_index_age was added and deployed that day, and its discriminator is present in the devnet binary dumped back off the chain, not only in the local artifact.

Instructions

Global and governance

Markets

The crank

Trading

Liquidation

Backing

Accounts

The state this program owns. Field names are as they appear on chain.

Types

Events

EventFields
BackingSetmarket, backing, max_age_secs
BackingSyncedmarket, value_usd, as_of
FundingSettledmarket, mark, index, premium_bps, cumulative
IndexSyncedmarket, price, ts
Liquidatedmarket, owner, liquidator, size, reward, bad_debt
MarketOpenedmarket, pairable, mark
MarketSettledmarket, price, ts
PositionChangedmarket, owner, base_size, quote, collateral, mark, is_close
PositionSettledmarket, owner, price, pnl, collateral

Errors

CodeNameMessage
6000Unauthorizedunauthorized
6001BadParamparameter outside allowed range
6002ZeroAmountamount must be greater than zero
6003MathOverflowmath overflow
6004Haltedmarket is halted
6005IndexUnusableindex price is stale, missing, or frozen
6006WrongPairablethe account is not the pairable this market names
6007LeverageTooHighresulting leverage exceeds the market maximum
6008WrongSideposition is already open on the other side
6009NoPositionnothing open to close
6010SlippageExceededfill worse than the caller asked for
6011NotLiquidatableposition is healthy and cannot be liquidated
6012BelowMaintenancecollateral would fall below maintenance
6013OpenInterestCapopen interest cap reached on that side
6014MarkDivergedmark has diverged too far from index to trade against
6015VaultShortvault does not hold enough to pay this out
6016Settledmarket has settled and no longer trades
6017NotSettledmarket has not settled
6018NotExpiredthe underlying has not expired, so there is nothing to settle at
6019BackingUnusablethis market claims backing and the attestation is stale or the index unusable
6020WrongBackingthe backing account is not the pinned one, or does not name this market