Skip to content

Trading and Collective Writer Commands

Petri uses semantic intent, the Lean-backed API, the pinned SDK, and a fresh finalized chain observation. It does not accept caller-selected protocol accounts or reimplement financial formulas.

Prepare an exact-input option purchase without signing:

Terminal window
petri trades prepare \
--market <MARKET_PUBKEY> \
--direction quote-for-option \
--amount-in <USDC_ATOMS> \
--minimum-amount-out <OPTION_ATOMS> \
--limit-bin-id <U16>

Use option-for-quote to sell an existing claim. To prepare, verify, sign locally, submit, and wait for confirmation, use the same flags with petri trades submit.

This is secondary trading only. New claims are issued through funded writer auctions.

Terminal window
petri writers list
petri writers list --owner <WALLET_PUBKEY>
petri writers show --sleeve <SLEEVE_PUBKEY>
petri writers policy-audit --sleeve <SLEEVE_PUBKEY>

policy-audit shows the frozen policy version and commitments. It does not let a Flat holder change them.

Terminal window
petri writers deposit \
--sleeve <SLEEVE_PUBKEY> \
--amount <USDC_ATOMS>

The amount is a canonical integer string in USDC atomic units. An admitted deposit mints matching Flat par under the sleeve’s current funding rules.

Terminal window
petri writers bid \
--auction <AUCTION_PUBKEY> \
--series-index <0..19> \
--price <PRICE_PER_CONTRACT_ATOMS> \
--amount <REQUESTED_CONTRACT_ATOMS>

The auction escrows the required funding. Acceptance remains subject to the committed seller reserve price, exact reserve, drawdown, issue cap, and oracle-security gates.

Terminal window
petri writers transfer-flat \
--sleeve <SLEEVE_PUBKEY> \
--destination <WALLET_PUBKEY> \
--amount <FLAT_ATOMS>

Flat transfer changes ownership only. It does not redeem sleeve assets.

Terminal window
petri writers close-preview \
--sleeve <SLEEVE_PUBKEY> \
--amount <FLAT_ATOMS> \
--minimum-withdrawal <USDC_ATOMS>

Then advance only the next admitted stage:

Terminal window
petri writers close \
--sleeve <SLEEVE_PUBKEY> \
--amount <FLAT_ATOMS> \
--minimum-withdrawal <USDC_ATOMS> \
--close-request <REQUEST_PUBKEY>

Omit --close-request when beginning. A close can require begin, multiple bounded basket deposits, and finalization. Use:

Terminal window
petri writers close-status --close-request <REQUEST_PUBKEY>

until it reports a terminal state.

Terminal window
petri writers claim \
--sleeve <SLEEVE_PUBKEY> \
--variant collective-long \
--series-index <INDEX> \
--amount <OPTION_ATOMS>

For Flat residual:

Terminal window
petri writers claim \
--sleeve <SLEEVE_PUBKEY> \
--variant flat-residual \
--amount <FLAT_ATOMS>

petri liquidity plan, add, remove, and close-position expose current manager-liquidity JSON parity. Public Petri does not sign or submit manager-liquidity mutations.

All commands fail closed if the exact RC41 deployment, backend, selected RPC, market, group, sleeve, pool, or finalized observation does not match. As last verified on August 20, 2026, no collective pools or sleeves were active on Devnet, so correct commands can still return an unavailable state.