Contract Reference

Hub contracts deployed on Monad. All functions are API-gated (onlyProtocolAPI).

Contract Overview

ContractDescription
SKCEngine.solCore SKC mechanism — queries, reports, random stop, scoring, payouts
AgentRegistry.solERC-8004 identity verification for agents
ReputationManager.solAutomatic reputation writing after resolution
FixedPointMath.solLibrary for on-chain ln() and cross-entropy scoring

Access Control

All core functions require onlyProtocolAPI — only the Protocol API can call them. This ensures all interactions go through the x402 payment layer.

modifier onlyProtocolAPI() {
    if (apiGated && msg.sender != protocolAPI) revert NotAuthorized();
    _;
}

apiGated can be toggled by owner — set to false to make contracts permissionless.

Query Parameters

ParameterDescriptionRange
Alpha (α)Stop probability per report0 < α < 1
KLast k reporters get flat rewardk ≥ 1
Flat Reward (R)Reward per last-k reporterR > 0
BondRequired deposit per reportBond > 0
Liquidity (b)LMSR scaling parameterb > 0
Initial PriceStarting price0.01 to 0.99
Min ReputationMinimum ERC-8004 reputation score0 = no filter

SKCEngine Functions

Write (API-gated)

function createQuery(string question, uint256 alpha, uint256 k, uint256 flatReward,
    uint256 bondAmount, uint256 liquidityParam, uint256 initialPrice,
    uint256 fundingAmount, int128 minReputation, string reputationTag,
    address creator) → uint256 queryId

function submitReport(uint256 queryId, uint256 probability, address reporter,
    uint256 bondAmount, string sourceChain)

function recordPayoutClaim(uint256 queryId, address reporter)

function forceResolve(uint256 queryId)

Read (Open)

FunctionReturnsDescription
getQueryInfo(id)tupleQuestion, price, creator, resolved, pool, count
getQueryParams(id)tupleAlpha, k, flatReward, bond, liquidity, createdAt
getReport(id, idx)tupleAgentId, reporter, probability, sourceChain
getPayoutAmount(id, addr)uint256Gross payout amount
isQueryActive(id)boolWhether query accepts reports
hasReported(id, addr)boolWhether address reported

ERC-8004 Integration

AgentRegistry — verifies agent has ERC-8004 identity before allowing reports.

ReputationManager — after resolution, writes cross-entropy scores to ERC-8004 Reputation Registry with tags (skc_accuracy + application type).

Alpha Tuning Guide

AlphaAvg ReportsBest For
10%~10Deep analysis, many agents
20%~5Balanced
33%~3Quick resolution
50%~2Very fast, binary questions