Architecture

Hyro Protocol has two halves. A set of Solana programs keeps a public record. Hyro's off-chain systems run the trading, check the rules and decide results. This chapter describes both and how they connect.

On-chain programs

The programs are written in Rust with the Anchor framework (version 0.31.1). Five of them deploy at launch. Their addresses are listed in What's on Solana.

Core vault program (hyro_protocol)

The core program holds vaults. Each vault is an account at a fixed address derived from public inputs, so anyone can compute and check it. A vault stores:

  • its admin key
  • the policy program it uses
  • the fee program it uses
  • its balances: tokens held on chain, plus a balance reported from off chain
  • whether it is funded (holds real tokens) or virtual (simulated capital only)
  • an optional parent vault

A vault can have child vaults. Each challenge is a virtual child vault under one parent vault.

Each vault also has an oracle setting: the one key allowed to report its off-chain balance. Child vaults use their parent's oracle, so one key reports for every challenge and can be rotated in one step.

The vault admin can pause deposits, withdrawals and proposed transactions on a vault, and can change its policy and oracle.

Policy programs

The core program does not decide on its own who may do what. Before any sensitive action, it asks the vault's policy program by calling a validate instruction with the type of action and the amount. If the policy says no, the action fails.

Two policies are used at launch:

  • policy_challenges governs challenge vaults. It allows opening a challenge vault and publishing its balance while the challenge is Active. It refuses deposits, withdrawals, moving tokens and arbitrary transactions. It also stores the challenge records and their status.
  • policy_checkout governs the fee vault. A fee deposit is accepted only with a payment voucher signed by the vault admin for that vault and amount, before the voucher expires. All other actions on the fee vault require the vault admin.

Because the policy decides what is allowed, the safety of a vault depends on the policy it uses. The audit lists the active policy among the things users must trust. See What you're trusting.

The repository also contains other policy programs that are not part of the launch: for example multisig, owner-based, admin-only, withdrawal-window and transfer-limit policies. They are kept for future vault types and testing. They are not deployed at launch, and they should not be read as working safety controls. The transfer-limit policy in particular has an acknowledged critical audit finding (C1).

Fee programs

Fees are handled by two programs:

  • fee_collection keeps a fee ledger for each vault and records fees owed and claimed. Only the core program can charge fees through it.
  • fee_collection_fractions does the arithmetic for percentage-based fees. Each rate is capped at 100%.

Fees on balance reports are switched off by default since the audit fix review. The repository also contains other fee calculators that are not part of the launch.

Off-chain systems

Hyro's backend

Hyro's backend runs the challenge product. It sells challenges, issues the signed payment vouchers, opens each challenge on Solana, checks the trading rules in real time, decides pass or fail, and handles payouts.

To open a challenge it registers the challenge record, creates the challenge's virtual vault with its starting balance, and sets the status to Active. It signs these transactions with Hyro's admin key.

The simulator and the Hyro Terminal

Traders trade in the Hyro Terminal against Hyro's own simulator. Prices come from live Bybit market data. No orders are sent to Bybit or any other exchange.

The oracle

The oracle is the service that publishes each challenge's balance and final result to Solana. It signs balance updates with the oracle key and status changes with the admin key. The current oracle service was built for an earlier version of the programs and is being rebuilt. Until it ships, balance history and final results are not written to Solana. See What's on Solana.

Indexer

An indexer reads Hyro Protocol program activity from Solana into a database. The website uses it to show vaults and their history.

How a challenge moves through the system

  1. You pay the fee in USDC. The payment lands in the fee vault through policy_checkout.
  2. Hyro's backend registers your challenge, opens its virtual vault with the starting balance, and sets it to Active.
  3. You trade on the simulator. Hyro's backend checks the rules.
  4. From launch, the oracle publishes your balance to the challenge vault while it is Active.
  5. When the challenge ends, the final status is written to Solana. After that it cannot change.

For developer details, see Developers.