Decentralized Options Protocol with 1inch Integration
A modular architecture for creating and trading
crypto options with built-in leverage and liquidation mechanisms
Main contract that manages all option types through library delegation. Handles order creation, purchasing, settlement, and liquidations.
Storage contract for sell orders and options. Manages whitelist, tracks option types, and stores expiry prices.
Router for 1inch integration. Receives collateral and premium, creates options atomically via postInteraction.
Modular libraries implementing IOptionLibrary interface. Each library handles specific option type calculations.
Manages protocol fees, discounts, and referral rewards. Processes fees during option purchase.
Provides real-time asset prices for health factor calculations and settlement price fixing.
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.
Creates 1inch limit order
makerAsset: WBTC
takerAsset: USDC
receiver: AlcorRouter
extraData: (params, taker, referrer, collateralAmount)
Fills the order
Calls 1inch.fillOrder()
Approves USDC → 1inch
Provides extraData with params
Executes transfers
WBTC: taker → AlcorRouter
USDC: MM → AlcorRouter
Calls postInteraction()
postInteraction handler
Validates balances
Transfers assets to contract
Calls createAndPurchaseFromDeposit()
Creates option
_createSellOrder()
_purchaseOrderInternal()
Mode: Prefunded
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.
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.
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.
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.
Taker signs 1inch limit order with extraData containing option parameters (optionTypeId, strikes, amount, expiry, premiums, referrer, collateralAmount).
MM calls 1inch fillOrder(). 1inch transfers WBTC (collateral) to AlcorOptionRouter as receiver. 1inch transfers USDC (premium) from MM to AlcorRouter.
1inch calls AlcorRouter.postInteraction() with order details and extraData. Router validates: collateral balance, premium balance, no partial fills.
Router transfers collateral to UniversalOptionContract. Calls createAndPurchaseFromDeposit() with PurchaseMode.Prefunded. Option created and purchased in single transaction.
Premium (minus fees) sent to taker. Protocol fees sent to FeesManager. Collateral locked in UniversalOptionContract. Market maker receives option ID.
Real interface examples of the Alcor Protocol in action
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.
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 by selling straddles in just a couple of clicks. Clear profit zone visualization. Higher APR from simultaneously selling both put and call options.
🚀 Alcor Protocol - Building the future of decentralized options trading