Skip to content
Runner · Reference

Actions

The Action union decide() returns.

Derived from packages/runtime-core/src/types.ts

A plugin's decide() returns Action[] — a declarative list of intent, not transactions. The executor materializes each action into a moveCall via @automark/sdk, mapping it onto a method of the SDK's Vault class.

Rule: a plugin NEVER builds tx.moveCall directly, NEVER touches keys, NEVER calls RPC. You return intent; the runtime turns it into a tx.

Every variant is a tagged union member with a kind and (except noop) a params object. All amounts and strikes are bigint.

noop

{ kind: "noop"; reason: string }

noop means "decided not to act" plus a reason for structured logging. You can also return [], but that is hard to debug ("why did it do nothing?"). The runtime treats both paths the same — prefer [{ kind: "noop", reason: "..." }] when staying idle is a deliberate decision.

Position actions

  • vault.mintBinaryMintBinaryActionParams: marketId: string, strike: bigint, isUp: boolean, quantity: bigint, skipAutoFund?: boolean. Opens a binary position on one side of a strike (isUp true = UP, false = DOWN).
  • vault.mintRangeMintRangeActionParams: marketId: string, lowerStrike: bigint, higherStrike: bigint, quantity: bigint, skipAutoFund?: boolean. Opens a range position bounded by two strikes.
  • vault.redeemBinaryRedeemBinaryActionParams: marketId: string, strike: bigint, isUp: boolean, quantity: bigint. Closes a binary position.
  • vault.redeemRangeRedeemRangeActionParams: marketId: string, lowerStrike: bigint, higherStrike: bigint, quantity: bigint. Closes a range position.

marketId is Market.id everywhere. Under the hood it's the Predict oracleId; the runtime translates.

Funding and liquidity actions

  • vault.pmDepositPmActionParams: amount: bigint. Moves quote into the position-manager balance.
  • vault.pmWithdrawPmActionParams: amount: bigint. Pulls quote back out of the position manager.
  • vault.supplyPlpPlpSupplyActionParams: amount: bigint. Supplies quote as protocol liquidity.
  • vault.withdrawPlpPlpWithdrawActionParams: sharesAmount: bigint. Withdraws by PLP shares (not quote — pass what a prior supplyPlp returned).
  • vault.refreshNavSnapshotparams?: NavRefreshRefs (predictPackageId: string, predictObjectId: string). Re-snapshots vault NAV.
  • vault.crystallizeFeesparams?: { includeNavRefresh?: boolean; refs?: NavRefreshRefs }. Crystallizes accrued fees, optionally refreshing NAV first.

Both params are optional — the runtime fills in the Predict refs when you omit them.

skipAutoFund

skipAutoFund exists only on mintBinary and mintRange. It defaults to false. When true, the runtime SKIPS the auto-fund pmDeposit preflight for that mint. Set it when you've already arranged PM balance yourself — a manual pmDeposit earlier in the same batch, or a PM that already holds plenty. See Auto-fund.

Next: what comes back after a tick → Result and error.