Skip to content

Error Codes

Comprehensive list of error types across all Kaizen crates.

Engine Errors

Primary errors returned during transaction execution.

Authentication Errors

ErrorDescriptionResolution
InvalidSignatureSignature verification failedVerify signing key and process
InvalidTimestampTimestamp outside valid windowUse current timestamp (±2 days)
DuplicateTransactionTransaction hash already processedGenerate new transaction
UnauthorizedSigner not authorized for accountCheck API wallet or permissions
ApiWalletNotAllowedAPI wallet cannot perform operationUse main wallet for Transfer/Withdraw

Balance Errors

ErrorDescriptionResolution
InsufficientBalanceRequired amount exceeds availableDeposit more funds

RFQ Thesis Errors

ErrorDescriptionResolution
ThesisNotFoundThesis ID does not existVerify thesis ID
ThesisNotActiveThesis not in Active stateCheck thesis status
ChallengeWindowNotOverCannot settle during windowWait for window to expire
InvalidBreachTimestampBreach timestamp outside periodUse valid timestamp
PriceWithinRangePrice didn't breachVerify price data
QuoteDeadlineExpiredSolver quote has expiredRequest new quote
InvalidSolverSignatureSolver signature failedGet valid quote from solver
InvalidUserSignatureUser signature failedRe-sign with correct key

Oracle Errors

ErrorDescriptionResolution
OracleStaleLast update too long agoWait for oracle update
OracleDataNotFoundData not availableRequest backfill
InvalidOraclePairOracle pair not configuredUse valid oracle pair
OracleTimestampFutureFeed timestamp in futureCheck clock sync
OracleTimestampTooOldFeed exceeds max stalenessUse fresher data

Market Errors

ErrorDescriptionResolution
MarketPausedMarket temporarily pausedWait for unpause
SystemPausedEntire system pausedWait for admin to resume

Limit Errors

ErrorDescriptionResolution
UserBlacklistedUser is on blacklistContact admin
BetAmountOutOfRangeBet below min or above maxAdjust bet amount
MarketOiExceededMarket OI limit reachedWait or use smaller bet
UserOiExceededUser OI limit reachedClose positions or request increase

Withdrawal Errors

ErrorDescriptionResolution
WithdrawalNotFoundWithdrawal ID not foundVerify withdrawal ID
WithdrawalAlreadyProcessedAlready completedCheck transaction history

Deposit Errors

ErrorDescriptionResolution
DuplicateDepositSame external tx hash existsDeposit already processed

Core Errors

Low-level errors from the kaizen-core layer.

ErrorDescription
StateReadFailed to read from state
StateWriteFailed to write to state
SerializationFailed to serialize data (Borsh)
DeserializationFailed to deserialize data
NotFoundResource not found
AlreadyExistsResource already exists
LimitExceededResource limit exceeded

State Errors

Storage layer errors from kaizen-state.

ErrorDescription
RocksDbRocksDB operation failed
KeyNotFoundRequested key not in storage
InvalidStateState is in invalid format
CorruptionData corruption detected

Auth Errors

Authentication errors from kaizen-auth.

ErrorDescription
InvalidSignatureSignature format invalid
SignatureRecoveryCould not recover address
UnauthorizedSigner not authorized
ApiWalletExpiredAPI wallet has expired
InsufficientPermissionsRole 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

ErrorCauseSolution
InvalidSignatureWrong signing keyVerify signing process
InvalidTimestampTimestamp outside windowUse current timestamp
InsufficientBalanceNot enough fundsDeposit more
OracleStaleOracle delayedWait for update
QuoteDeadlineExpiredQuote took too longRequest new quote

Settlement Failures

ErrorCauseSolution
ChallengeWindowNotOverSettlement too earlyWait for window
ThesisNotActiveAlready settledCheck status

API Wallet Errors

ErrorCauseSolution
ApiWalletNotAllowedTransfer/Withdraw with API walletUse main wallet
ApiWalletExpiredWallet expiry passedNominate new wallet