pen-to-squareOmni Balance Architecture

Omni balance is the shared ledger that powers every HEX workflow. It tracks collateral bridged through HOT Omni Bridge or lite-client bridges, stores the state on NEAR, and exposes balances to the UI and APIs.

Omni balance lifecycle diagram
Funds move from HOT Bridge to omni balance and back out during withdrawals.

Ledger Model

Concept
Description

Account

A wallet public key with signing rights over Omni intents.

Asset

Native token identified by {chain_id}:{token_address}.

Balance

Tuple (available, reserved) to separate free collateral from intent collateral.

Delta

Atomic change applied after deposits, swaps (token_diff), or withdrawals (mt_withdraw).

Balances live in NEAR storage, so updates are deterministic and auditable. Each action emits an event that off-chain services (analytics, accounting) can subscribe to.

Lifecycle

  1. Deposit – A HOT Omni Bridge locker (or lite-client bridge for BTC/Zcash) locks the native token and submits a proof. The ledger credits available.

  2. Reserve – When a user signs a token_diff intent, the Omni Balance contract tags the required balance as reserved until execution.

  3. Settlement – A solver or relayer executes the intent, debiting reserved and crediting the purchased asset’s available.

  4. Withdrawal – The user signs an mt_withdraw intent; the ledger burns available units and instructs the HOT unlocker to return the native token.

Action
Component
Notes

Deposit lock

HOT Omni Bridge locker

Chain-specific contracts on Ethereum, Solana, TON, Stellar, etc.

Proof validation

Omni Balance contract (NEAR)

On-chain “database” that stores balances and validates signatures.

Settlement

Omni intent executor

Solvers/relayers submit signed token_diff payloads.

Withdrawal unlock

HOT unlocker

Releases native tokens after mt_withdraw.

circle-check

Risk Controls

  • Instant unlocks: Canceling an intent immediately releases reserved funds.

  • Global caps: HOT Bridge enforces per-asset ceilings that propagate to the omni ledger.

  • Audit trails: Each delta carries a unique ID so external auditors can replay the full history.

Integration Notes

  • Use the Omni Balance view calls (e.g., get_balance, list_deltas) to display balances in custom dashboards.

  • When building automations, treat the ledger as eventual-consistent with a sub-second lag; poll emitted events rather than relying on UI states.

Last updated