Skip to content

Versioning

Date: 2026-07-11
Authority: docs/00-product-constitution.md (UpgradeCap burn = launch gate)
Brand: DAY · Features: Auto Yield · Auto Pay · Vaults


Do not lock contracts yet. Until mav says lock packages:

  • Keep UpgradeCap held (never burn)
  • Prefer unpublished or upgradeable test publishes only
  • Do not treat any deploy as immutable launch-gate v1
  • Off-chain *.v1 schemas can evolve carefully; on-chain freeze is a later explicit go

Superform did not ship one forever-repo:

GenerationRepoLicenseShape
v1superform-coreBSL 1.1 → GPL after 2yRouter + Forms + SuperPositions + xchain messaging
v2v2-coreApache 2.0ERC-7579 executors, hooks, SuperLedger accounting

Lessons:

  1. Major version = new package identity, not “edit main forever.”
  2. Core freezes early so users can trust fee/withdraw/custody invariants.
  3. Periphery evolves (adapters, hooks, keepers, UI) without rewriting core.
  4. License can open over time (BSL → permissive) once product/moat is proven.
  5. Audits + SECURITY.md attach to a version, not “the monorepo generally.”

On Sui, this is even stricter: packages are content-addressed. You don’t “patch v1” — you publish v2 package id and migrate.


On-chain (Sui Move) — versioned packages

Section titled “On-chain (Sui Move) — versioned packages”
PackageVersion policyImmutable?Contents
day_core (today: open_yield / XEL treasury)v1, v2, v3… each a new package idYes after launch gateFee skim (500 bps yield-only), withdraw rules, harvest accounting, survival unstake, owner authority
day_adaptersSemver per adapter, independentOptional / replaceableSuilend, NAVI, Scallop, … thin wrappers; not custody
day_registrySlow cadenceConfig-gated, not full upgrade of money mathVenue allowlist, readiness flags

Hard rules (non-negotiable across versions):

  • Stake OFF default
  • Fee only on harvested yield (never deposit/withdraw/principal)
  • Agent cannot withdraw principal
  • Owner can always withdraw
  • No team custody of principal

If a change violates any of the above → it is not a patch; it is a new major and needs explicit migration + owner approval.

SurfaceVersionNotes
HTTP APIauto-yield-plan.v1, day-api.v1Schema version in payload (Superform StateRequest energy)
SDK@dayprotocol/sdk@0.x1.xBreaking = major
Keepersharvest-plan.v1Keepers process payloads; amounts from venue, not request body
Bridgemayan-plan.v1actualReceived vs minOut (Superform S7/S8)

3. Core vs periphery (steal Superform’s split)

Section titled “3. Core vs periphery (steal Superform’s split)”
┌─────────────────────────────────────────────┐
│ PUBLIC · dayprotocol/day (or day-core) │
│ Move packages (versioned, audited) │
│ Schemas · constitution · basic SDK │
│ Adapter INTERFACES + mock adapters │
└─────────────────────────────────────────────┘
│ calls / plans
┌─────────────────────────────────────────────┐
│ PRIVATE · XEL / GEN │
│ Hosted wallets · Infisical · keepers keys │
│ Character mint · persona · ranking models │
│ Live mainnet signer wiring │
└─────────────────────────────────────────────┘
LayerOpen (OSS)Closed
Money invariantsYes — Move sources + testsDeploy keys
Venue adaptersInterface + mocks OSS; live roots optionalSigner + Infisical
OrchestratorReference scorer (TVL floor, fee net)Advanced multi-goal agent
UIApp open or product-closed (choice)

4. Version lifecycle (how we ship like Superform)

Section titled “4. Version lifecycle (how we ship like Superform)”
  1. Develop under day repo (dayprotocol/day private until open).
  2. Keep UpgradeCap on core package (XEL pattern: hard-pause capability before burn).
  3. Version schemas as .v1 from day one.
  4. Tag releases: contracts-v0.1.0-alpha, sdk-v0.1.0.

Phase B — Launch gate (public trust event)

Section titled “Phase B — Launch gate (public trust event)”
  1. Freeze core invariant surface (fee, withdraw, harvest order, default OFF).
  2. External audit of that package id.
  3. Burn UpgradeCap (or transfer to dead address) only when checklist green.
  4. Publish package id + bytecode hash on docs.dayprotocol.com.
  5. Open-source that tagged tree (or BSL-then-open if we want Superform-style delay).
  1. Never mutate launched core package.
  2. Ship v2 package for additive features (new fee modes, multi-venue receipts, etc.).
  3. Migration = owner-signed move of positions / policy pointer to new package.
  4. Adapters/keepers can ship weekly without new core major.

BumpWhen
MAJOR (v1→v2)Changes fee math, withdraw authority, custody model, default stake behavior, or breaks schema required fields
MINORNew optional schema fields, new venue adapter, new plan kind (e.g. auto_pay)
PATCHBugfix that preserves invariants + schemas

Every plan/API response includes:

{ "schemaVersion": "auto-yield-plan.v1", ... }

Unknown schemaVersion → fail closed.

yield-venue:suilend@1.2.0
yield-venue:navi@1.0.3

Core v1 can talk to adapter 1.x; adapter 2.x only if core minor supports new action enum.

git tag contracts/core-v1.0.0
# docs publish:
# package_id: 0x...
# digest: ...
# upgrade_cap: BURNED | 0x...

  1. docs/00 constitution + fee model
  2. Move core fee/harvest/withdraw modules + tests
  3. JSON schemas (*.v1.json)
  4. @dayprotocol/sdk (typed client only)
  5. Adapter interface + fixtures
  • Hosted wallet key material / Infisical paths
  • Live keeper signers
  • Advanced opportunity ranking
  • Character mint / persona pipeline
OptionLike Superform?Use when
BSL 1.1 → Apache/GPL laterv1 SuperformWant OSS visibility without immediate competitive forks
Apache 2.0 from day 1v2 SuperformMax ecosystem trust / agent adoption
MITMax simplicity

Recommendation: start private (now), launch with audited immutable core under Apache 2.0 or BSL-1.1 with 2-year flip — document the choice on docs.dayprotocol.com.


7. Superform patterns that require versions in our system

Section titled “7. Superform patterns that require versions in our system”
Superform ideaDay version surface
StateRequestauto-yield-plan.v1
Forms (adapters)venue-adapter.v1 interface
actual vs quoted bridgebridge-receipt.v1 with actualReceived
rescue failed depositbridge-rescue.v1
SuperLedger cost basis / feesharvest event schema YieldHarvested + fee bps in config
Core vs peripheryMove package freeze vs runtime keepers

  • Rename Move module brand path carefully: keep package version folders contracts/core/v1/ (not only open_yield forever)
  • Every schema file ends in .v1.json; breaking change → .v2.json
  • SDK exports SCHEMA_VERSION constants
  • CI: refuse deploy if DEFAULT_PROTOCOL_YIELD_SKIM_BPS != 500 without major bump
  • Docs page: Deployed package ids table (v1, v2, …)
  • UpgradeCap burn runbook (XEL gate) linked from docs
  • Public repo dayprotocol/core (or open day) only at tag, not floating main

Versioning is how we get Superform’s trust without copying EVM.

  • Core money rules → immutable package versions (Sui-native).
  • Adapters / keepers / UI → fast semver, replaceable.
  • Schemas → explicit .v1 / .v2, never silent.
  • Open source → publish a version, not a moving target.

DAY = versioned open execution + private intelligence. That is the system design.