Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article explores ERC7390, a proposal for a flexible mechanism that uses ERC1155 to let buyers purchase fractions of an option issuance and transfer their rights to others.
This article translates, summarizes, and elaborates on the specification below.
I also cover a wide range of EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.
Overview
ERC7390 defines functions and events for vanilla options. A vanilla option gives its buyer the right to buy or sell an asset at a specified price, without obligating the buyer to exercise that right.
Rather than limiting a contract to a single option that becomes obsolete after expiry, the standard allows additional issuances to be created as needed. Each issuance receives its own identifier, so purchases, exercises, and cancellations can be handled independently.
Issuances must be backed by collateral. Collateral is an asset deposited in advance by the option provider, known as the writer, to ensure that payment can be made if the buyer exercises the option. If the buyer does not exercise the option, the writer can withdraw the collateral.
Buyers can purchase part of an issuance rather than the entire issuance. A purchase results in the issuance of tokens in the ERC1155 format. These tokens represent a share of an issuance and are referred to here as redeem tokens. Redeem tokens are transferable to other users and are used when exercising the option. A buyer can therefore exercise only part of the purchased amount.
See the following article for more information about ERC1155.
The writer can cancel an issuance only if nobody has purchased any of it. The writer can also update the premium (the fee paid when buying an option) at any time, without affecting portions that have already been purchased.
The asset covered by the option (the underlying), the asset used for exercise (the strike asset), and the asset used to pay the premium are all ERC20 tokens. The plural term options may also refer to the amount of redeem tokens held by a buyer.
Motivation
Options are widely used financial instruments in investing and trading, with applications ranging from risk management to trading on price movements.
Decentralized finance (DeFi) has also seen an increase in mechanisms for selling options, but these protocols use their own specifications and lack interoperability. Like common crypto tokens, options would ideally be usable across applications; the absence of a common standard limits their utility.
Standardizing options as an ERC gives applications a common format for interacting with them, making it easier for users to trade options across platforms. Because the standard focuses on the most common form of option, the vanilla option, it can also serve as a foundation for more complex instruments such as exotic options.
Specification
interface IERC7390 {
enum Side {
Call,
Put
}
struct VanillaOptionData {
Side side;
address underlyingToken;
uint256 amount;
address strikeToken;
uint256 strike;
address premiumToken;
uint256 premium;
uint256 exerciseWindowStart;
uint256 exerciseWindowEnd;
address[] allowed;
}
struct OptionIssuance {
VanillaOptionData data;
address writer;
uint256 exercisedAmount;
uint256 soldAmount;
}
error Forbidden();
error TransferFailed();
error TimeForbidden();
error AmountForbidden();
error InsufficientBalance();
event Created(uint256 indexed id);
event Bought(uint256 indexed id, uint256 amount, address indexed buyer);
event Exercised(uint256 indexed id, uint256 amount);
event Expired(uint256 indexed id);
event Canceled(uint256 indexed id);
event PremiumUpdated(uint256 indexed id, uint256 amount);
event AllowedUpdated(uint256 indexed id, address[] allowed);
function create(VanillaOptionData calldata optionData) external returns (uint256);
function buy(uint256 id, uint256 amount) external;
function exercise(uint256 id, uint256 amount) external;
function retrieveExpiredTokens(uint256 id, address receiver) external;
function cancel(uint256 id, address receiver) external;
function updatePremium(uint256 id, uint256 amount) external;
function updateAllowed(uint256 id, address[] memory allowed) external;
function issuance(uint256 id) external view returns (OptionIssuance memory);
}Events
Created
event Created(uint256 id);Emitted when an option issuance is successfully created.
It notifies observers that the writer has executed create() and the collateral has been properly locked in the contract.
The issuance is identified by an ID.
Parameters
id- Identifier of the newly created option issuance.
Bought
event Bought(uint256 indexed id, uint256 amount, address indexed buyer);Emitted when options are purchased.
It indicates that the buyer executed buy() and the specified amount of redeem tokens (ERC1155 tokens) was minted.
The premium is paid directly to the writer at purchase time.
See the following article for more information about ERC1155.
Parameters
id- Identifier of the option issuance being purchased.
amount- Amount of options purchased.
buyer- Address of the buyer.
Exercised
event Exercised(uint256 indexed id, uint256 amount);Emitted when a buyer exercises options.
It indicates that the buyer executed exercise(), the corresponding redeem tokens were burned, and the asset exchange took place: for a call, the buyer received underlyingToken and paid strikeToken; for a put, the buyer delivered underlyingToken and received strikeToken.
Parameters
id- Identifier of the option issuance being exercised.
amount- Amount of options exercised.
Expired
event Expired(uint256 indexed id);Emitted when collateral corresponding to unexercised options is returned to the writer.
It notifies observers that, after the exercise period ended, the writer executed retrieveExpiredTokens() to recover the remaining collateral.
Parameters
id- Identifier of the option issuance for which collateral was returned.
Canceled
event Canceled(uint256 indexed id);Emitted when an option issuance is canceled.
If nobody has purchased any options, the writer can invalidate the issuance by calling cancel().
After cancellation, the collateral is returned to the writer.
Parameters
id- Identifier of the canceled option issuance.
PremiumUpdated
event PremiumUpdated(uint256 indexed id, uint256 amount);Emitted when the premium is updated.
It notifies observers that the writer executed updatePremium() to change the premium for the unsold portion.
Options already purchased are unaffected.
Parameters
id- Identifier of the relevant option issuance.
amount- Updated premium value.
AllowedUpdated
event AllowedUpdated(uint256 indexed id, address[] allowed);Emitted when the list of addresses permitted to purchase options changes.
It notifies observers that the writer executed updateAllowed() to set a new allowlist.
Existing buyers can still exercise their options even if they are not on the new list.
Parameters
allowed- Updated list of permitted addresses.
Structs
VanillaOptionData
struct VanillaOptionData {
Side side;
address underlyingToken;
uint256 amount;
address strikeToken;
uint256 strike;
address premiumToken;
uint256 premium;
uint256 exerciseWindowStart;
uint256 exerciseWindowEnd;
address[] allowed;
}A struct containing all the parameters required to create an option issuance.
It holds the option type (call or put), the underlying token, exercisable amount, premium, exercise period, and other information required for issuance.
An option is created by passing this struct to create().
Parameters
side- Indicates whether the option is a call or a put.
underlyingToken- Address of the token representing the underlying asset.
amount- Maximum amount of
underlyingTokenthat can be exercised.
- Maximum amount of
strikeToken- Token in which the strike price is denominated.
strike- Amount of
strikeTokenper unit ofunderlyingToken.
- Amount of
premiumToken- Token used to pay the premium.
premium- Premium for the entire issuance.
exerciseWindowStart- Start time of the exercise window.
exerciseWindowEnd- End time of the exercise window.
allowed- List of addresses permitted to purchase options.
- If the array is empty, anyone may buy.
OptionIssuance
struct OptionIssuance {
VanillaOptionData data;
address writer;
uint256 exercisedAmount;
uint256 soldAmount;
}A struct representing the state of an issued option.
Alongside the issuance parameters (VanillaOptionData), it holds the writer's address and data updated over the option's lifetime, including the amounts sold and exercised.
Parameters
data- Option information set at issuance.
writer- Address that issued the options.
exercisedAmount- Amount of
underlyingTokenalready exercised.
- Amount of
soldAmount- Amount of
underlyingTokenalready purchased.
- Amount of
Enum
Side
enum Side {
Call,
Put
}An enum indicating whether an option is a call or a put.
A call is the right to buy underlyingToken at a specified price, while a put is the right to sell underlyingToken at a specified price.
Values
CallRepresents a call option.PutRepresents a put option.
Functions
create
function create(VanillaOptionData calldata optionData) external returns (uint256);Creates a new option issuance. The writer first approves the collateral and then initiates the issuance. The contract receives the collateral and registers the option as fully collateralized. On success, it returns a unique ID.
Arguments
optionData- A
VanillaOptionDatastruct containing the settings required for issuance.
- A
Return value
uint256- ID of the newly created option issuance.
buy
function buy(uint256 id, uint256 amount) external;Purchases the specified amount of options.
The buyer first approves payment of the required premium, then executes buy().
On success, redeem tokens are minted to the buyer.
Arguments
id- ID of the option issuance to purchase from.
amount- Amount of
underlyingTokento purchase rights over.
- Amount of
exercise
function exercise(uint256 id, uint256 amount) external;Exercises previously purchased options. The tokens exchanged depend on whether the option is a call or a put. On success, the corresponding redeem tokens are burned.
Arguments
id- ID of the option issuance to exercise.
amount- Amount to exercise.
retrieveExpiredTokens
function retrieveExpiredTokens(uint256 id, address receiver) external;Allows the writer to recover remaining collateral after the exercise period.
It returns collateral corresponding to unexercised options once the exercise period has ended.
If receiver is the zero address, the caller receives the collateral.
Arguments
id- ID of the relevant option issuance.
receiver- Address that receives the collateral.
cancel
function cancel(uint256 id, address receiver) external;Cancels an option issuance from which no options have been purchased. The writer may invalidate an issuance only if nobody has bought from it. The collateral is returned, and the issuance data may be deleted.
Arguments
id- ID of the issuance to cancel.
receiver- Address that receives the collateral.
updatePremium
function updatePremium(uint256 id, uint256 amount) external;Updates the premium for unsold options. The writer can change the premium value for the entire issuance. The premium cannot be updated during or after the exercise period.
Arguments
id- ID of the relevant option issuance.
amount- New premium value.
updateAllowed
function updateAllowed(uint256 id, address[] memory allowed) external;Updates the list of addresses permitted to purchase options. It changes the restrictions on buyers. Existing buyers can exercise their options even if they are no longer on the list.
Arguments
id- ID of the relevant option issuance.
allowed- New allowlist.
issuance
function issuance(uint256 id) external view returns (OptionIssuance memory);Retrieves option issuance data for the specified ID. It returns all issuance data and the current state, including the amounts sold and exercised.
Arguments
id- ID of the relevant option issuance.
Return value
OptionIssuance- All information associated with the issuance.
Call option example
This example follows Bob as he issues call options, Alice and John as they purchase portions of the issuance, and Alice as she exercises her options.
Bob issues call options
Bob wants to offer anyone the right to buy 8 TokenA at 25 TokenB each, exercisable from July 14 to July 16, 2023.
In exchange for selling this right, Bob wants to receive a premium of 10 TokenC.
For a call option, Bob, the writer, must deposit the asset that will be delivered to buyers upon exercise: underlyingToken (TokenA).
Bob needs to provide 8 TokenA, so he executes TokenA's approve() function to allow the contract to withdraw that amount.
After approval, Bob calls create() on the contract to issue options with the following parameters.
| Parameter | Value |
|---|---|
side |
Call |
underlyingToken |
TokenA |
amount |
Rights over 8 TokenA |
strikeToken |
TokenB |
strike |
25 TokenB |
premiumToken |
TokenC |
premium |
10 TokenC |
exerciseWindowStart |
2023-07-14 |
exerciseWindowEnd |
2023-07-16 |
allowed |
Anyone can buy |
The option issuance is assigned ID 88.
Alice purchases part of the issuance (rights over 4 TokenA)
Alice wants to purchase rights over only 4 TokenA instead of 8 TokenA.
Because the premium for the entire issuance is 10 TokenC, Alice pays half of that amount.
The proportional premium is calculated as follows.
Premium payable = (purchase amount * premium) / amountAlice executes TokenC's approve() to authorize the required amount, then submits buy(88, 4 TokenA worth) to the contract.
Alice receives redeem tokens (ERC1155) representing rights over 4 TokenA.
John purchases rights over only 2 TokenA
John follows the same procedure to buy rights over 2 TokenA and receives redeem tokens representing 2 TokenA.
Alice exercises her options
Suppose that on July 15, 2023, TokenA is trading at a price of 50 TokenB.
The right to buy it for 25 TokenB is favorable, so Alice chooses to exercise.
To exercise, Alice needs to pay the following amount of TokenB to the contract.
TokenB payable = (exercise amount * strike) / TokenA decimal scaling factorAlice executes TokenB's approve(), then calls exercise(88, 4 TokenA worth).
The resulting transfers are as follows.
- Alice receives
4 TokenA. - Bob receives
4 × 25 = 100 TokenB.
John transfers his rights to Jimmy, who exercises only part of them
John sends Jimmy the redeem tokens representing rights over 2 TokenA that he holds.
Redeem tokens follow ERC1155 and are transferable like ordinary tokens.
Jimmy exercises rights over just 1 TokenA out of 2 TokenA.
The required payment is as follows.
Exercise for 1 TokenA → payment of 25 TokenBThe contract sends Jimmy 1 TokenA and sends Bob 25 TokenB.
Put option example
The next example shows Bob issuing put options.
Bob issues put options
Bob wants to offer anyone the right to sell 8 TokenA to Bob at 25 TokenB each, exercisable from July 14 to July 16, 2023.
He wants to receive 10 TokenC as the premium.
For a put option, the writer's collateral is strikeToken (TokenB).
Bob must pay buyers upon exercise, so he deposits 8 × 25 = 200 TokenB.
After executing TokenB's approve(), Bob passes the following parameters to create().
| Parameter | Value |
|---|---|
side |
Put |
underlyingToken |
TokenA |
amount |
Rights over 8 TokenA |
strikeToken |
TokenB |
strike |
25 TokenB |
premiumToken |
TokenC |
premium |
10 TokenC |
exerciseWindowStart |
2023-07-14 |
exerciseWindowEnd |
2023-07-16 |
allowed |
Anyone can buy |
This issuance also receives ID 88.
Alice buys the right to sell only 4 TokenA
The purchase procedure is the same as for a call option.
The total premium is 10 TokenC, so Alice pays half of it for rights over 4 TokenA.
Alice executes buy(88, 4 TokenA worth) and receives redeem tokens representing rights over 4 TokenA.
Alice exercises her options
Suppose TokenA is trading at 10 TokenB on July 15, 2023.
Alice exercises because she can sell it above the market price (for 25 TokenB).
Alice must send TokenA to the contract, so she calls approve() on TokenA and executes exercise(88, 4 TokenA worth).
The resulting amounts are as follows.
- Alice receives
4 × 25 = 100 TokenB. - Bob receives
4 TokenA.
John transfers his rights to Jimmy, who partially exercises them
As in the call option example, John sends Jimmy redeem tokens representing rights over 2 TokenA.
Jimmy exercises rights over just 1 TokenA, delivering TokenA to Bob in exchange for 25 TokenB.
Returning collateral (example of retrieveExpiredTokens)
If Alice does not exercise her options, Bob can recover his collateral after the exercise period ends (July 16, 2023).
By executing retrieveExpiredTokens(88), Bob receives the following.
- For calls, TokenA corresponding to the unexercised amount.
- For puts, TokenB corresponding to the unexercised amount.
Additional considerations
Oracle-free design
ERC7390 is designed not to depend on a price oracle (an external price feed). The reasoning is simple: it assumes that a rational buyer will exercise an option only when doing so is advantageous.
The contract does not need to know the current market price.
Buyers compare the market price with the option terms (the strike price) and call exercise only when they consider it worthwhile.
Leaving the exercise decision to the buyer avoids dependence on an oracle.
Determining premiums and calculating them offchain
In ERC7390, the writer is free to determine the premium (the fee paid to purchase options). Writers may use a financial model such as the well-known Black-Scholes model or choose another pricing method.
The premium does not have to be calculated onchain. Complex mathematical and statistical calculations onchain increase gas costs, so it is more efficient to calculate the premium offchain and pass only the result to the contract.
Writers can also update premiums at any time through updatePremium.
This allows them to adjust premiums as factors such as the following change.
- Price movements in the underlying asset.
- Changes in volatility (the magnitude of price fluctuations).
- Changes in the time remaining until expiry.
- Other factors the writer wishes to consider.
Vanilla options as a foundation for exotic options
ERC7390 aims to represent standard vanilla options. The design also anticipates that exotic options (options with more complex terms) can be built on top of the standard.
Defining the basic vanilla option through a common interface makes it easier to implement exotic options as an additional layer of functionality. Standardizing the underlying purchase, exercise, and collateral management mechanisms makes them more reusable across the ecosystem.
Multiple issuances rather than a single option
ERC7390 does not follow a one-contract, one-option model. Instead, a single contract can contain as many issuances as required.
Each issuance is identified by an ID, and the following operations can be performed independently.
- Purchasing (buy).
- Exercising (exercise).
- Canceling (cancel).
- Recovering collateral (retrieveExpiredTokens).
There is no need to deploy a separate contract for each option, reducing deployment costs, administrative overhead, and gas costs. A model in which each issuance has its own independent state is also better suited to practical operations.
Exercise windows for European- and American-style options
By defining two timestamps, exerciseWindowStart and exerciseWindowEnd, ERC7390 can represent both European- and American-style options.
Buyers can exercise only when the current time is at or after exerciseWindowStart and at or before exerciseWindowEnd.
For a European-style option, the writer sets the expiration time as exerciseWindowStart and sets exerciseWindowEnd to the expiration time plus a short grace period.
The result is effectively an option that can be exercised only during a short window around expiry.
For an American-style option, the writer can set exerciseWindowStart to the current time and exerciseWindowEnd to the expiration time, allowing exercise at any point from issuance until expiry.
The following table compares these two approaches.
| Style | exerciseWindowStart |
exerciseWindowEnd |
Characteristics |
|---|---|---|---|
| European-style | Expiration time | Expiration time + short grace period | In effect, exercise is possible only around expiry. |
| American-style | Issuance time (current time) | Expiration time | Exercise is possible at any time from issuance until expiry. |
Multiple buyers and partial exercise with ERC1155
ERC7390 assumes that one option issuance can have multiple buyers. It achieves this using ERC1155 tokens.
When a buyer purchases part of an issuance, redeem tokens (ERC1155 tokens) are minted in proportion to the amount purchased. These tokens represent the buyer's share of the rights associated with the issuance and have the following properties.
- They can be transferred to other users (transferring the rights).
- Holders can exercise only part of their balance (partial
exercise).
This design allows multiple people to share an issuance and exercise different amounts at different times.
Restricting purchases with the allowed array
ERC7390 provides an address array called allowed to control who may purchase options from each issuance.
If allowed is empty, anyone may buy options.
If the writer includes only specific addresses, other addresses cannot purchase them.
This is useful, for example, if Bob and Alice have agreed to option terms offchain and want to record them onchain without allowing someone else to buy the options.
Using allowed to permit purchases only by Alice's address reduces the risk that another address will intervene and buy the options between creation of the contract and Alice's purchase.
Extending the standard beyond ERC20
ERC7390 is primarily designed to handle ERC20 tokens. However, the principles behind this standard can also be applied to other token standards, such as ERC721.
For example, an implementation dealing with ERC721 would need to work with NFT token IDs rather than using amount to represent quantities.
In that case, the struct fields and function signatures would be changed to accept id instead of amount.
The following core principles could still be reused.
- The writer deposits collateral.
- The buyer pays a premium to acquire rights.
- The rights can be exercised within a specified period.
- Collateral for unexercised options is returned to the writer.
The design thus treats an ERC20-based standard as a potential foundation for other token standards as well.
Security
Enforcing the exercise period (exerciseWindow)
ERC7390 explicitly restricts the time during which a buyer can exercise options through exerciseWindowStart and exerciseWindowEnd.
Once the current time exceeds exerciseWindowEnd, buyers can no longer exercise their options, and writers can recover the remaining collateral through retrieveExpiredTokens.
This makes the period during which an option remains valid explicit and prevents inconsistencies such as exercise after expiry.
Arbitrage and premium updates for European-style options
With European-style options, the exercise window is short and occurs around expiry. If the market price and the strike price diverge substantially at that time, clear arbitrage opportunities can arise.
For example, if an option is deeply in the money just as the exercise window opens and the premium has been left low, a bot could buy the option at that moment and exercise it immediately for an almost risk-free profit.
For this reason, ERC7390 strongly recommends that writers of European-style issuances call updatePremium when the exercise window opens and raise the premium substantially.
Doing so can reduce the likelihood that remaining options are bought cheaply as soon as the exercise window opens and then exercised immediately for profit.
For American-style options, which are exercisable continuously from issuance, this kind of sudden arbitrage opportunity at the opening of the exercise window is less likely to arise. An abrupt premium adjustment of this kind is therefore not essential.
Front-running risk in updatePremium
ERC7390 provides updatePremium, allowing writers to update the premium at any time.
This creates a risk for buyers.
For example, when a buyer calls buy expecting the current premium, a writer may observe that transaction and arrange for a miner (or validator) to process the writer's updatePremium transaction first, suddenly increasing the premium.
This is a form of front-running.
To mitigate this risk, the specification warns buyers to take the following precaution.
- When using
approveto authorize the premium payment, approve exactly the agreed amount, and no more.
Even if the writer front-runs the purchase and raises the premium, the contract cannot withdraw more than the agreed amount, limiting the buyer's potential loss.
Rounding errors in integer arithmetic and their effects
Because ERC7390 allows multiple buyers to share one issuance, calculations involving a fraction of the total issuance occur frequently. However, blockchains generally use integer arithmetic, so fractional parts may be truncated (rounded down) when calculating proportions.
In particular, the premium payable in buy is calculated in the following form.
Premium payable = (purchase amount / issuance amount) × total issuance premiumIf this value is not exactly divisible into the token's smallest units, it is rounded down to a slightly smaller value. As a result, the writer may receive slightly less than the expected premium.
In theory, a malicious buyer could benefit from this truncation repeatedly by making many purchases of very small amounts. In practice, the risk is considered relatively small for the following reasons.
- Many tokens have sufficient decimal precision (decimals), so the difference caused by truncation is very small.
- The gas cost of submitting many transactions to capture those differences is usually greater than the benefit.
Nevertheless, the specification identifies rounding in integer premium calculations as a consideration that both designers and writers should understand.
References
Ewan Humbert (@Xeway) xeway@protonmail.com, Lassi Maksimainen (@mlalma) lassi.maksimainen@gmail.com, "ERC-7390: Vanilla Options for ERC-20 Tokens [DRAFT]," Ethereum Improvement Proposals, no. 7390, September 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7390.
Conclusion
This article covered ERC7390, which proposes a flexible mechanism using ERC1155 to enable fractional option purchases and transfers to other users. I hope it was helpful.
If you have any questions, feel free to contact me by direct message on Twitter.
I also publish content on the following platforms.



