Contract b44491a0a959030ae7ac7c5b34322d02c430d4ffc68177a870d71b947cd712ca

← Back to Index 📥 Download WASM

Meta

rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.93.0

Interface

fn usdc(env: soroban_sdk::Env) -> soroban_sdk::Address
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Number of markets created so far (= the next deploy salt).

fn count(env: soroban_sdk::Env) -> u64
fn registry(env: soroban_sdk::Env) -> soroban_sdk::Address
fn market_wasm(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>

market_wasm is the WASM hash freshly-deployed markets use; registry and usdc are resolved per-network at deploy time (build.md §0a).

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    market_wasm: soroban_sdk::BytesN<32>,
    registry: soroban_sdk::Address,
    usdc: soroban_sdk::Address,
    treasury: soroban_sdk::Address,
    blend_adapter: Option,
)

Create a scalar-Gaussian market. Set capped_flag to 1 for capped Gaussians (sharp beliefs allowed; ADR-3). All numeric belief fields are WAD-scaled (1e18; ADR-1/ADR-2). tier is the resolver's trust badge code (0..=3; ADR-5). Returns the deployed market's address.

fn create_market(
    env: soroban_sdk::Env,
    creator: soroban_sdk::Address,
    k: i128,
    b: i128,
    fee_bps: u32,
    resolver: soroban_sdk::Address,
    tier: u32,
    window_open: u64,
    window_lock: u64,
    window_resolve: u64,
    mu0: i128,
    sigma0: i128,
    capped_flag: u32,
) -> soroban_sdk::Address

Re-point the DistributionMarket WASM hash (e.g. after a contract upgrade); only affects markets created afterwards. Admin-gated.

fn set_market_wasm(env: soroban_sdk::Env, new_wasm: soroban_sdk::BytesN<32>)

Create a trajectory market: N independent per-checkpoint Gaussians sharing one collateral pool (ADR-4, whitepaper §16). checkpoints are Unix timestamps (ascending, ≤ window_resolve); mus0/sigmas0 have one entry per checkpoint, all WAD.

fn create_trajectory_market(
    env: soroban_sdk::Env,
    creator: soroban_sdk::Address,
    k: i128,
    b: i128,
    fee_bps: u32,
    resolver: soroban_sdk::Address,
    tier: u32,
    checkpoints: soroban_sdk::Vec,
    window_open: u64,
    window_lock: u64,
    window_resolve: u64,
    mus0: soroban_sdk::Vec,
    sigmas0: soroban_sdk::Vec,
) -> soroban_sdk::Address

Imports

WebAssembly Text (WAT) ▶