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.
| Field | Type | Description |
|---|---|---|
to | Address | Recipient address |
amount | u64 | Transfer amount (1 USDC = 1,000,000) |
Permission: User only
API Wallet: ❌ Not allowed
NominateApiWallet
Register a delegated API wallet for trading.
| Field | Type | Description |
|---|---|---|
wallet | Address | Wallet address to authorize |
expiry | u64 | Expiration time (Unix ms, 0 = never) |
Permission: User
API Wallet: ✅ Allowed
RevokeApiWallet
Remove an API wallet authorization.
| Field | Type | Description |
|---|---|---|
wallet | Address | Wallet address to revoke |
Permission: User
API Wallet: ✅ Allowed
Bridge Operations
Deposit
Credit funds from external chain. Relayer only.
| Field | Type | Description |
|---|---|---|
user | Address | User address to credit |
amount | u64 | Amount deposited (6 decimals) |
external_tx_hash | B256 | Source chain transaction hash |
Withdraw
Request withdrawal to external chain.
| Field | Type | Description |
|---|---|---|
amount | u64 | Amount to withdraw (6 decimals) |
destination | Address | Destination on external chain |
Permission: User only
API Wallet: ❌ Not allowed
ProcessWithdrawal
Mark withdrawal as processed. Relayer only.
| Field | Type | Description |
|---|---|---|
withdrawal_id | u64 | Internal withdrawal ID |
external_tx_hash | B256 | External 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.
:::
| Field | Type | Description |
|---|---|---|
thesis_type | ThesisType | Box (range over time) |
oracle_pair | OraclePair | Base/quote token addresses |
price_range | PriceRange | Lower and upper bounds |
bet_amount | u64 | User's stake (6 decimals) |
payout | u64 | Total winner receives |
start_time | u64 | Observation start (Unix ms) |
end_time | u64 | Observation end (Unix ms) |
solver_quote | SolverQuote | Solver's signed quote |
user_signature | Signature | User'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.
| Field | Type | Description |
|---|---|---|
thesis_id | u64 | Thesis 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.
| Field | Type | Description |
|---|---|---|
pair | OraclePair | Base/quote token addresses |
price | u64 | Price value (6 decimals) |
timestamp | u64 | Price timestamp (Unix ms) |
Note: In pull model, the executor pulls prices from Oracle Service automatically.
OracleBackfill
Backfill historical price data. Admin only.
| Field | Type | Description |
|---|---|---|
pair | OraclePair | Base/quote token addresses |
entries | Vec<(u64, u64)> | List of (timestamp_ms, price) pairs |
Admin Operations
MarketUpdate
Create or update market configuration. Admin only.
| Field | Type | Description |
|---|---|---|
pair | OraclePair | Base/quote token addresses |
symbol | String | Display symbol (e.g., "ETH/USDT") |
is_active | bool | Whether trading is enabled |
max_staleness_ms | u64 | Maximum oracle age (ms) |
feeder | Address | Authorized feeder address |
SetUserLimits
Set per-user trading limits. Admin only.
| Field | Type | Description |
|---|---|---|
user | Address | User to configure |
max_oi | Option<u64> | Max open interest (None = default) |
min_bet | Option<u64> | Min bet amount (None = default) |
max_bet | Option<u64> | Max bet amount (None = default) |
SetBlacklist
Add or remove address from blacklist. Admin only.
| Field | Type | Description |
|---|---|---|
user | Address | User address |
is_blacklisted | bool | true = add, false = remove |
SetSystemPause
Pause or unpause the entire system. Admin only.
| Field | Type | Description |
|---|---|---|
is_paused | bool | true = pause, false = resume |
reason | Option<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
| Priority | Types |
|---|---|
| Critical | OracleFeed |
| High | SystemSettle, MarketUpdate, SetUserLimits, SetBlacklist, SetSystemPause |
| Normal | All 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.
