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

Market Adapters

Market adapters are the bridge between Varla and prediction market platforms. Each adapter implements a standard interface, allowing VarlaCore and the liquidators to interact with different position token standards.
ℹ Source files
contracts/adapters/IMarketAdapter.sol — interface
contracts/adapters/PolymarketCtfAdapter.sol
contracts/adapters/PolymarketNegRiskMergeAdapter.sol
contracts/adapters/OpinionCtfExecutionEngineAdapter.sol

IMarketAdapter Interface

All adapters implement the IMarketAdapter interface. This standardizes how Varla interacts with different prediction market token systems.

solidity
interface IMarketAdapter {
    function convert(
        uint256 positionId,
        uint256 amount,
        address recipient
    ) external returns (uint256 outputAmount);

    function getPositionToken() external view returns (address);
    function getCollateralToken() external view returns (address);
}

The convert() function is the key operation — it converts prediction market position tokens back into the underlying collateral token (e.g. merging YES+NO → USDC).


Adapters

PolymarketCtfAdapter

Integrates with Polymarket's Conditional Token Framework (CTF). Handles standard Polymarket positions where ERC1155 outcome tokens can be redeemed after market resolution.

DetailValue
Position tokenERC1155 (Polymarket CTF)
Collateral tokenUSDC
Convert methodRedeems resolved positions via CTF
PolymarketNegRiskMergeAdapter

Handles Polymarket's NegRisk positions — markets with a binary YES/NO structure where complementary tokens can be merged back into the underlying collateral without waiting for resolution.

DetailValue
Position tokenERC1155 (NegRisk wrapper)
Collateral tokenUSDC
Convert methodMerges complementary positions via NegRisk adapter
Key dependencyINegRiskAdapter interface

This is the primary path used by VarlaMergeLiquidator — it allows liquidators to merge YES+NO tokens without needing market resolution.

OpinionCtfExecutionEngineAdapter

Integrates with Opinion's CTF Execution Engine. Handles Opinion market positions which use a similar conditional token framework but with a different execution layer.

DetailValue
Position tokenERC1155 (Opinion CTF)
Collateral tokenUSDC
Convert methodRedeems/merges via Opinion's execution engine

Adding New Adapters

To integrate a new prediction market platform, implement the IMarketAdapter interface:

Custom adapter template solidity
contract MyMarketAdapter is IMarketAdapter {
    function convert(
        uint256 positionId,
        uint256 amount,
        address recipient
    ) external override returns (uint256 outputAmount) {
        // 1. Transfer position tokens from caller
        // 2. Convert/redeem via platform
        // 3. Send output tokens to recipient
        // 4. Return amount of collateral received
    }

    function getPositionToken() external view override returns (address) { ... }
    function getCollateralToken() external view override returns (address) { ... }
}

✦ Key Takeaways
  • Three production adapters: Polymarket CTF, Polymarket NegRisk, and Opinion CTF
  • All implement IMarketAdapter — standardized convert(), getPositionToken(), getCollateralToken()
  • NegRisk merge adapter is critical for liquidations (merge without resolution)
  • New prediction markets can be added by implementing the IMarketAdapter interface

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