Skip to content

chore: remove Sonic ARM automation and code - #363

Merged
clement-ux merged 2 commits into
mainfrom
clement/remove-sonic-arm
Oct 13, 2026
Merged

clement-ux merged 2 commits into
mainfrom
clement/remove-sonic-arm

Conversation

@clement-ux

@clement-ux clement-ux commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Removes the Talos automation for the Sonic ARM (six crons) and the code, tests, deploy scripts and config that only served it.
  • Origin Sonic is being wound down. origin-dollar already removed its Sonic contracts and automation (Remove Origin Sonic contracts and automation origin-dollar#3017).
  • No on-chain change in this PR. The Sonic ARM stays deployed.

Evidence (verified on-chain 2026-10-12, chain 146)

  • OriginARM proxy 0x2F872623d1E1Af5835b08b0E49aAd2d81d649D30: totalAssets ≈ 723.6 S; OS balance ≈ 0.002; Silo Varlamore market (0x248Dbbc31F2D7675775DB4A9308a98444DaBaECf) shares ≈ 0; vaultWithdrawalAmount = 0.
  • Withdrawal queue: queued − claimed ≈ 12,334.65 S, covered by the ARM's 13,058.7 wS balance. LPs can still claim without any cron.
  • Six Talos schedules still ran on Sonic (migrations/seed_schedules.sql, former lines 73–78): sonic_auto_request_withdraw, sonic_auto_claim_withdraw, sonic_collect_fees, sonic_allocate, os_silo_set_prices, sonic_collect_rewards.

Removed / Kept on purpose

Removed

  • Actions: allocateSonic, autoRequestWithdrawSonic, autoClaimWithdrawSonic, collectFeesSonic, collectRewardsSonic, setOSSiloPriceAction.
  • Helpers only they used: sonicHarvest.js, osSiloPrice.js, osStaking.js, silo.js, fly.js. Tasks harvestRewards, setHarvester, setOSSiloPrice, flyTradeQuote, flyTradeTx. collectRewards loses its Origin/Sonic branch and now requires --arm (Lido or EtherFi).
  • Contracts: SonicHarvester.sol and markets/SiloMarket.sol (not deployed on mainnet) with their ABIs; the Sonic library in Addresses.sol.
  • Deploy: script/deploy/sonic/**, make deploy-sonic, NETWORK=sonic, the chain-146 branch in DeployManager.
  • Tests: test/fork/Harvester/**; Sonic/OS/WOS/Silo fields in test/Base.sol.
  • Config: hardhat sonic network; SONIC_URL in .env.example, docker-compose.yml, dockerfile-actions, foundry.toml and two main.yml env lines; FORK_BLOCK_NUMBER_SONIC; the Fly key in .env.example and the two FLY_API_KEY lines in main.yml (only fly.js used it).
  • Data and docs: six rows in seed_schedules.sql; the "Origin ARM — Sonic" section of docs/ACTIONS.md; docs/plantuml/sonicContracts.*; Sonic deploy and Tenderly steps in README.md, CLAUDE.md, .claude/CLAUDE.md and script/deploy docs.

Kept

  • build/deployments-146.json (historical registry), OriginARM.sol, ZapperARM.sol and PendleOriginARMSY.sol (all used on mainnet). runner.ts and dump-actions-catalog.cjs are generic and needed no change.
  • OriginAssetAdapter and WrappedOriginAssetAdapter: not Sonic-specific, referenced only by test/Base.sol. Candidates for a later cleanup.
  • src/abis/OriginARMV1.json: its only consumer was allocateSonic, so it is now orphaned. Left in place because its prettier failure is pre-existing.
  • addresses.sonic.{WS,WOS,OSonicProxy}, still read by utils/arm.js.
  • liquidity.js chain-146 branches, the SONIC_ORIGIN_WS_ARM exclusion in 1Inch.js, and the Sonic lookup in addressParser.js. The last one now fails for chain 146 with a clear "library not found" error.

Before merging

  1. Disable the six live Talos schedules in the database first. seed_schedules.sql only inserts rows (ON CONFLICT DO NOTHING), so it does not disable the live ones. Otherwise those crons will fail once an image without these actions ships.
  2. Freeze the ARM's buy side before the price cron stops. The deployed Sonic ARM (implementation 0xe0a83068c0ddccfcbf2e5fff977321b0a485440f) is the v1 ARM from before New ARM features before Ethena audit #208: traderate0 / traderate1 / crossPrice, no baseAssetConfigs, no pause(). So setPrices(uint256 buyT1, uint256 sellT1) is the call to use, not the multi-asset one in today's AbstractARM.sol. On-chain values read 2026-10-12: buy price traderate1 = 0.99765, sell price = 1.0, crossPrice = 0.9999.
    • Queued withdrawals are protected. Every wS transfer out goes through _requireLiquidityAvailable, which checks amount + (withdrawsQueued - withdrawsClaimed) <= wS balance. LPs can still claim with no cron running.
    • The unreserved wS (about 724) is exposed. Prices freeze once os_silo_set_prices stops. If OS trades below 0.99765, anyone can sell OS to the ARM at that price and take the unreserved wS; v1 has no buy-liquidity cap.
    • Ops step. The operator 0x739212d5bAfE6AAC8Be49a60B7d003bD41DBf38b (or the owner) calls setPrices(buyT1, sellT1) with a very low buyT1 (it must be < crossPrice, e.g. 0.5e36) and sellT1 = 1e36 (>= crossPrice). OS-to-wS buys then become uneconomic, and claims are unaffected.

Test plan

  • forge build: pass.
  • forge fmt --check: pass.
  • forge test --summary --mp 'test/unit/**': pass (36 suites, 0 failed).
  • pnpm hardhat --help: pass. Removed tasks are absent. dump-actions-catalog.cjs produces 140 tasks.
  • pnpm lint: pass.
  • pnpm typecheck: same single pre-existing error (TS2688, @types/node).
  • pnpm prettier:check: only the pre-existing src/abis/OriginARMV1.json.
  • test/js/*.test.js (9 files): pass with NODE_PATH set. Without it, debug does not resolve under pnpm (pre-existing; logger.js requires a package that package.json does not declare).
  • migrations/seed_schedules.sql loaded into SQLite: 40 rows before, 34 after, no Sonic rows left.
  • Not run: fork, smoke and invariant tests, and the image build (needs the Talos token).

Restore path: git revert a851bf5.

🤖 Generated with Claude Code

clement-ux and others added 2 commits October 12, 2026 13:44
Origin Sonic is being wound down. The Sonic ARM (OriginARM proxy
0x2F872623d1E1Af5835b08b0E49aAd2d81d649D30, chain 146) still has ~723 S of
unreserved liquidity and a ~12,335 S withdrawal queue that LPs can claim
without any cron, so its automation is no longer needed.

- Delete the Sonic Talos actions (allocate, auto request/claim withdraw,
  collect fees/rewards, OS/Silo price setter) and the helpers only they used
  (sonicHarvest, osSiloPrice, osStaking, silo, fly).
- Delete SonicHarvester and SiloMarket (Sonic-only, not deployed on mainnet)
  with their ABIs, script/deploy/sonic, and test/fork/Harvester.
- Remove the sonic hardhat network, SONIC_URL plumbing, the deploy-sonic and
  NETWORK=sonic Makefile targets, and the Sonic library in Addresses.sol.
- collectRewards no longer defaults to Origin and requires --arm.
- Remove the six Sonic rows from migrations/seed_schedules.sql and the Sonic
  section of docs/ACTIONS.md.

The six live Talos schedules must be disabled in the database separately; the
seed file only inserts rows (ON CONFLICT DO NOTHING).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@naddison36 naddison36 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clement-ux
clement-ux merged commit 32d8d5c into main Oct 13, 2026
7 checks passed
@clement-ux
clement-ux deleted the clement/remove-sonic-arm branch October 13, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants