🚀 Alcor Protocol

Decentralized Options Protocol with 1inch Integration

A modular architecture for creating and trading
crypto options with built-in leverage and liquidation mechanisms

1inch Protocol
Alcor Protocol

📊 Protocol Overview

🎯 UniversalOptionContract

Main contract that manages all option types through library delegation. Handles order creation, purchasing, settlement, and liquidations.

💾 TakerStorage

Storage contract for sell orders and options. Manages whitelist, tracks option types, and stores expiry prices.

🔄 AlcorOptionRouter

Router for 1inch integration. Receives collateral and premium, creates options atomically via postInteraction.

📚 Option Libraries

Modular libraries implementing IOptionLibrary interface. Each library handles specific option type calculations.

💰 FeesManager

Manages protocol fees, discounts, and referral rewards. Processes fees during option purchase.

📈 PriceOracle

Provides real-time asset prices for health factor calculations and settlement price fixing.

📈 Supported Option Types

📞 CALL Options (ID: 0)

  • Single strike price
  • Health factor based on moneyness
  • Liquidation when HF < 1.0

📉 PUT Options (ID: 1)

  • Single strike price
  • Inverse moneyness calculation

🎯 STRADDLE Options (ID: 2)

  • Combines CALL + PUT at same strike
  • Profit from shorting volatility
  • Higher collateral requirements
  • Complex liquidation logic

🦋 BROKEN WING BUTTERFLY (ID: 3)

  • Multi-strike strategy (3 strikes)
  • Limited risk, limited reward
  • Profit from shorting volatility
  • Advanced liquidation calculation

⚡ Core Features

💪 Leverage System

  • Configurable max leverage per option type (up to 5x)
  • Collateral can be less than option amount
  • Health factor monitoring
  • Dynamic collateral adjustment

🔥 Liquidation Engine

  • Health Factor threshold: 1.0
  • Liquidator rewards (5%)
  • Protocol fees (2%)
  • Market maker compensation (3%)

📅 Expiry Management

  • Track all option expiries
  • Fix price at expiry time
  • Single price for all options
  • Fair settlement for all parties

🎭 Dutch Auction Pricing

  • Start premium → End premium
  • Linear price decay over time
  • Order expiry mechanism
  • Fair price discovery

🔗 1inch Integration Architecture

Integration Essence

Integration with 1inch Limit Order Protocol v4 enables atomic creation and purchase of options in a single transaction. Key feature - using postInteraction mechanism, which is called by 1inch protocol after all token transfers, allowing AlcorRouter to create an option with already received assets.

📋 1inch Limit Order Structure

  • makerAsset: WBTC (collateral) - asset that taker sells
  • takerAsset: USDC (premium) - asset that taker buys
  • receiver: AlcorOptionRouter - makerAsset recipient (not taker!)
  • extension/postInteraction: callback after transfers
  • extraData: ABI-encoded option parameters

🔑 Key Points

  • Partial fills not supported (validation in postInteraction)
  • Atomicity: either option created or entire tx reverts
  • AlcorRouter stores limitOrderProtocol address for security
  • 1inch Protocol sends premium & collateral to AlcorRouter
  • AlcorRouter forwards collateral to Alcor contract, premium (minus fees) to option seller

1️⃣ Taker (Off-chain)

Creates 1inch limit order

makerAsset: WBTC
takerAsset: USDC
receiver: AlcorRouter
extraData: (params, taker, referrer, collateralAmount)

2️⃣ Market Maker

Fills the order

Calls 1inch.fillOrder()
Approves USDC → 1inch
Provides extraData with params

3️⃣ 1inch Protocol

Executes transfers

WBTC: taker → AlcorRouter
USDC: MM → AlcorRouter
Calls postInteraction()

4️⃣ AlcorRouter

postInteraction handler

Validates balances
Transfers assets to contract
Calls createAndPurchaseFromDeposit()

5️⃣ UniversalOptionContract

Creates option

_createSellOrder()
_purchaseOrderInternal()
Mode: Prefunded

Implementation Details

Parameter Immutability & Signature

Option parameters (strikes, amount, expiry, premiums, collateral) are fixed in extraData and signed by taker via EIP-712. Once signed, parameters cannot be changed - cryptographic guarantee of order integrity. Router validates signature through 1inch Protocol before execution.

Dutch Auction Pricing

Premium decays linearly over time: startPremium → endPremium
Current premium = startPremium - (elapsed / duration) × (startPremium - endPremium)
Incentivizes quick fills while allowing price discovery. Market maker gets best price based on timing.

Transfers to UniversalOptionContract

Router executes safeTransfer for premium (USDC) and collateral (WBTC) to UniversalOptionContract. This is done BEFORE calling createAndPurchaseFromDeposit(), so contract can work with already received funds.

extraData Decoding

abi.decode(extraData, (CreateOrderParams, address, address, uint256))
Unpacked into: option parameters, taker address, referrer, collateral amount. This allows passing all necessary information through 1inch limit order.

⚡ Integration Benefits

  • Atomicity: Option created only if all transfers succeed
  • No Approvals: Taker approves only 1inch, no need to approve Alcor contracts
  • 1inch integration: Uses existing 1inch infrastructure for order matching
  • Flexibility: Any option parameters can be passed through extraData
  • Single Transaction: Entire process from transfers to option creation - one transaction

🔍 1inch Integration - Detailed Flow

Order Creation (Off-chain)

Taker signs 1inch limit order with extraData containing option parameters (optionTypeId, strikes, amount, expiry, premiums, referrer, collateralAmount).

Order Filled by Market Maker

MM calls 1inch fillOrder(). 1inch transfers WBTC (collateral) to AlcorOptionRouter as receiver. 1inch transfers USDC (premium) from MM to AlcorRouter.

postInteraction Called

1inch calls AlcorRouter.postInteraction() with order details and extraData. Router validates: collateral balance, premium balance, no partial fills.

Atomic Option Creation

Router transfers collateral to UniversalOptionContract. Calls createAndPurchaseFromDeposit() with PurchaseMode.Prefunded. Option created and purchased in single transaction.

Funds Distribution

Premium (minus fees) sent to taker. Protocol fees sent to FeesManager. Collateral locked in UniversalOptionContract. Market maker receives option ID.

👁️ See How It Works

Real interface examples of the Alcor Protocol in action

📝 Signing Off-chain Order

Signing 1inch limit order

💰 Alcor Yield Dashboard

Alcor Yield Dashboard

💡 Use Cases

🎯 Limit Orders with Premium

Target Current +APR upfront Earn premium for placing the order

Set buy-low or take-profit limit orders in a few clicks and earn premium almost as "just for placing the order". Get paid while waiting for your target price to be reached.

📊 Superior to DEX LP

30% DEX 100% Alcor APR Leverage x1 DEX x5 Alcor

Traditional DEXs offer ~10-30% APR with no leverage. Alcor offers 10-100% APR by selling future volatility, with up to 5x leverage.

⚡ Short Volatility

$0 Strike Max Profit Profit Zone Loss Loss <- Asset Price -> P&L

Short volatility by selling straddles in just a couple of clicks. Clear profit zone visualization. Higher APR from simultaneously selling both put and call options.

✨ Key Benefits

🎨 Modular Design

  • Easy to add new option types
  • Library-based delegation
  • Separated concerns
  • Upgradeable logic

⚡ Gas Efficient

  • Atomic option creation via 1inch
  • Single transaction for complex operations
  • Optimized storage layout
  • Minimal external calls

🔒 Security

  • ReentrancyGuard on critical functions
  • Whitelist system for takers & MMs
  • Emergency refund mechanism
  • Fixed expiry prices via Oracle

🌐 1inch Integration

  • Enables launch on Ethereum mainnet
  • Atomic order execution
  • No need for custom DEX
  • Trusted order matching

🚀 Alcor Protocol - Building the future of decentralized options trading

🌐 Visit yield.alcor.finance 📚 Detailed Docs