Varla
OverviewWhat it is and why it matters.How It WorksLending against prediction markets, step by step.FeaturesLending, borrowing, leverage, and risk management.Supported MarketsPolymarket, Opinion, Kalshi, and more.
DocumentationProtocol docs, guides, and architecture.Smart ContractsPool, Collateral Manager, Oracle, Liquidation Engine.SDK ReferenceTypeScript SDK for protocol interactions.API ReferenceREST and GraphQL endpoints for market data.
BlogLatest news and announcements from Varla.FAQsFrequently asked questions about the protocol.Security & AuditsProtocol security, audits, and trust assumptions.Brand AssetsLogos, colors, and typography guidelines.
Sign up
Varla
Protocol
Overview What it is and why it matters.
How It Works Lending against prediction markets, step by step.
Features Lending, borrowing, leverage, and risk management.
Supported Markets Polymarket, Opinion, Kalshi, and more.
Developers
Documentation Protocol docs, guides, and architecture.
Smart Contracts Pool, Collateral Manager, Oracle, Liquidation Engine.
SDK Reference TypeScript SDK for protocol interactions.
API Reference REST and GraphQL endpoints for market data.
Resources
Blog Latest news and announcements from Varla.
FAQs Frequently asked questions about the protocol.
Security & Audits Protocol security, audits, and trust assumptions.
Brand Assets Logos, colors, and typography guidelines.
Sign up

Introduction

Overview
Varla 101

Protocol

Overview
Lending Model
Supply & Borrow Interest Rates Reserves
User Positions
Open Positions Supply Assets Borrow Assets Withdraw Assets Repay Loans
Risk Engine
Health Factor LTV & Thresholds Liquidations Market Resolution Oracle System

Markets

Overview
Polymarket
Opinion
Kalshi
Adapters

Token

Overview
Distribution
Utility & Governance
Varla Gems

Security

Overview
Trust Assumptions
Risk Disclosure
Risk Parameters

Resources

FAQ
Glossary
Links
Brand Assets

Getting Started

Overview
TypeScript SDK
GraphQL API
Smart Contracts

Smart Contracts

Overview
Core Protocol
VarlaPool VarlaOracle Interest Rate Liquidators Market Adapters
Governance & Access
Governance

References

SDK Reference
API Reference

Operations

Testing & Debugging
Contract Addresses

Security

Overview
Trust Assumptions
Risk Disclosure
Risk Parameters

Oracle System

How VarlaOracle provides manipulation-resistant pricing for prediction market positions — conservative pricing, staleness checks, and liquidity validation.

Conservative Pricing

For every position, the oracle provides two prices: the spot price (current orderbook midpoint) and a TWAP (time-weighted average price). The final price used for collateral valuation is always the minimum of the two.

Price formula
finalPrice = min(spotPrice, twapPrice)

Why minimum?
├── If spot is pumped → TWAP is lower, protects lenders
├── If TWAP lags during crash → spot is lower, reflects reality
└── Attackers must sustain manipulation over time to affect TWAP

Staleness Checks

ParameterDefaultEffect
Max staleness15 minutesPrices older than this are considered stale
Stale behaviorBlock new borrows/withdrawalsProtects against acting on outdated data
Grace periodConfigurableAfter oracle recovery, delays liquidation briefly
ℹ Why block borrows on stale data?
If prices are stale, the actual market may have moved significantly. Allowing borrows on outdated (potentially higher) collateral valuations could leave lenders exposed to undercollateralized positions.

Liquidity Validation

The oracle also checks orderbook depth. Positions in markets with less than $10,000 orderbook depth cannot be used as collateral — even if they have a valid price. This prevents use of thinly-traded markets that could be easily manipulated.


Data Sources

Polymarket (Polygon)
Prices are sourced from Polymarket's CLOB (Central Limit Order Book) API. Both spot and TWAP are computed from actual trade data. The oracle aggregator maintains multiple fallback sources.
Opinion (BSC)
Prices are sourced from Opinion's CTF Execution Engine. The same conservative pricing (min of spot and TWAP) applies with chain-specific staleness parameters.

Borrow Power vs Liquidation Behavior

The oracle applies different rules for borrowing and liquidation — this distinction protects borrowers during oracle outages:

ContextStale price behaviorRationale
Borrowing / accountingUnavailable price → that collateral = $0 borrow powerPrevents borrowing against stale (potentially inflated) values
LiquidationLiquidation is blocked if any non-zero collateral has an unavailable pricePrevents unfair liquidation during oracle outages
After oracle recoveryGrace period (default 5 min) before liquidation is allowedGives borrowers time to react after prices come back
ℹ Why the asymmetry?
Setting stale collateral to $0 for borrowing is conservative — it might lower your HF temporarily, but no one can liquidate you during the outage either. Once the oracle recovers, a grace period gives you time before liquidation becomes possible.

Manual Invalidation

Governance can manually invalidate a position via an emergency kill switch. When a position is invalidated:

EffectDetail
BorrowingThat collateral = $0 — cannot be used to borrow against
LiquidationLiquidators can still obtain a price — prevents bad debt from becoming unresolvable

Resolved Markets

After a prediction market resolves, special oracle rules apply:

OutcomeOracle behavior
Binary (0% or 100%)Allowed to be "stale forever" — no continuous updates needed since the outcome is final
Fractional (e.g., 50/50)Requires explicit finalization by governance to set the canonical price

Security Properties

Attack VectorMitigation
Spot price pumpmin(spot, TWAP) — TWAP unaffected by short-term manipulation
Flash loan attackTWAP spans multiple blocks, single-block manipulation ineffective
Oracle downtimeStaleness check blocks risky operations; grace period protects users
Thin market manipulationLiquidity threshold ($10K min depth) rejects illiquid markets

Timing Parameters

These are protocol defaults, all configurable by governance:

ParameterDefaultRange
Max staleness15 minutes1 min – 1 day
Liquidation grace period5 minutes0 – 1 hour
Early-closure window7 days0 – 90 days
Min orderbook depth$10,000Governance-set

Menu

  • Overview
  • How it works
  • Features
  • Documentations
  • FAQs

Ecosystem

  • Prediction markets
  • Builders
  • Integrations
  • Governance

Company

  • About
  • Terms
  • Privacy
  • Support

©2026 Varla Labs Inc. All rights reserved