Skip to content

Repository files navigation

Setryn

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.

Repository

  • contracts/: standalone Foundry workspace and protocol contracts
  • apps/web/: Next.js exchange and professional workstations
  • packages/: canonical schemas, financial math, SDK, client core, and shared UI
  • services/: the operator runtime (maker, solver, keeper, oracle relay) and the webhook worker
  • deployments/: local runtime, Sepolia and Arbitrum One manifests, and the unsigned Arbitrum One deployment intent
  • scripts/: local deployment, deployment evidence, verification inputs, fee updates, and manifest validation
  • docs/: specifications, plans, research, and incident runbooks

Directories are added only when their first real consumer is implemented.

Requirements

  • Node.js 22 or newer
  • pnpm 11.24.0
  • Foundry stable

Setup

git submodule update --init --recursive
pnpm install
pnpm check

Start the web application with:

pnpm dev

Local chain

bash 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 locally

The 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.

Testing

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 suite

Invariant runs can also be taken on their own with pnpm contracts:test:invariant, and the entire Forge suite with pnpm contracts:test:full.

Deploying to Arbitrum Sepolia

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).

Network safety

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.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages