> For the complete documentation index, see [llms.txt](https://current-finance.gitbook.io/current/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://current-finance.gitbook.io/current/security-and-risk/technical-details.md). Agents can also search and read this documentation through its [MCP server](https://current-finance.gitbook.io/current/~gitbook/mcp).

# Technical Details

Current is built defense-in-depth. On-chain contracts bound the worst case unconditionally. Off-chain monitoring shortens the time to detect and respond.

### On-Chain Safeguards

#### Outflow Rate Limiting

Two independent layers cap what can leave the protocol at any point in time.

**Per-second burst limiter (token bucket)** Every borrow and withdraw consumes from a per-asset token bucket that refills at a fixed rate up to a hard maximum capacity. Caps the instantaneous blast radius of any single exploit — including one executed in a single transaction.

**Daily sliding-window limiter** A separate segment-based limiter caps cumulative outflow over a rolling 24-hour window (default: 24 × 1-hour segments). Bounds the total that can leave a market in a day, sized to stay well inside the governance response SLA.

**Asymmetric by design** Limits apply to outflows (borrow, withdraw) only — never to deposits or repays. The protective rails cannot block users from de-risking their own positions.

***

#### Position and Exposure Caps

**Per-asset max borrow cap** Total debt per reserve is hard-capped. Over-cap borrows abort. Bounds protocol-wide exposure to any single asset.

**Per-asset max supply (deposit) cap** Total deposits per reserve are capped, limiting concentration and oracle-manipulation surface on thin assets.

**eMode group caps** Correlated-asset (eMode) groups carry their own aggregate borrow caps plus dedicated deposit/borrow rate limiters, isolating high-leverage modes from the rest of the book.

***

#### Oracle Integrity

Current uses Pyth as a single source per asset, with multiple validation layers before any price reaches a position.

**EMA–spot divergence detection** Price consumption cross-checks EMA against spot. If the two diverge beyond a configured tolerance, the price is rejected — defusing transient spot manipulation.

**Staleness gate** Prices older than the configured tolerance are rejected. Default: 5 seconds. Hard cap: 30 minutes.

**Confidence-interval check** Pyth's confidence band must sit within a configurable tolerance of the price. Low-quality or wide quotes are rejected.

**Zero/negative guards + feed pinning** Non-positive prices are rejected at multiple layers. Every price object is asserted against the asset's registered feed ID — oracle substitution is not possible.

***

#### Governance: Asymmetric Risk Authority

**Two-speed control by risk direction** Actions that reduce risk execute immediately. Actions that increase risk are timelocked.

| Role               | Authority                                              | Delay                               |
| ------------------ | ------------------------------------------------------ | ----------------------------------- |
| **Watcher**        | Pause asset, trigger circuit break, reduce risk        | None — immediate                    |
| **Param-Modifier** | New assets, config/cap/limiter updates, market changes | 24h timelock + 12h execution window |
| **SuperAdmin**     | Role membership only                                   | N/A                                 |

No single operational role can both loosen limits and act instantly. Users always have advance notice of risk-increasing changes.

**Capability-gated execution** On-chain authority is enforced by non-forgeable capabilities, held by an off-chain multisig.

***

### Off-Chain Monitoring and Incident Response

**Continuous oracle monitoring** Independent off-chain watchers track every price feed in real time, cross-checking on-chain values against external references to catch feed drift, staleness, or manipulation before it reaches positions.

**Depeg detection** Dedicated checks for stablecoin and LST (liquid-staking token) depegs — the highest-probability tail risk for a lending book — flagging deviation from peg on the assets where it matters most.

**Autonomous circuit breaker** A monitoring bot holds the on-chain Watcher capability and pulls the circuit breaker autonomously on a confirmed anomaly. Response time compresses from human-paced to machine-paced, keeping incidents inside the rate limiter's daily blast-radius window.

**Tiered alerting** Severity-graded alerts escalate across channels — Telegram → SMS → phone call — reaching an on-call human within minutes, day or night.

***

### Defense in Depth

Monitoring is the leading detection layer on top of the protocol's lagging on-chain guarantees: caps, limiters, oracle
