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

VarlaCore

The central contract of the Varla protocol. VarlaCore manages collateral deposits and withdrawals (ERC1155 positions), borrowing, repayment, health factor enforcement, and position lifecycle.
ℹ Source
contracts/VarlaCore.sol — inherits ERC1155Holder, AccessManaged, ReentrancyGuard

Immutables

NameTypeDescription
positionsTokenIERC1155The ERC1155 contract holding prediction market positions (e.g. CTF)
collateralTokenIERC20The ERC20 token used for borrowing (e.g. USDC)
collateralDecimalsuint8Decimal precision of the collateral token
poolIVarlaPoolThe lending pool that provides liquidity
MIN_BORROWuint256Minimum borrow amount to prevent dust positions

Key Structs

LtvConfig

Per-position LTV configuration with three risk tiers (all values in WAD — 18 decimals).

solidity
struct LtvConfig {
    uint256 conservative;  // e.g. 0.50e18 → 50% LTV
    uint256 moderate;      // e.g. 0.65e18 → 65% LTV
    uint256 risk;          // e.g. 0.80e18 → 80% LTV
}
LiquidationConfig
solidity
struct LiquidationConfig {
    uint256 targetHealthFactor;          // HF target after liquidation
    uint256 healthFactorForMaxBonus;     // HF threshold for max bonus
    uint256 liquidationBonusFactorBps;   // Bonus factor in basis points
    uint256 dustThreshold;               // Min debt to avoid dust
    uint256 collateralDustThreshold;     // Min collateral to avoid dust
}
TierLiquidationConfig
solidity
struct TierLiquidationConfig {
    uint16 maxLiquidationBonusBps;   // Max bonus for this risk tier
    uint16 liquidationFeeBps;         // Protocol fee on liquidations
}
RiskTier enum
solidity
enum RiskTier { CONSERVATIVE, MODERATE, RISK }

Each user selects a risk tier when opening a position. Higher tiers allow higher LTV but face steeper liquidation penalties.

UserAccount
solidity
struct UserAccount {
    uint256[] positionIds;    // Deposited ERC1155 token IDs
    uint256   scaledDebt;     // Scaled debt (before interest)
    uint256   borrowTimestamp; // When the user last borrowed
}

User-Facing Functions

FunctionDescription
deposit(uint256[] positionIds, uint256[] amounts)Deposit ERC1155 prediction market positions as collateral. Transfers tokens into VarlaCore.
withdraw(uint256[] positionIds, uint256[] amounts)Withdraw collateral. Reverts if withdrawal would make position unhealthy.
borrow(uint256 amount)Borrow collateral token (e.g. USDC) against deposited positions. Must maintain health factor ≥ 1.0. Minimum borrow enforced.
repay(uint256 amount)Repay outstanding debt. Partial repayment allowed.
repayAll()Repay full outstanding debt including accrued interest.

View Functions

FunctionReturns
getHealthFactor(address user)Current health factor (WAD). < 1.0 → liquidatable.
getAccountValues(address user)AccountValues — portfolio value, collateral value, liquidation eligibility, oracle guard state.
getUserPositionIds(address user)Array of deposited ERC1155 token IDs.
getUserDebt(address user)Current debt including accrued interest.
getPositionLtv(uint256 positionId)LtvConfig for the given position.

Admin Functions

⚠ Access restricted
These functions are gated by AccessManaged — only addresses with the appropriate role in VarlaAccessManager can call them.
FunctionRoleDescription
setLtvConfig(uint256 pid, LtvConfig)RISK_MANAGERSet LTV tiers for a position ID
setLiquidationConfig(...)RISK_MANAGERUpdate liquidation parameters
setTierLiquidationConfig(RiskTier, ...)RISK_MANAGERConfigure per-tier liquidation bonus/fee
setLiquidator(address)AdminSet the liquidator contract address

Events

solidity
event Deposited(address indexed user, uint256[] positionIds, uint256[] amounts);
event Withdrawn(address indexed user, uint256[] positionIds, uint256[] amounts);
event Borrowed(address indexed user, uint256 amount);
event Repaid(address indexed user, uint256 amount);
event Liquidated(address indexed user, address indexed liquidator, uint256 debtRepaid, uint256 collateralSeized);

✦ Key Takeaways
  • VarlaCore is the central contract — it holds all ERC1155 collateral and manages all user debt
  • All collateral is ERC1155 (prediction market positions), all debt is ERC20 (e.g. USDC)
  • Health factor < 1.0 triggers liquidation eligibility — see VarlaLiquidator
  • Three risk tiers (Conservative, Moderate, Risk) with different LTV and liquidation parameters
  • Protected by ReentrancyGuard and AccessManaged (RBAC via VarlaAccessManager)

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