From actions
Import both helpers from@exponent-labs/exponent-sdk.
createOrderbookSyncTransaction accepts Order Book descriptors and the same execution-account inputs, plus optional env. It returns one bundle and has no autoManagePositions option.
Result fields
Preserve each result’s instruction order and the order between results. Your sender must refresh stale AUM, include same-slot price updates wherever AUM is recalculated, preserve protocol refresh ordering, load lookup tables, retain generated signers, submit, and confirm. Simply concatenating these fields can omit required refreshes or exceed transaction limits. See Refresh AUM for the shared refresh code, or use the transaction builder to schedule supported preparation.
From raw instructions
compileToSyncTransactionPayload({ vaultPda, signers, instructions, leadingAccounts?, preHookAccounts?, postHookAccounts?, additionalAccounts? }) returns { instructions: Uint8Array, accounts: AccountMeta[] }.
buildSyncTransactionInstruction({ policyPda, accountIndex, numSigners, payload, constraintIndices?, squadsProgram? }) returns a TransactionInstruction.
wrapInstructionsInSyncTransaction({ policyPda, vaultPda, signer, instructions, accountIndex?, constraintIndices?, leadingAccounts?, preHookAccounts?, postHookAccounts?, additionalAccounts?, squadsProgram? }) compiles and wraps for one authorized signer; index defaults to 0.
The four account arrays accept PublicKey[] or AccountMeta[]. Use metas when writable or signer privileges matter. additionalAccounts makes accounts available to validation without referencing them in an inner instruction.
These helpers require caller-selected constraints and execution accounts. Build transactions manually documents the wire format and required validation accounts.