Contract 2faa61fe17e96ceb07981041e28f7d183efcf9d4940afb681f84ca209b62a9e0

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.93.0

Instances

  • CAG56UZ2EZC5THKQARDSZSI2LCE6VXT2H3VE3VMXNCWLMFXJSTTEQMN2

Interface

THE KEY PUBLIC FUNCTION.

Returns the Anchor Confidence Ratio (ACR) for an anchor in basis points. This is now a composite Operational Risk Score, scaled 0 to 10_000.

fn get_acr(env: soroban_sdk::Env, anchor: soroban_sdk::Address) -> i128
fn extend_ttl(env: soroban_sdk::Env)

Called once at deployment.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    factory: soroban_sdk::Address,
    usdc: soroban_sdk::Address,
)

Returns all registered anchors and their ACR scores.

fn get_all_acr(env: soroban_sdk::Env) -> soroban_sdk::Vec<(soroban_sdk::Address, i128)>
fn get_all_metrics(
    env: soroban_sdk::Env,
) -> soroban_sdk::Vec<(soroban_sdk::Address, AnchorMetrics, i128)>

Anchor registers itself for a specific market.

fn register_anchor(env: soroban_sdk::Env, anchor: soroban_sdk::Address, market_id: u32)
fn on_market_settled(env: soroban_sdk::Env, market_id: u32, yes_won: bool)
fn get_cover_outstanding(env: soroban_sdk::Env, market_id: u32) -> i128

Update operational metrics for an anchor. This is called by the off-chain Watcher (Risk Oracle) via the admin key.

fn update_anchor_metrics(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    anchor: soroban_sdk::Address,
    success_rate_bps: u32,
    avg_latency_seconds: u32,
    failed_withdrawals: u32,
    oracle_uptime_bps: u32,
    historical_payouts: i128,
)
fn update_cover_outstanding(
    env: soroban_sdk::Env,
    market_id: u32,
    delta: i128,
    increase: bool,
)

Imports

WebAssembly Text (WAT) ▶