Error Codes
Comprehensive list of error types across all Kaizen crates.
Engine Errors
Primary errors returned during transaction execution.
Authentication Errors
| Error | Description | Resolution |
|---|---|---|
InvalidSignature | Signature verification failed | Verify signing key and process |
InvalidTimestamp | Timestamp outside valid window | Use current timestamp (±2 days) |
DuplicateTransaction | Transaction hash already processed | Generate new transaction |
Unauthorized | Signer not authorized for account | Check API wallet or permissions |
ApiWalletNotAllowed | API wallet cannot perform operation | Use main wallet for Transfer/Withdraw |
Balance Errors
| Error | Description | Resolution |
|---|---|---|
InsufficientBalance | Required amount exceeds available | Deposit more funds |
RFQ Thesis Errors
| Error | Description | Resolution |
|---|---|---|
ThesisNotFound | Thesis ID does not exist | Verify thesis ID |
ThesisNotActive | Thesis not in Active state | Check thesis status |
ChallengeWindowNotOver | Cannot settle during window | Wait for window to expire |
InvalidBreachTimestamp | Breach timestamp outside period | Use valid timestamp |
PriceWithinRange | Price didn't breach | Verify price data |
QuoteDeadlineExpired | Solver quote has expired | Request new quote |
InvalidSolverSignature | Solver signature failed | Get valid quote from solver |
InvalidUserSignature | User signature failed | Re-sign with correct key |
Oracle Errors
| Error | Description | Resolution |
|---|---|---|
OracleStale | Last update too long ago | Wait for oracle update |
OracleDataNotFound | Data not available | Request backfill |
InvalidOraclePair | Oracle pair not configured | Use valid oracle pair |
OracleTimestampFuture | Feed timestamp in future | Check clock sync |
OracleTimestampTooOld | Feed exceeds max staleness | Use fresher data |
Market Errors
| Error | Description | Resolution |
|---|---|---|
MarketPaused | Market temporarily paused | Wait for unpause |
SystemPaused | Entire system paused | Wait for admin to resume |
Limit Errors
| Error | Description | Resolution |
|---|---|---|
UserBlacklisted | User is on blacklist | Contact admin |
BetAmountOutOfRange | Bet below min or above max | Adjust bet amount |
MarketOiExceeded | Market OI limit reached | Wait or use smaller bet |
UserOiExceeded | User OI limit reached | Close positions or request increase |
Withdrawal Errors
| Error | Description | Resolution |
|---|---|---|
WithdrawalNotFound | Withdrawal ID not found | Verify withdrawal ID |
WithdrawalAlreadyProcessed | Already completed | Check transaction history |
Deposit Errors
| Error | Description | Resolution |
|---|---|---|
DuplicateDeposit | Same external tx hash exists | Deposit already processed |
Core Errors
Low-level errors from the kaizen-core layer.
| Error | Description |
|---|---|
StateRead | Failed to read from state |
StateWrite | Failed to write to state |
Serialization | Failed to serialize data (Borsh) |
Deserialization | Failed to deserialize data |
NotFound | Resource not found |
AlreadyExists | Resource already exists |
LimitExceeded | Resource limit exceeded |
State Errors
Storage layer errors from kaizen-state.
| Error | Description |
|---|---|
RocksDb | RocksDB operation failed |
KeyNotFound | Requested key not in storage |
InvalidState | State is in invalid format |
Corruption | Data corruption detected |
Auth Errors
Authentication errors from kaizen-auth.
| Error | Description |
|---|---|
InvalidSignature | Signature format invalid |
SignatureRecovery | Could not recover address |
Unauthorized | Signer not authorized |
ApiWalletExpired | API wallet has expired |
InsufficientPermissions | Role lacks required permission |
Error Response Format
JSON-RPC
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "InsufficientBalance",
"data": {
"required": 1000000,
"available": 500000
}
},
"id": 1
}TypeScript SDK
import { RpcError } from "@kaizen-core/sdk";
try {
await client.sendTransaction(tx);
} catch (error) {
if (error instanceof RpcError) {
console.log(`Error ${error.code}: ${error.message}`);
console.log(`Data: ${JSON.stringify(error.data)}`);
}
}Common Scenarios
Thesis Submission Failures
| Error | Cause | Solution |
|---|---|---|
InvalidSignature | Wrong signing key | Verify signing process |
InvalidTimestamp | Timestamp outside window | Use current timestamp |
InsufficientBalance | Not enough funds | Deposit more |
OracleStale | Oracle delayed | Wait for update |
QuoteDeadlineExpired | Quote took too long | Request new quote |
Settlement Failures
| Error | Cause | Solution |
|---|---|---|
ChallengeWindowNotOver | Settlement too early | Wait for window |
ThesisNotActive | Already settled | Check status |
API Wallet Errors
| Error | Cause | Solution |
|---|---|---|
ApiWalletNotAllowed | Transfer/Withdraw with API wallet | Use main wallet |
ApiWalletExpired | Wallet expiry passed | Nominate new wallet |
