Skip to content

Rebalancing

Rebalancing in zkde.fi combines proposal logic, model checks, policy context, and execution orchestration.

The Problem This Solves

Portfolio drift happens continuously. Manual balancing is slow and inconsistent, while blind automation can violate user constraints or risk preferences.

Why This Matters

A structured rebalancing pipeline provides controlled automation with observable checkpoints, so users can reason about both safety and execution progress.

Pipeline Overview

flowchart LR
  A[Analyze] --> B[Propose]
  B --> C[Check]
  C --> D[Prepare]
  D --> E[Execute]
  E --> F[Receipt and state update]

Endpoint Sequence

StageMethodEndpointPurpose
AnalyzePOST/api/v1/zkdefi/rebalancer/analyzePortfolio assessment
ProposePOST/api/v1/zkdefi/rebalancer/proposeCreate rebalance proposal
CheckPOST/api/v1/zkdefi/rebalancer/checkModel/policy checks
AdvisoryPOST/api/v1/zkdefi/rebalancer/advisory-checkNon-blocking check mode
PreparePOST/api/v1/zkdefi/rebalancer/prepareBuild execution context
ExecutePOST/api/v1/zkdefi/rebalancer/executeExecute rebalance

Autonomous Controls

MethodEndpointAuth expectation
POST/api/v1/zkdefi/rebalancer/autonomous/startX-Wallet-Address
POST/api/v1/zkdefi/rebalancer/autonomous/stopX-Wallet-Address
GET/api/v1/zkdefi/rebalancer/autonomous/status/{user_address}Public/read
POST/api/v1/zkdefi/rebalancer/autonomous/pause/{user_address}X-Wallet-Address
POST/api/v1/zkdefi/rebalancer/autonomous/resume/{user_address}X-Wallet-Address
GET/api/v1/zkdefi/rebalancer/autonomous/allX-Admin-Key

Problem It Solves For Users

Users get both manual and autonomous pathways with visible state transitions rather than hidden black-box execution.

Why It Matters For Integrators

Integrators can treat each stage as a checkpointed state machine and attach monitoring, retries, and user messaging to clear transition points.

Verification Semantics

Rebalancing checks can operate in strict or advisory patterns depending on route and context. Integrators should not assume a single global gating mode across all rebalancing endpoints.

Next: Session keys | Risk Passport | API overview

Built by Obsqra Labs