Skip to content

Integration contract

Stable, versioned contract for any consumer (XEL, GEN, others).
Identity = wallet address only. Consumers map their own IDs → wallet outside DAY.

Sitehttps://dayprotocol.com
Docshttps://docs.dayprotocol.com
API basehttps://dayprotocol.com/api/v1
OpenAPIhttps://dayprotocol.com/api/v1/openapi.json
AuthX-API-Key (owner / agent / keeper allowlists). Never X-Role.
Route catalog44-route-catalog.md
Human reference02-agent-api.md
HTTPMeaningWhen
200DoneIntended action applied (reads; harvest with gross applied; etc.)
202PreparedPlan ready, not broadcast (phase-1 prepare-only)
422BlockedValid request that cannot be fulfilled (outcome: "blocked", blockers[])
401UnauthorizedMissing/invalid API key
403ForbiddenWrong role or WALLET_SCOPE
404Not foundUnknown resource
429Rate limitedBack off

Clients branch on the status line, then read the body for detail. Annotated bodies include outcome + httpStatus.

  • Catalog: GET /api/v1/day/errors
  • Envelope: { schemaVersion, code, message, retryable, blockers:[{code,detail?}] }
  • Stability: renaming a code is a breaking change; new codes may be added.
MethodPathAuth
GET/api/v1/wallets/{address}/positionowner|agent
GET/api/v1/wallets/{address}/portfolioowner|agent
GET/api/v1/wallets/{address}/performanceowner|agent
GET/api/v1/wallets/{address}/fundingowner|agent
POST/api/v1/wallets/batch/positionsowner|agent
GET/api/v1/day/venues/apypublic

Every metric response includes asOf and freshness (live / stale / mixed / unavailable).
APY rule: null / unavailable when live read fails — never fabricate.

MethodPathAuth
POST/api/v1/wallets/{address}/previewowner|agent
POST/api/v1/wallets/{address}/routeowner
POST/api/v1/wallets/{address}/harvestpermissionless
POST/api/v1/wallets/{address}/withdrawowner
POST/api/v1/wallets/{address}/auto-payowner
POST/api/v1/wallets/{address}/rebalanceowner
GET/PUT/api/v1/wallets/{address}/auto-yieldowner|agent / owner

Legacy /api/v1/characters/{id}/… may still resolve as aliases — do not use in new clients.

5. Discovery / strategies (venue-agnostic)

Section titled “5. Discovery / strategies (venue-agnostic)”
  1. GET /api/v1/day/strategies (or /venues) — bare ids: suilend, navi, scallop, kamino, jito, marginfi, aave-v3, morpho-blue, …
  2. GET /api/v1/day/venues/apy — live or null
  3. POST /api/v1/day/strategies/deposit/plan — same shape for every strategy
  4. Wallet previewrouteposition/performanceharvestwithdraw
  5. Optional webhooks for lifecycle

Fees: 0 bps principal · 500 bps yield skim at harvest · swap fee default 100 bps disclosed in plans.

HomesLabelMeaning
Sui, SolanaExecutablePhase-1 route homes
Base, ArbitrumMapDiscovery / prepare; broadcast off until explicit GO + writeReady
  • GET /api/v1/day/packages — Map vs Executable labels
  • GET /api/v1/day/base/enablement · /arbitrum/enablement — never imply live write on stubs
  • Wallet balances: /day/{sui,solana,base,arbitrum}/wallet-balance?address=
PathNotes
POST /api/v1/day/jupiter/planSolana
POST /api/v1/day/turbos/planSui
POST /api/v1/day/evm/swap/planBase/Arb
POST /api/v1/day/bridge/planMayan Sui↔Sol (+ fee/risk disclosure)
POST /api/v1/day/bridge/deliveryCredit only after proof
POST /api/v1/day/bridge/rescueDestination locked to owner

Autopilot decide is within-chain only — never silent cross-chain rebalance.

Subscribe: POST /api/v1/day/webhookshmacKey once.
Events: deposit.settled, withdraw.settled, harvest.completed, bridge.delivered, bridge.failed, position.updated, apy.updated.
HMAC-SHA256: t.<body> → header X-DAY-Signature: t=…,v1=….
Replay: GET /api/v1/day/webhooks/events.

Six actions: ROUTE · EXIT · REBALANCE · HARVEST · COMPOUND · AUTOPAY.
Owner signs; Day never holds keys; destination-lock on venues/payees/owner.

Terminal window
export BASE=https://dayprotocol.com/api/v1
export KEY=$DAY_OWNER_API_KEY
export W=0xYOUR_WALLET
curl -sS "$BASE/day/status" | jq .
curl -sS "$BASE/day/errors" | jq '.enumVersion'
curl -sS "$BASE/day/venues/apy" | jq '.venues[:3]'
curl -sS -H "X-API-Key: $KEY" "$BASE/wallets/$W/portfolio" | jq .
curl -sS -X POST -H "X-API-Key: $KEY" -H 'content-type: application/json' \
-d "{\"wallets\":[\"$W\"]}" "$BASE/wallets/batch/positions" | jq .
  • Live: GET /api/v1/openapi.json
  • Gate: npm run check:docs-openapi in the day repo
  • Never ship docs that still say Bearer-as-role, composite strategy ids, or character as primary identity