Accounts and addresses
Accounts and addresses
Protocol { program, market, mint } identifies a router deployment. Supply and validate these identities before building instructions. address derives model, provider, metadata, vault, group, and reserve-mint PDAs.
accounts::Decode checks raw records against an expected program. Typed records include Market, Model, ModelGroup, Provider, User, Booking, books, lists, and metadata. Cross-account binding still matters: a valid model and valid book need not belong together.
Build ModelKeys and UserKeys from validated state. SettlementKeys::from_booking derives payout and surcharge destinations from the booking. Do not substitute current council or group settings for stored settlement fields.
Anchor initializes user, model, book, list, and booking accounts in their corresponding instructions. Supply required fresh account signers. Do not precreate those program-owned accounts using historical sizes.