Skip to content

Transaction Reference

Complete reference for all transaction types in Kaizen Core.

Structure

struct Transaction {
    from: Address,           // Sender address (20 bytes)
    timestamp: u64,          // Transaction timestamp (ms)
    payload: TxPayload,      // Transaction-specific payload
    signature: Signature,    // EIP-712 signature (65 bytes)
}

Replay Protection

Kaizen uses timestamp-based replay protection (Hyperliquid-style):

  • Timestamp: Must be within validity window (block_time ± 2 days)
  • Hash Deduplication: Processed transaction hashes are tracked

This eliminates sequential nonce management.


Account Operations

Transfer

Move balance between accounts.

FieldTypeDescription
toAddressRecipient address
amountu64Transfer amount (1 USDC = 1,000,000)

Permission: User only
API Wallet: ❌ Not allowed

NominateApiWallet

Register a delegated API wallet for trading.

FieldTypeDescription
walletAddressWallet address to authorize
expiryu64Expiration time (Unix ms, 0 = never)

Permission: User
API Wallet: ✅ Allowed

RevokeApiWallet

Remove an API wallet authorization.

FieldTypeDescription
walletAddressWallet address to revoke

Permission: User
API Wallet: ✅ Allowed


Bridge Operations

Deposit

Credit funds from external chain. Relayer only.

FieldTypeDescription
userAddressUser address to credit
amountu64Amount deposited (6 decimals)
external_tx_hashB256Source chain transaction hash

Withdraw

Request withdrawal to external chain.

FieldTypeDescription
amountu64Amount to withdraw (6 decimals)
destinationAddressDestination on external chain

Permission: User only
API Wallet: ❌ Not allowed

ProcessWithdrawal

Mark withdrawal as processed. Relayer only.

FieldTypeDescription
withdrawal_idu64Internal withdrawal ID
external_tx_hashB256External chain tx hash

RFQ Operations

RfqSubmit

Create a new prediction thesis with solver quote.

:::info Who Submits? The Solver submits RfqSubmit, not the user. The user signs the quote hash (via user_signature), and the Solver includes this when submitting. :::

FieldTypeDescription
thesis_typeThesisTypeBox (range over time)
oracle_pairOraclePairBase/quote token addresses
price_rangePriceRangeLower and upper bounds
bet_amountu64User's stake (6 decimals)
payoutu64Total winner receives
start_timeu64Observation start (Unix ms)
end_timeu64Observation end (Unix ms)
solver_quoteSolverQuoteSolver's signed quote
user_signatureSignatureUser's authorization

Permission: User
API Wallet: ✅ Allowed

Validation:

  • Quote deadline not expired
  • Oracle data fresh (< 3 seconds)
  • Market is active, user not blacklisted
  • Bet amount within limits
  • Sufficient balance (user + solver)

RfqSettle

Finalize thesis after settlement window expires.

FieldTypeDescription
thesis_idu64Thesis to settle

Permission: Anyone can settle
API Wallet: ✅ Allowed

Note: Settlement is typically handled by the Settler service automatically.


Oracle Operations

OracleFeed

Submit price data. Feeder only.

FieldTypeDescription
pairOraclePairBase/quote token addresses
priceu64Price value (6 decimals)
timestampu64Price timestamp (Unix ms)

Note: In pull model, the executor pulls prices from Oracle Service automatically.

OracleBackfill

Backfill historical price data. Admin only.

FieldTypeDescription
pairOraclePairBase/quote token addresses
entriesVec<(u64, u64)>List of (timestamp_ms, price) pairs

Admin Operations

MarketUpdate

Create or update market configuration. Admin only.

FieldTypeDescription
pairOraclePairBase/quote token addresses
symbolStringDisplay symbol (e.g., "ETH/USDT")
is_activeboolWhether trading is enabled
max_staleness_msu64Maximum oracle age (ms)
feederAddressAuthorized feeder address

SetUserLimits

Set per-user trading limits. Admin only.

FieldTypeDescription
userAddressUser to configure
max_oiOption<u64>Max open interest (None = default)
min_betOption<u64>Min bet amount (None = default)
max_betOption<u64>Max bet amount (None = default)

SetBlacklist

Add or remove address from blacklist. Admin only.

FieldTypeDescription
userAddressUser address
is_blacklistedbooltrue = add, false = remove

SetSystemPause

Pause or unpause the entire system. Admin only.

FieldTypeDescription
is_pausedbooltrue = pause, false = resume
reasonOption<String>Optional pause reason

Supporting Types

ThesisType

enum ThesisType {
    Box = 0,   // Range observation over time window
}

ThesisStatus

enum ThesisStatus {
    Active = 0,             // Within observation period
    InChallengeWindow = 1,  // Observation ended, awaiting settlement
    SettledUserWin = 2,     // User won
    SettledSolverWin = 3,   // Solver won
    Cancelled = 4,          // Cancelled before start
}

OraclePair

struct OraclePair {
    base: Address,    // Base token address
    quote: Address,   // Quote token address
}

PriceRange

struct PriceRange {
    lower: u64,   // Lower bound (inclusive)
    upper: u64,   // Upper bound (inclusive)
}

Transaction Priority

PriorityTypes
CriticalOracleFeed
HighSystemSettle, MarketUpdate, SetUserLimits, SetBlacklist, SetSystemPause
NormalAll other transactions

SDK Example

import { createClient, transfer, parseUSDC } from "@kaizen-core/sdk";
 
const client = createClient({ rpcUrl: "http://localhost:8546" });
client.connectSigner(privateKey);
 
const receipt = await client.sendTransaction(
  transfer("0x...", parseUSDC("100.00")),
  { waitForConfirmation: true }
);

See EIP-712 Signatures for signing details.