Building transactions#
@seesaw/core is the canonical v1 transaction builder. It emits generated v1
Solana Kit
instructions for the on-chain ABI; it never signs or submits them.
Build unsigned instructions#
// docs-check: semantic
import {
buildPlaceOrderIx,
buildCancelOrderIx,
buildRedeemIx,
OrderSide,
OrderType,
type PlaceOrderAccounts,
} from '@seesaw/core';
export function buildBuyYes(accounts: PlaceOrderAccounts, protocolTreasuryIndex: number) {
return buildPlaceOrderIx(
{
side: OrderSide.BuyYes,
priceBps: 5100,
quantity: 1_000_000n,
orderType: OrderType.Limit,
protocolTreasuryIndex,
},
accounts
);
}
// Cancel and redeem also take separate params and accounts arguments.
export const buildCancel = (
params: Parameters<typeof buildCancelOrderIx>[0],
accounts: Parameters<typeof buildCancelOrderIx>[1]
) => buildCancelOrderIx(params, accounts);
export const buildRedemption = (
params: Parameters<typeof buildRedeemIx>[0],
accounts: Parameters<typeof buildRedeemIx>[1]
) => buildRedeemIx(params, accounts);
Use the generated account readers before constructing account metas. These low-level
builders take explicit account addresses: callers must derive and validate the
market's accounts, token mint, approved treasury recipient and optional tails.
buildBuyYes above returns an unsigned instruction; compose, simulate, sign and
submit it through your application's wallet/RPC integration. Do not add client-controlled creator or fee-recipient accounts.
Market lifecycle#
The v1 flow is create -> trade -> halt/resolve -> redeem -> close. Expiry and
void paths are one-way and use the same generated instruction surface. For a
market originated elsewhere, the Reclaim service authenticates the external
proof and the registered resolver performs the resolution; clients still use
the normal Seesaw builders for trading and redemption.
Pull oracle binding#
Market creation follows the Pull-only launch contract with a Receiver-owned
PriceUpdateV2 account. Pull is fixed protocol behavior; the shared builders
and on-chain program freeze the Receiver owner and Pull feed binding to the
same market intent, and there is no oracle selector in the request.
Safety checklist#
- Decode every account with the generated reader and verify its PDA.
- Simulate before signing and retain the simulation slot.
- Bind transaction accounts to the same market, mint, and resolver identity.
- Treat
max_confidence_ratio_bps = 0as the explicit disabled-guard mode. - Preserve fee and referral precedence; never allow self-referral.
- Record the release commit and generated-vector version with submitted transactions.
See Reading data, Reclaim integration, and the Rust and Python language guides.