Setryn is a package-native exchange protocol on Arbitrum. It is designed to own the complete market lifecycle for structured onchain positions: definition, liquidity, execution, collateral, risk, settlement, lifecycle operations, and verifiable evidence.
contracts/: standalone Foundry workspace and protocol contractsapps/web/: Next.js exchange and professional workstationspackages/: canonical schemas, financial math, SDK, client core, and shared UIservices/: the operator runtime (maker, solver, keeper, oracle relay) and the webhook workerdeployments/: local runtime, Sepolia and Arbitrum One manifests, and the unsigned Arbitrum One deployment intentscripts/: local deployment, deployment evidence, verification inputs, fee updates, and manifest validationdocs/: specifications, plans, research, and incident runbooks
Directories are added only when their first real consumer is implemented.
- Node.js 22 or newer
- pnpm 11.24.0
- Foundry stable
git submodule update --init --recursive
pnpm install
pnpm checkStart the web application with:
pnpm devbash scripts/local-deploy-reset.sh # anvil on 127.0.0.1:8545 (chain 31337), full deployment and 15 markets
pnpm dev # web app on http://localhost:3000
node scripts/update-devnet-fees.mjs --maker-bps 5 --taker-bps 10 # publish a new fee version locallyThe reset regenerates the dated range forward listing deployments/local/markets.json from live Chainlink Arbitrum One
references (read-only; the existing listing is kept if the RPC is unreachable), deploys the core, registers the listing
with BootstrapSetrynMarkets.s.sol, and writes deployments/local/runtime.json (schema 11) and session-days.json,
which the web app and operator runtime read. The local chain starts at the current time (SETRYN_DEVNET_EPOCH
overrides it) and settles in a mintable local USDC.
pnpm check is the routine gate. Its contract step skips the invariant suite so the loop stays fast.
pnpm check # routine: lint, typecheck, build, unit and fuzz tests
pnpm check:full # milestone: routine check plus the invariant suiteInvariant runs can also be taken on their own with pnpm contracts:test:invariant, and the entire
Forge suite with pnpm contracts:test:full.
docs/runbooks/network-deployment.md has the exact commands: generate the listing,
DeploySetryn.s.sol (with SETRYN_SEQUENCER_UPTIME_FEED=testnet-static, since Arbitrum Sepolia has no Chainlink
sequencer uptime feed), BootstrapSetrynMarkets.s.sol (Circle test USDC, signed-observation fixings), the web app
environment, and the operator schedule (session days, fixings, settlement).
Development runs on the local chain. The owner deploys to Arbitrum Sepolia and Arbitrum One; see "Before you deploy" in docs/plans/claude-phase-handoff.md. Arbitrum One remains read-only until the launch gate is approved, and no script broadcasts a mainnet transaction: public-chain fee changes print unsigned calldata for governance instead.