HwalDOCS
v0.1 · devnet live

Hwal 刹那

On-chain trigger primitive for Solana. Built on Pyth Lazer + MagicBlock ER. Plug the 1ms reflex into any protocol with one CPI call.

V0 is live on devnet
Open / tick / fire / cancel work end-to-end on Solana devnet today. V0 uses a mock authority-pushed feed and L1 keeper polling for parity testing. V1 swaps the mock feed for Pyth Lazer subscription. V2 delegates position state to MagicBlock ER for 50ms slot cadence with atomic L1 commit.

The problem

Every Solana protocol that needs real-time conditional execution wires three things by hand: a sub-slot price feed (Pyth Core is ~400ms slot, too slow), a sub-slot execution environment (L1 is 400ms slot), and an atomic L1 settlement path. Each silos this plumbing inside its own program. The result: every protocol that touches price ends up writing the same keeper bot + RPC poller + settlement contract from scratch.

The pattern repeats:

  1. Price moves through your trigger.
  2. Keeper polls an RPC, observes the cross, decides to fire.
  3. L1 includes the keeper's tx ~400 ms later.
  4. Market has moved again. Your fill is worse than your trigger.

The solution

Hwal weaves Pyth Lazer + MagicBlock ER + Solana L1 into one primitive. Position PDA delegates to the MagicBlock ephemeral rollup on open. Inside the ER, Pyth Lazer feeds attestations every millisecond at the chosen channel (1ms / 50ms / 200ms). Trigger evaluation runs at 50ms slot cadence. When a trigger fires, the same atomic transaction settles fee, keeper reward, and net collateral, and commits back to Solana L1.

Why this only works on Solana
The 1ms feed + 50ms slot + atomic L1 commit stack requires three Solana-native pieces: Pyth Lazer (mainnet-live sub-slot oracle), MagicBlock ER (account delegation + sub-slot execution), and Solana L1 atomic settlement. Ethereum L2 rollups commit to L1 in minutes to hours; no 50ms trigger commitment has a real settlement guarantee. On Solana the ER block commits to L1 inside one slot.

Architecture

One Anchor program, three PDA account types, eight instructions. No keeper monopoly, no custodial vault.

  • Program Native Anchor program, compiled to Solana SBF
  • Accounts Config, LazerFeed, Position
  • Instructions open_position, update_triggers, tick_position, commit_to_l1, cancel_position, plus admin and feed registration
  • Events 9 events for off-chain indexers and live feed UIs

Who uses this

Any Solana protocol that needs sub-slot conditional execution. Perp DEXes adding sub-slot liquidation. Spot trading UIs adding take-profit / stop-loss with on-chain custody. Cross-DEX arbitrage routers catching ms-spread spreads. DAO treasuries executing conditional rebalances. Vaults running conditional auto-claim / auto-exit.

Continue

Quick deploy

Three commands. Windows native or WSL.

terminal
bash
anchor build
anchor deploy --provider.cluster devnet
npx ts-node scripts/setup-devnet.ts