{"eip":7390,"title":"Vanilla Options for ERC-20 Tokens","description":"An interface for creating, managing, and executing simple time-limited call/put (vanilla) options.","authors":["Ewan Humbert (@Xeway) \u003cxeway@protonmail.com\u003e","Lassi Maksimainen (@mlalma) \u003classi.maksimainen@gmail.com\u003e"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2022-09-02","requires":[20,1155],"discussionsTo":"https://ethereum-magicians.org/t/erc-7390-vanilla-option-standard/15206","repo":"ERCs","label":"ERC-7390","officialUrl":"https://eips.ethereum.org/EIPS/eip-7390","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7390.md","url":"https://eips.huatuo.xyz/eip-7390/","tldr":{"en":"A standard interface for fully collateralized call and put options on ERC-20 tokens, with buyer positions represented as transferable ERC-1155 redeem tokens.","ja":"ERC-20 トークンの完全担保型コールオプション／プットオプション用の標準インターフェース。買い手のポジションは譲渡可能な ERC-1155 の redeem トークンで表される。","ko":"ERC-20 토큰에 대한 전액 담보 콜·풋 옵션의 표준 인터페이스. 매수자의 포지션은 양도 가능한 ERC-1155 상환(redeem) 토큰으로 표현된다.","zh":"针对 ERC-20 代币的全额抵押看涨和看跌期权的标准接口，买方头寸以可转让的 ERC-1155 兑换（redeem）代币表示。"},"tags":["defi","options","derivatives","erc20","erc1155"],"explainers":{"en":{"lang":"en","tldr":"A standard interface for fully collateralized call and put options on ERC-20 tokens, with buyer positions represented as transferable ERC-1155 redeem tokens.","tags":["defi","options","derivatives","erc20","erc1155"],"related":[20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7390/","markdown":"## What problem does it solve?\n\nOptions give the right, but not the obligation, to buy (call) or sell (put) an asset at a set price during a set window. Several DeFi platforms sell options, but each defines \"an option\" in its own way, so positions from one protocol cannot be read, traded or reused by another.\n\nERC-7390 proposes a common interface for **vanilla** options (the plain call/put kind) on [ERC-20](/eip-20/) tokens, so wallets, marketplaces and aggregators can work with any compliant options contract.\n\n## How it works\n\nOne contract holds many **issuances**, each with its own id. A writer creates an issuance by filling a `VanillaOptionData` struct:\n\n| Field | Meaning |\n| --- | --- |\n| `side` | `Call` or `Put` |\n| `underlyingToken`, `amount` | The asset and the maximum quantity that can be exercised |\n| `strikeToken`, `strike` | Price per one underlying token, in the strike token |\n| `premiumToken`, `premium` | What buyers pay the writer, for the whole `amount` |\n| `exerciseWindowStart` / `End` | Unix timestamps bounding when exercise is allowed |\n| `allowed` | Optional allow-list of buyers (empty = anyone) |\n\nLifecycle:\n\n1. **`create`** pulls the collateral into the contract: the underlying for a call, the strike tokens for a put. Returns the issuance id.\n2. **`buy(id, amount)`** pays a pro-rated premium directly to the writer and mints `amount` [ERC-1155](/eip-1155/) **redeem tokens** to the buyer. Buyers can buy fractions, and redeem tokens can be transferred.\n3. **`exercise(id, amount)`** works only inside the window and burns redeem tokens. Call: the buyer pays strike and receives underlying. Put: the buyer delivers underlying and receives strike tokens.\n4. After the window, **`retrieveExpiredTokens`** returns unexercised collateral to the writer. Before anything is sold, **`cancel`** does the same.\n\nThe writer may also call `updatePremium` and `updateAllowed` until expiry; neither affects options already bought.\n\n## Sample code\n\nWriting and buying a call option (ethers v6). The contract must be approved for the collateral and premium first:\n\n```ts\nimport { Contract, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function create((uint8 side,address underlyingToken,uint256 amount,address strikeToken,uint256 strike,address premiumToken,uint256 premium,uint256 exerciseWindowStart,uint256 exerciseWindowEnd,address[] allowed)) returns (uint256)\",\n  \"function buy(uint256 id, uint256 amount)\",\n  \"function exercise(uint256 id, uint256 amount)\",\n  \"event Created(uint256 indexed id)\",\n];\nconst options = new Contract(OPTIONS_ADDRESS, abi, writer);\n\nconst now = Math.floor(Date.now() / 1000);\nconst tx = await options.create({\n  side: 0,                                   // Call\n  underlyingToken: TOKEN_A, amount: parseUnits(\"8\", 18),\n  strikeToken: TOKEN_B,     strike: parseUnits(\"25\", 18),   // 25 B per 1 A\n  premiumToken: TOKEN_C,    premium: parseUnits(\"10\", 18),  // for all 8 A\n  exerciseWindowStart: now + 86400,\n  exerciseWindowEnd: now + 3 * 86400,\n  allowed: [],\n});\nawait tx.wait();\n\n// a buyer takes half the issuance (pays 5 C), then exercises inside the window\nawait options.connect(buyer).buy(id, parseUnits(\"4\", 18));\n```\n\n## Things to know\n\n- Status: **Draft**. The interface may still change; do not assume compatibility between implementations.\n- Watch decimals: `strike` is the price of one whole underlying token, and the contract scales payments by the underlying's decimals.\n- The standard only describes fully collateralized options; it defines no way to top up collateral for under-collateralized designs.\n- Premium is paid straight to the writer at purchase. The writer can change it at any time, so buyers should check the current premium before approving.\n"},"ja":{"lang":"ja","tldr":"ERC-20 トークンの完全担保型コールオプション／プットオプション用の標準インターフェース。買い手のポジションは譲渡可能な ERC-1155 の redeem トークンで表される。","tags":["defi","options","derivatives","erc20","erc1155"],"related":[20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7390/","markdown":"## 何を解決するのか\n\nオプションは、一定の期間内に決められた価格で資産を買う（コール）または売る（プット）権利を与えるもので、義務ではありません。いくつかの DeFi プラットフォームがオプションを販売していますが、それぞれが「オプション」を独自に定義しているため、あるプロトコルのポジションを別のプロトコルが読み取ったり、取引したり、再利用したりできません。\n\nERC-7390 は、[ERC-20](/eip-20/) トークンの**バニラ**オプション（通常のコール／プットの種類）の共通インターフェースを提案します。これにより、ウォレット、マーケットプレイス、アグリゲーターが、準拠するどのオプションコントラクトとも連携できます。\n\n## 仕組み\n\n1 つのコントラクトが、それぞれ固有の ID を持つ多数の**発行（issuance）**を保持します。ライターは `VanillaOptionData` 構造体を埋めて発行を作成します。\n\n| フィールド | 意味 |\n| --- | --- |\n| `side` | `Call` または `Put` |\n| `underlyingToken`, `amount` | 原資産と、権利行使できる最大数量 |\n| `strikeToken`, `strike` | 原資産 1 トークンあたりの価格（ストライクトークン建て） |\n| `premiumToken`, `premium` | 買い手が `amount` 全体に対してライターに支払うもの |\n| `exerciseWindowStart` / `End` | 権利行使が許される期間を区切る Unix タイムスタンプ |\n| `allowed` | 買い手の任意の許可リスト（空なら誰でも） |\n\nライフサイクル：\n\n1. **`create`** は担保をコントラクトに引き込みます。コールなら原資産、プットならストライクトークンです。発行 ID を返します。\n2. **`buy(id, amount)`** は、按分したプレミアムをライターに直接支払い、`amount` 分の [ERC-1155](/eip-1155/) **redeem トークン**を買い手にミントします。買い手は端数での購入ができ、redeem トークンは転送できます。\n3. **`exercise(id, amount)`** は期間内のみ有効で、redeem トークンをバーンします。コールでは、買い手がストライクを支払い、原資産を受け取ります。プットでは、買い手が原資産を渡し、ストライクトークンを受け取ります。\n4. 期間後、**`retrieveExpiredTokens`** が未行使の担保をライターに返します。何も売れていない間は、**`cancel`** が同じことをします。\n\nライターは、満期まで `updatePremium` と `updateAllowed` も呼び出せます。どちらもすでに購入されたオプションには影響しません。\n\n## サンプルコード\n\nコールオプションの作成と購入（ethers v6）。事前に、担保とプレミアムについてコントラクトを承認（approve）しておく必要があります。\n\n```ts\nimport { Contract, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function create((uint8 side,address underlyingToken,uint256 amount,address strikeToken,uint256 strike,address premiumToken,uint256 premium,uint256 exerciseWindowStart,uint256 exerciseWindowEnd,address[] allowed)) returns (uint256)\",\n  \"function buy(uint256 id, uint256 amount)\",\n  \"function exercise(uint256 id, uint256 amount)\",\n  \"event Created(uint256 indexed id)\",\n];\nconst options = new Contract(OPTIONS_ADDRESS, abi, writer);\n\nconst now = Math.floor(Date.now() / 1000);\nconst tx = await options.create({\n  side: 0,                                   // Call\n  underlyingToken: TOKEN_A, amount: parseUnits(\"8\", 18),\n  strikeToken: TOKEN_B,     strike: parseUnits(\"25\", 18),   // 25 B per 1 A\n  premiumToken: TOKEN_C,    premium: parseUnits(\"10\", 18),  // for all 8 A\n  exerciseWindowStart: now + 86400,\n  exerciseWindowEnd: now + 3 * 86400,\n  allowed: [],\n});\nawait tx.wait();\n\n// a buyer takes half the issuance (pays 5 C), then exercises inside the window\nawait options.connect(buyer).buy(id, parseUnits(\"4\", 18));\n```\n\n## 知っておくべきこと\n\n- ステータス: **Draft**。インターフェースはまだ変更される可能性があります。実装間の互換性を前提にしないでください。\n- decimals に注意してください。`strike` は原資産 1 トークン全体の価格で、コントラクトは原資産の decimals に応じて支払い額をスケーリングします。\n- この標準が記述するのは完全担保のオプションだけです。担保不足の設計向けに担保を追加する方法は定義されていません。\n- プレミアムは購入時にライターへ直接支払われます。ライターはいつでもそれを変更できるため、買い手は承認する前に現在のプレミアムを確認すべきです。\n"},"ko":{"lang":"ko","tldr":"ERC-20 토큰에 대한 전액 담보 콜·풋 옵션의 표준 인터페이스. 매수자의 포지션은 양도 가능한 ERC-1155 상환(redeem) 토큰으로 표현된다.","tags":["defi","options","derivatives","erc20","erc1155"],"related":[20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7390/","markdown":"## 어떤 문제를 해결하나요?\n\n옵션은 정해진 기간 동안 정해진 가격에 자산을 사거나(콜) 팔(풋) 수 있는 권리를 주지만, 의무는 아닙니다. 여러 DeFi 플랫폼이 옵션을 판매하지만 각자 \"옵션\"을 자기 방식으로 정의하기 때문에, 한 프로토콜의 포지션을 다른 프로토콜이 읽거나 거래하거나 재사용할 수 없습니다.\n\nERC-7390은 [ERC-20](/eip-20/) 토큰의 **바닐라** 옵션(일반적인 콜/풋 종류)을 위한 공통 인터페이스를 제안하여, 지갑, 마켓플레이스, 애그리게이터가 표준을 따르는 어떤 옵션 컨트랙트와도 동작할 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n컨트랙트 하나가 각각 고유한 id를 가진 여러 **발행(issuance)**을 보관합니다. 작성자(writer)는 `VanillaOptionData` 구조체를 채워 발행을 만듭니다.\n\n| 필드 | 의미 |\n| --- | --- |\n| `side` | `Call` 또는 `Put` |\n| `underlyingToken`, `amount` | 기초 자산과 행사할 수 있는 최대 수량 |\n| `strikeToken`, `strike` | 기초 토큰 하나당 가격(행사 토큰 단위) |\n| `premiumToken`, `premium` | 매수자가 전체 `amount`에 대해 작성자에게 내는 금액 |\n| `exerciseWindowStart` / `End` | 행사가 허용되는 시점을 제한하는 Unix 타임스탬프 |\n| `allowed` | 매수자의 선택적 허용 목록(비어 있으면 누구나) |\n\n수명 주기:\n\n1. **`create`**는 담보를 컨트랙트로 가져옵니다. 콜은 기초 자산, 풋은 행사 토큰입니다. 발행 id를 반환합니다.\n2. **`buy(id, amount)`**는 비례 계산한 프리미엄을 작성자에게 직접 지급하고, `amount`만큼의 [ERC-1155](/eip-1155/) **상환 토큰**을 매수자에게 민팅합니다. 매수자는 일부만 살 수 있고, 상환 토큰은 전송할 수 있습니다.\n3. **`exercise(id, amount)`**는 기간 안에서만 동작하며 상환 토큰을 소각합니다. 콜: 매수자가 행사가를 지불하고 기초 자산을 받습니다. 풋: 매수자가 기초 자산을 인도하고 행사 토큰을 받습니다.\n4. 기간이 끝나면 **`retrieveExpiredTokens`**가 행사되지 않은 담보를 작성자에게 돌려줍니다. 아직 아무것도 팔리지 않았다면 **`cancel`**이 같은 일을 합니다.\n\n작성자는 만기까지 `updatePremium`과 `updateAllowed`도 호출할 수 있습니다. 어느 쪽도 이미 매수된 옵션에는 영향을 주지 않습니다.\n\n## 샘플 코드\n\n콜 옵션 작성과 매수(ethers v6). 먼저 담보와 프리미엄에 대해 컨트랙트를 승인(approve)해야 합니다.\n\n```ts\nimport { Contract, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function create((uint8 side,address underlyingToken,uint256 amount,address strikeToken,uint256 strike,address premiumToken,uint256 premium,uint256 exerciseWindowStart,uint256 exerciseWindowEnd,address[] allowed)) returns (uint256)\",\n  \"function buy(uint256 id, uint256 amount)\",\n  \"function exercise(uint256 id, uint256 amount)\",\n  \"event Created(uint256 indexed id)\",\n];\nconst options = new Contract(OPTIONS_ADDRESS, abi, writer);\n\nconst now = Math.floor(Date.now() / 1000);\nconst tx = await options.create({\n  side: 0,                                   // Call\n  underlyingToken: TOKEN_A, amount: parseUnits(\"8\", 18),\n  strikeToken: TOKEN_B,     strike: parseUnits(\"25\", 18),   // 25 B per 1 A\n  premiumToken: TOKEN_C,    premium: parseUnits(\"10\", 18),  // for all 8 A\n  exerciseWindowStart: now + 86400,\n  exerciseWindowEnd: now + 3 * 86400,\n  allowed: [],\n});\nawait tx.wait();\n\n// a buyer takes half the issuance (pays 5 C), then exercises inside the window\nawait options.connect(buyer).buy(id, parseUnits(\"4\", 18));\n```\n\n## 알아둘 점\n\n- 상태: **Draft**. 인터페이스는 아직 바뀔 수 있습니다. 구현 간 호환성을 가정하지 마세요.\n- 소수 자릿수(decimals)에 주의하세요. `strike`는 기초 토큰 한 개 전체의 가격이며, 컨트랙트는 기초 자산의 decimals에 맞춰 지급액을 조정합니다.\n- 이 표준은 전액 담보 옵션만 다룹니다. 담보가 부족한 설계를 위해 담보를 추가하는 방법은 정의하지 않습니다.\n- 프리미엄은 구매 시 작성자에게 곧바로 지급됩니다. 작성자는 언제든 이를 바꿀 수 있으므로, 매수자는 승인하기 전에 현재 프리미엄을 확인해야 합니다.\n"},"zh":{"lang":"zh","tldr":"针对 ERC-20 代币的全额抵押看涨和看跌期权的标准接口，买方头寸以可转让的 ERC-1155 兑换（redeem）代币表示。","tags":["defi","options","derivatives","erc20","erc1155"],"related":[20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7390/","markdown":"## 它解决什么问题？\n\n期权赋予在特定时间窗口内按约定价格买入（看涨）或卖出（看跌）资产的权利，而非义务。多个 DeFi 平台出售期权，但各自以自己的方式定义\"期权\"，因此一个协议中的头寸无法被另一个协议读取、交易或复用。\n\nERC-7390 为 [ERC-20](/eip-20/) 代币的**普通（vanilla）**期权（即普通的看涨/看跌类型）提出了一个通用接口，使钱包、市场和聚合器能够与任何兼容的期权合约配合工作。\n\n## 它如何运作\n\n一个合约包含许多**发行（issuance）**，每个都有自己的 id。出售方（writer）通过填写 `VanillaOptionData` 结构体来创建一次发行：\n\n| 字段 | 含义 |\n| --- | --- |\n| `side` | `Call` 或 `Put` |\n| `underlyingToken`, `amount` | 标的资产及可行权的最大数量 |\n| `strikeToken`, `strike` | 每一个标的代币的价格，以行权代币计价 |\n| `premiumToken`, `premium` | 买方为整个 `amount` 向出售方支付的费用 |\n| `exerciseWindowStart` / `End` | 限定允许行权时间的 Unix 时间戳 |\n| `allowed` | 可选的买方白名单（为空表示任何人） |\n\n生命周期：\n\n1. **`create`** 把抵押品拉入合约：看涨期权为标的资产，看跌期权为行权代币。返回发行 id。\n2. **`buy(id, amount)`** 按比例把权利金直接支付给出售方，并向买方铸造 `amount` 个 [ERC-1155](/eip-1155/) **兑换代币**。买方可以只买一部分，兑换代币可以转让。\n3. **`exercise(id, amount)`** 仅在窗口期内有效，并销毁兑换代币。看涨：买方支付行权价并收到标的资产。看跌：买方交付标的资产并收到行权代币。\n4. 窗口期结束后，**`retrieveExpiredTokens`** 将未行权的抵押品退还给出售方。在任何份额售出之前，**`cancel`** 起同样的作用。\n\n出售方在到期前还可以调用 `updatePremium` 和 `updateAllowed`；两者都不影响已经买入的期权。\n\n## 示例代码\n\n创建并购买看涨期权（ethers v6）。必须先为抵押品和权利金向合约授权：\n\n```ts\nimport { Contract, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function create((uint8 side,address underlyingToken,uint256 amount,address strikeToken,uint256 strike,address premiumToken,uint256 premium,uint256 exerciseWindowStart,uint256 exerciseWindowEnd,address[] allowed)) returns (uint256)\",\n  \"function buy(uint256 id, uint256 amount)\",\n  \"function exercise(uint256 id, uint256 amount)\",\n  \"event Created(uint256 indexed id)\",\n];\nconst options = new Contract(OPTIONS_ADDRESS, abi, writer);\n\nconst now = Math.floor(Date.now() / 1000);\nconst tx = await options.create({\n  side: 0,                                   // Call\n  underlyingToken: TOKEN_A, amount: parseUnits(\"8\", 18),\n  strikeToken: TOKEN_B,     strike: parseUnits(\"25\", 18),   // 25 B per 1 A\n  premiumToken: TOKEN_C,    premium: parseUnits(\"10\", 18),  // for all 8 A\n  exerciseWindowStart: now + 86400,\n  exerciseWindowEnd: now + 3 * 86400,\n  allowed: [],\n});\nawait tx.wait();\n\n// a buyer takes half the issuance (pays 5 C), then exercises inside the window\nawait options.connect(buyer).buy(id, parseUnits(\"4\", 18));\n```\n\n## 需要注意\n\n- 状态：**Draft**。接口仍可能变化；不要假定各实现之间相互兼容。\n- 注意小数位：`strike` 是一个完整标的代币的价格，合约会按标的资产的 decimals 对支付金额进行缩放。\n- 该标准只描述全额抵押的期权；对于抵押不足的设计，它没有定义补充抵押品的方式。\n- 权利金在购买时直接支付给出售方。出售方可以随时更改，因此买方在授权前应检查当前的权利金。\n"}}}
