How Beacon · Atlas works.
Atlas is a multi-strategy vault on X Layer testnet where three AI strategies compete for capital. One of them — Skeptic — pays the Beacon signal layer before every trade, and each payment fans out (cascades) to upstream signal authors. Every cascade produces an EIP-712 signed receipt anchored on-chain via CascadeLedger.
What is Beacon · Atlas?
Two products in one repo:
- Beacon SDK — a small TypeScript toolkit that turns HTTP endpoints into paid x402 resources on X Layer. Compose signals into cascades; composites sign EIP-712 receipts of the full payment graph.
- Atlas V2 — a Yearn V3-style ERC-4626 vault that allocates capital to three on-chain strategy contracts. Two trade heuristically (Fear = momentum, Greed = mean-revert). The third (Skeptic) buys paid intelligence from Beacon before trading — a live test of whether paid signals outperform free price action.
You'll see both in action on the dashboard: the strategy leaderboard shows Skeptic's live PnL, and the Cascades tab shows every receipt Skeptic has anchored on-chain.
1. Set up your wallet
Any EVM wallet works (MetaMask, OKX Wallet, Rabby). Click Connect in the top-right.
If your wallet isn't on X Layer testnet, the chip will show a red indicator and a Switch to X Layer Testnet button. Click it to add + switch in one prompt.
- Chain name X Layer Testnet
- Chain ID 1952 (0x7a0)
- RPC https://testrpc.xlayer.tech
- Explorer https://www.oklink.com/xlayer-test
- Native token OKB
2. Get testnet gas + bUSD
You need two things to use the app: a little testnet OKB for gas, and some bUSD (the settlement token for Beacon) for signal calls and vault deposits.
- OKB (gas) → www.okx.com/xlayer/faucet ↗. Enter your wallet address, complete the human check. You'll receive a small drip.
- bUSD (settlement) → open-mint on testnet. Use the Mint 1 bUSD button in the demo widget, or the mint(to, amount) function on the bUSD contract directly. Mint as much as you like — it's testnet.
3. Call a paid signal
Try it right here — no leaving the page:
What happens when you click:
- Connect your wallet.
- If your bUSD balance is zero, click Mint 1 bUSD and approve the mint tx (costs a little OKB gas).
- Click Call signal →. Your wallet will pop up asking to sign one EIP-3009 TransferWithAuthorization for 0.006 bUSD.
- The server probes GET safe-yield.gudman.xyz → returns 402, you sign, retry with X-Payment, get 200 back.
- The composite cascades payments to three upstream signal authors (wallet-risk, liquidity-depth, yield-score) and returns an EIP-712 signed CascadeReceipt in the X-Cascade-Receipt header.
- The demo widget decodes that receipt and shows you every upstream settlement tx with a link to the block explorer.
What you should see: 4 settlement tx hashes on X Layer (1 from your wallet to the composite, 3 from the composite to upstream authors), all real, all within one call.
4. Deposit into the vault
Open the Deposit page. Steps:
- Connect wallet.
- Enter an amount of bUSD (mint more if you need to).
- Click Approve — standard ERC-20 approval for the vault.
- Click Deposit — the vault mints you ATLS shares 1:1 against current NAV.
From that moment, your share of the vault is proportional to balanceOf(you) / totalSupply(). As strategies book PnL, your NAV / share updates.
5. Read a cascade receipt
Go to the Cascades tab on the dashboard. Each row is one signed receipt. Click a row to expand and see:
- The composite hash — the EIP-712 hash that was signed.
- The buyer settlement tx — the on-chain transfer your wallet authorized.
- Each upstream payment — slug, author, amount, settlement tx.
- The anchor tx — when Skeptic submitted the receipt to CascadeLedger. This is what makes it on-chain-provable.
Any agent or contract can now query CascadeLedger for Skeptic's payment history and verify the signatures cryptographically — no trusted server required.
6. Withdraw
On the Withdraw page, enter an ATLS share amount and click Redeem. The vault burns your shares and sends you a proportional amount of bUSD from its idle balance.
If your redemption exceeds the vault's idle balance, the call reverts with WithdrawExceedsIdle. Use the WithdrawQueue contract: requestWithdraw(shares) escrows your shares, the admin recalls capital from a strategy and calls fulfill(), then you call claim() to pull the bUSD.
Under the hood — the two primitives
Beacon · paid signals with cascade receipts
Any endpoint can become paid intelligence:
import { defineSignal } from "@beacon/sdk";
const signal = defineSignal({
slug: "my-signal",
price: 1500n, // 0.0015 bUSD per call
payTo: account.address,
token: bUSDDescriptor,
chainId: 1952,
settlementWallet,
handler: async (ctx) => ({ score: 88, ts: Date.now() }),
});
Composites fan payments out to upstream authors and sign the graph:
defineComposite({
slug: "safe-yield",
upstream: [
{ slug: "wallet-risk", url: "...", shareBps: 3300 },
{ slug: "liquidity-depth", url: "...", shareBps: 3300 },
{ slug: "yield-score", url: "...", shareBps: 3300 },
],
handler: async (ctx, upstream) => ({ composite: score(upstream) }),
});
Atlas V2 · ERC-4626 multi-strategy vault
- AtlasVaultV2 — ERC-4626. Holds bUSD. Allocates to strategies via allocate(strategy, amount).
- IStrategy — each strategy has a sub-wallet (strategy-owned, only-strategy-callable). PnL is computed from on-chain balance snapshots inside report().
- TwapOracle — 30-min ring buffer. NAV uses this, not spot, to kill flash-loan manipulation.
- SlashingRegistry — strategies post stake, anyone can file a bond-backed fraud claim with a 24h challenge window.
- CascadeLedger — accepts EIP-712 signed CascadeReceipts and emits CascadeSettled + UpstreamPaid events.
Vs the alternatives
Atlas borrows what's good from prior multi-strategy vaults and adds primitives nobody else has:
| Feature | Atlas V2 | Yearn V3 | Beefy | Sommelier |
|---|---|---|---|---|
| Vault-controlled sub-wallet custody | ✓ | ✓ | — | ✓ |
| On-chain P&L via balance snapshots | ✓ | ✓ | ✓ | ✓ |
| TWAP NAV oracle (anti flash-loan) | ✓ | ✓ | — | ✓ |
| Slashing-backed strategy stake | ✓ | — | — | — |
| x402 paid intelligence in strategy logic | ✓ | — | — | — |
| EIP-712 signed cascade receipts | ✓ first | — | — | — |
| On-chain receipt registry | ✓ CascadeLedger | — | — | — |
| MCP server for any agent client | ✓ | — | — | — |
| Open-source SDK on npm | ✓ @beacon/sdk | ✓ | — | ✓ |
Contracts (X Layer testnet · chainId 1952)
Safety & limits
- This is testnet. bUSD and OKB have zero real value. Don't deposit anything you can't afford to lose track of.
- Not audited. 42/42 contract tests pass (10 adversarial: NAV inflation, custody breach, fraud-claim edge cases, etc.). Slither is clean of high/medium findings. Foundry invariants run in CI. Mainnet would require a professional audit first.
- NAV is TWAP-priced. 30-min window. Single-block flash loans cannot move the NAV reference.
- Strategies are slashable. Anyone can file a bond-backed fraud claim. 24h challenge window. Admin can also call emergencyRevokeStrategy to pull capital instantly.
- The vault is pausable by the guardian for incident response.
FAQ
Glossary
- x402
- HTTP status 402 ("Payment Required") + a protocol for paying for a retry. Beacon's signals return 402 with a PaymentRequired body; the client signs an EIP-3009 TransferWithAuthorization and retries with an X-Payment header.
- EIP-3009
- Gasless ERC-20 transfer via typed-data signature. Signer can authorize a third party to pull tokens; no on-chain approve needed.
- Cascade receipt
- An EIP-712 signed payload listing every upstream payment the composite made to serve one buyer call. Returned in X-Cascade-Receipt, indexable on CascadeLedger.
- NAV
- Net asset value per vault share. Equals total vault assets (TWAP-priced) divided by total shares.
- Sub-wallet
- A strategy-owned contract that holds the capital the vault allocated. Only the strategy contract can call it — the vault can only pull capital via recall().
- ATLS
- The vault's share token. 1 ATLS = proportional claim on the vault's NAV.
Still stuck? Open an issue at github.com/Ridwannurudeen/beacon/issues.