Technical Specifications

Complete contract architecture and mathematical foundations

Contract Architecture

Atomic Labs is built as a Solana program using Anchor framework. All core logic executes on-chain with no off-chain dependencies.

Account Structures

GlobalConfig

  • • authority: Pubkey
  • • treasury: Pubkey
  • • paused: bool
  • • min_lock_duration: i64 (default: 86400 = 1 day)
  • • max_lock_duration: i64 (default: 157788000 ≈ 5 years)
  • • base_time_constant: u64 (default: 86400)
  • • k_exponent: f64 (default: 1.5)
  • • pcw_normalizer_base: u64 (default: 1,000,000)
  • • pcw_exponent: f64 (default: 0.5)
  • • early_exit_penalty_bps: u16 (default: 1000 = 10%)
  • • early_exit_max_penalty_bps: u16 (default: 5000 = 50%)

LockState

  • • owner: Pubkey
  • • target_mint: Pubkey (asset being signaled)
  • • locked_mint: Pubkey (token escrowed)
  • • amount: u64
  • • start_ts: i64
  • • end_ts: i64
  • • conviction_weight: u128
  • • conviction_points_accrued: u64
  • • status: LockStatus (Active | Completed | EarlyExited)

ProjectState

  • • target_mint: Pubkey
  • • total_sum_cw: u128 (sum of all active lock CW)
  • • total_pcw: u128 (normalized PCW)
  • • active_locks_count: u64
  • • completed_locks_count: u64
  • • total_amount_locked: u64

UserState

  • • owner: Pubkey
  • • reputation: i64 (scaled by 1000, 1000 = 1.0)
  • • total_cw: u128
  • • total_cp: u64
  • • active_locks_count: u64
  • • completed_locks_count: u64
  • • early_exit_count: u64

Mathematical Formulas

Conviction Weight (CW)

CW = Amount × T(t) × M_asset × R_user

T(t) = ln(1 + t/base)^k
t = duration in seconds, base = 86400, k = 1.5

M_asset: Asset multiplier in basis points (default: 10000 = 1.0x)

R_user: Reputation coefficient (scaled by 1000, default: 1000 = 1.0)

Project Conviction Weight (PCW)

PCW = base × (sum_cw / base)^exponent

sum_cw: Sum of CW from all active locks for target asset

base: Normalizer (default: 1,000,000)

exponent: PCW curve exponent (default: 0.5)

Early Exit Penalty

penalty_bps = min_penalty + (remaining_ratio × penalty_range)

remaining_ratio: remaining_duration / total_duration

min_penalty: 1000 bps (10%)

max_penalty: 5000 bps (50%)

penalty_range: max_penalty - min_penalty = 4000 bps

Conviction Points (CP)

CP = base_cp + duration_bonus + completion_bonus

base_cp: CW / 100

duration_bonus: +20% if duration > 180 days

completion_bonus: +15% of base_cp

Security Model

PDA Escrow

All locked tokens are held in Program Derived Addresses (PDAs) controlled by the program. No single key can access escrowed funds.

Time-Locked

Locks cannot be withdrawn before maturity. Early exit requires explicit early_exit instruction which applies penalties.

Authority Controls

Global pause functionality allows emergency stops. Asset registration requires authority signature. Treasury address can be updated by authority.