# What is OptSwap?

OptSwap is a **DEX & AMM** for **Cryptocurrency Options and Spreads**.

The Core features are:

* Order Book based Options Decentralized Exchange (DEX).
* Options Automated Market Maker (AMM).
* Decentralized Price Meta Oracle for Real-Time Options Pricing and Settlements.
* Decentralized Autonomous Organization (DAO) Governance.
* Fully Collateralized, On-Chain, Open, Public, Transparent and Non-Custodial.

The OptSwap Protocol is governed by a DAO which conducts on-chain voting and execution of proposals put forward by the Community.

{% hint style="warning" %}
There are multiple risks associated with trading options including the partial or total loss of the margin or premium paid! Please read all the [Risk Warnings](/other/risk-warnings) before using OptSwap.
{% endhint %}

## Getting Started

### Quick Start Guides

Follow these handy guides to get started immediately:

{% content-ref url="/pages/m0wyeQ6g6e6hc6rgA7sh" %}
[Concepts & Definitions](/quick-start/concepts-and-definitions)
{% endcontent-ref %}

{% content-ref url="/pages/YssUqTA3d1cj6cgv74O5" %}
[Making Your First Trade](/quick-start/making-your-first-trade)
{% endcontent-ref %}

{% content-ref url="/pages/jZoS1MNyIgedDJCYhjo9" %}
[Managing Your Orders](/quick-start/managing-your-orders)
{% endcontent-ref %}

{% content-ref url="/pages/qVZa5XhnqEXHxUufNJAA" %}
[Managing Your Positions](/quick-start/managing-your-positions)
{% endcontent-ref %}

### Core Features

Dig deeper into OptSwap to understand the protocols advanced features:

{% content-ref url="/pages/z7bKxT96d6DHq0Ai4MQG" %}
[Trading](/user-manual/trading)
{% endcontent-ref %}

{% content-ref url="/pages/LzWVlCmTD7KvK3AqwgYr" %}
[Settlements](/user-manual/settlements)
{% endcontent-ref %}

{% content-ref url="/pages/FiauYvmg2Prr3HJoESrL" %}
[Meta Oracle](/user-manual/meta-oracle)
{% endcontent-ref %}

{% content-ref url="/pages/u77FYatC7vp3FkTK3hB6" %}
[Governance](/user-manual/governance)
{% endcontent-ref %}

### Developers

The Technical Reference section has details about the Smart Contract & Subgraph APIs:

{% content-ref url="/pages/iFjxOgIpkg03TP64iZUX" %}
[Technical Reference](/technical-reference/api-overview)
{% endcontent-ref %}

## 🚧 Under Construction 🏗

Please note that work on this documentation is still in progress, and many sections are in various stages of completion. Please bear with us as we finish all sections of the User Manual and Technical Reference.

If you need immediate help or assistance with anything, feel free to reach out to us via chat or social media and someone will get back to you as soon as possible.


# Concepts & Definitions

"An investment in knowledge pays the best interest." — Benjamin Franklin

Before we begin, it's important that you familiarize yourself with all the basic terminology associated with using OptSwap. This way, you can better understand the rest of the documentation and communicate well with your peers.

We recommend bookmarking this page and referring back to it as needed in the future until it all becomes second nature to you.

Let's talk shop...

### ⛓ Blockchain

A Blockchain is a distributed database network which stores data in a growing list of records, called blocks, that are securely linked together using cryptography. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data.

As each block contains information about the previous block, they form a chain or "blockchain," with each additional block reinforcing the ones before it. Therefore, blockchains are highly resistant to modification of their historical data.

Once finalized, the transactions in any given block cannot be altered retroactively without invalidating all subsequent blocks. Invalid blocks are automatically rejected by network miners or validators and a bad actor may bear an economic cost associated with their actions.

### 🟠 Cryptocurrency 🔷

A Cryptocurrency, or Crypto Token, or Crypto Assset, is a digital asset designed either as a store of value, medium of exchange or utility token through a computer network that is not reliant on any central authority, such as a government or bank, to uphold or maintain it.

The first fully decentralized cryptocurrency was Bitcoin, which first released as open-source software in 2009. Another example is Ethereum, released in 2015, which has smart contract functionality that allows decentralized applications to be run on its blockchain.

### 🏛 Decentralized Autonomous Organization (DAO)

A Decentralized Autonomous Organization (DAO) is an organization constructed by rules encoded as a smart contract that is transparent and governed by the organizations members. A DAOs financial transaction records and program rules are maintained on a blockchain. It differs from traditional corporations in the sense that its existence is completely on-chain, open and governed by immutable smart contracts and rules.

### 💹 Decentralized Finance (DeFi)

Decentralized Finance (DeFi) is the philosophy and practice of recreating, reinventing or extending Traditional Finance (TradFi) concepts, instruments and transactions on the blockchain using smart contracts without the need for any intermediaries or third parties. DeFi protocols utilize on-chain smart contracts to automate financial tasks and to enforce financial rules & obligations.

Examples of important DeFi applications include cash/spot exchanges (Uniswap/Curve), perps/margin exchanges (dYdX/GMX), borrowing & lending markets (Aave/Compound), cross-chain bridges & messaging (Wrapped Bitcoin/Axelar), collateralized debt positions (MakerDAO), synthetic assets (Synthetix), on-chain oracles (Chainlink/Tellor) and prediction markets (Pancakeswap/Polymarket), amongst many others.

DeFi is a nascent industry and is evolving very fast. It holds huge potential reducing tranasction costs and improving market efficiencies through smart contracts & automation. However, there are many known and unknown risks associated with DeFi and this is an ongoing field of research.

### 📝 Options

An Option is a financial instrument or derivative contract between two parties which grants the owner (the buyer or holder) the right, but not the obligation, to buy or sell an underlying asset at a specified strike price on or before a specified date.

Options are themselves a form of asset and have a valuation that depends upon a complex relationship between the option type & style, underlying asset value, time remaining until expiration, market volatility, benchmark interest rates and expected dividend yield, if any.

### 📈 Call Option

A Call Option grants the owner (the buyer or holder) the right, but not the obligation, to buy an underlying asset at a specified strike price on or before a specified date. The Call Option Writer (seller) is obliged to sell the underlying asset to the option owner on or before the specified date if the price of the underlying asset is above the strike price.&#x20;

### 📉 Put Option

A Put Option grants the owner (the buyer or holder) the right, but not the obligation, to sell an underlying asset at a specified strike price on or before a specified date. The Put Option Writer (seller) is obliged to buy the underlying asset from the option owner on or before the specified date if the price of the underlying asset is below the strike price.

### 💰 Moneyness

The Moneyness of an option refers to whether the price (current market price for unexpired options or the settlement price for expired options) of the underlying asset is above or below the option contracts strike price.

A call option is said to be "In-The-Money" (ITM) if the price of the underlying asset is above the strike price, or "Out-of-The-Money" (OTM) if the price of the underlying asset is below the strike price.&#x20;

A put option is "In-The-Money" if the price of the underlying asset is below the strike price; or "Out-of-The-Money" if the price of the underying asset is above the strike price.

If the price of the underlying asset and strike price are exactly the same, the call/put option is said to be "At-The-Money" (ATM).

### 🇪🇺 European & 🇺🇸 American Style Options

A European style option limits settlement only to its expiration date. A buyer would not be able to exercise the option early or take delivery of or sell the underlying asset. Instead, the call or put action will only take place on the date of expiration of the option.

An American style option, on the other hand, can be exercised at any time up to and including the date of expiration providing more flexibility to the buyer, but at a slightly higher cost. The names of these two styles of options should not be confused with the geographic location as the name only signifies the right of execution.

### 🔀 Option Spreads

An Option Spread involves the simultaneous buying and selling of options of the same type (i. e. either puts or calls) and expiry, but at different strike prices. These are also known as Vertical Spreads. The term "vertical" comes from the position of the strike prices which are one above or below another.

This is in contrast to a "horizontal", or Calendar Spread, which is the simultaneous purchase and sale of the same option type with the same strike price, but with different expiration dates.

Spreads may be Net Debit or Net Credit. Vertical and calendar spreads may also be combined for esoteric multi-legged strategies. Examples of spreads include Bull Call Spreads, Bear Put Spreads and Iron Condors.

### 🧮 Option Chain

An Option Chain, also known as an option matrix, is a listing of all available options contracts for a given underlying asset. It shows all listed options contracts, strike prices, volume and pricing information for a single underlying asset for a given expiration time. The chain will typically be categorized by expiration date and segmented by calls vs. puts.

### 👑 Underlying Asset

An Underlying Asset is the actual financial asset upon which an options price is based. Underlying assets give options their value. For example, an option on Bitcoin gives the holder the right to buy or sell Bitcoin at the strike price up until expiration. The underlying asset for this option is the cryptocurrency Bitcoin.

### 💵 Cash Token

The Cash Token is the cryptocurrency in which the option contracts Premium is paid. For example, an option on Bitcoin may be quoted at a Premium of $100 in USD Coin (USDC). The cash token for this option is the stablecoin USDC. Options may optionally also be settled in the cash token after expiration.

The Strike Prices for the options and Strike Price Ranges for spreads are also always denominated in the cash token.

### 🔢 Strike Price

The Strike Price is a pre-agreed price level at which the underlying asset can be bought or sold when the option is exercised on or before expiration. The strike price may also called the exercise price.

For call options, the strike price is where the underlying asset can be bought by the option holder; for put options, the strike price is the price at which the underlying asset can be sold.

Option spreads are represented by a Strike Price Range of two (2) strike prices.

### 📆 Expiration Date & Time

The Expiration Date & Time, also called the Expiry Date, is the last day that the option contract is valid. Trading or exercising the option must be within this given period, which is on or before the expiration date & time depending on the style of the option.

Once the option passes the expiration date & time, the contract can no longer be traded. An expired option should be exercised by the buyer, or settled for cash, if it is In-The-Money. The seller recovers any excess or leftover margin after expiry.

### 🔁 Decentralized Exchange (DEX)

Decentralized Exchanges are an alternative to centralized exchanges. They cut out the middle man, generating a "trustless" (or "trust-free") environment. These types of exchanges function as peer-to-peer exchanges. Assets are never held by a centralized escrow service, and transactions are done entirely based on smart contracts and atomic swaps in a "non-custodial" manner.

### ⚙️ Trustless

Trustless means that you don't have to trust any third party, person, or intermediary that could operate between you and your cryptocurrency transactions or holdings. Trustless systems work and achieve consensus mainly through the code, asymmetric cryptography, and protocols on the blockchain network itself. The trustless environments that blockchains have created enable the peer-to-peer (P2P) sending and receiving of transactions, smart contract agreements, and other complex interactions which cannot operate without it.

### 🗄 Non-Custodial

Non-Custodial means that no third party, person or intermediary holds, or has access to, or can manipulate your cryptocurrency holdings, orders or positions. All the crypto assets are held on the blockchain and are controlled directly by the smart contracts which are governed by software code. Only the rightful owners can trade, settle and withdraw their own funds.

### 📖 Order Book

An Order Book is an electronic list of buy and sell orders for a specific option organized by price levels. The order book lists the number of lots/contracts being bid on or offered at each price point, a. k. a. the market depth or market quotes. The order book helps traders make business decisions and improves market transparency because they provide actionable trading information.

### 🧾 Limit Order

A Limit Order is an instruction to buy or sell a specific option contract at no more or less than a particular price point. This gives the trader control over the price at which the trade is executed; however, the order may never be executed or filled. Limit orders are used when the trader wishes to control price rather than certainty of execution.

### 📚 Batch Order

A Batch Order constitutes two or more limit orders which are combined together and sent to the decentralized exchange as a single blockchain transaction. The batch order may be instructed to be executed or filled partially or fully. This allows traders to be guaranteed execution of all limit orders within the batch, reduce slippage and save on transaction time and costs.

### 🔣 Fill Types

The decentralized exchange may not be able to completely execute or fill a limit order at a particular price and/or at a given point in time due to the unavailability of counterparties. In such cases, the order is said to be "unfilled" or "partially filled." Traders have the ability to specify whether they want to allow their orders to be partially filled or not by choosing the Fill Type.

The "Limit" fill type allows orders to remain unfilled or partially filled and sit on the order books as a maker order. The "All-or-None" fill type enforces that all the orders within a batch are either "completely filled" or "fully reverted" as though the batch order was never sent. This allows traders to be guaranteed execution of all limit orders within the batch which is highly relevant and useful for advanced multi-legged strategies.

### 🤖 Automated Market Maker (AMM)

An Automated Market Maker is a smart contract, or computer program, that allows for matching buy and sell orders automatically, based on preset criteria, without the need for any intermediary. There are many different types of AMMs with varying implementations.

OptSwaps AMM is highly specialized and focused on options and option spreads. It is designed to work with the DEXs on-chain order book in a seamless manner. This is achieved by traders instructing the AMM to process and execute their managed orders only if a counterparty matching specific criteria is also available to trade against; and recalculating the premiums and execution risk criteria on-demand using real-time market data.

### ↕️ Managed Order

A Managed Order is a special type of options order containing instructions for the AMM to execute or fill it only if the specified Risk Criteria are met. The risk criteria are specified as ranges of strike prices, expiries, premiums, implied volatilities and options greeks for the options contracts that the trader wants to buy or sell.

Instead of specifying a specific price point to buy or sell at (which can vary from one second to another based on market conditions) the trader defines the risk criteria in advance and the AMM buys or sells the options on behalf of the trader, if and only if a counterparty also matching the specified risk criteria is available to trade against at that given point in time.

### 📦 Lot Size & Lots

The Lot Size, or Contract Size, is the number of units of the underlying asset that a single option contract controls. For example, the typical lot size for stocks is one hundred (100) shares per option contract. However, the lot size for different types of options or underlying assets may vary and can be any number (within practical limits). The lot size is fixed for any option contract and does not change during the lifetime of the option.

Lots, or Number of Contracts, is the number of options contracts that the trader wants to buy or sell. Options must be bought or sold in multiples of one (1) lot. Lots cannot be divided or traded fractionally.

### 💸 Option Premium

The Option Premium is the current market price of an option contract and the amount paid by the buyer of the option. It is the income received by the seller of an option contract. In-The-Money option premiums are composed of two factors: intrinsic and extrinsic value. Out-of-The-Money options premiums consist solely of extrinsic value.

The premium is always quoted in cash tokens per unit of the underlying asset. The total amount of premium to be paid, in cash tokens, by the buyer can be calculated using the formula:\
\
`Total Amount = Lot Size × Lots × Option Premium`

### ⚖️ Intrinsic Value

The Intrinsic Value of an option contract before expiration is the difference between the strike price and the current market price of the underlying asset. For an expired option contract, the intrinsic value is the difference between the strike price and settlement price (at expiration) of the underlying asset.

A call option has intrinsic value if the market/settlement price is higher than the strike price. A put option has intrinsic value if the market/settlement price is lower than the strike price.

### 🍃 Extrinsic Value

The Extrinsic Value of an option is the value that is assigned to an option by factors other than the intrinsic value. There are many factors which affect the extrinsic value including the time remaining until expiration, implied volatility, spot price of the underlying asset, benchmark interest rates and expected dividend yield, if any.

Extrinsic value is also sometimes called Time Value because the time remaining until expiration is one of the primary factors affecting the option premium.

### 📊 Implied Volatility (IV)

Implied Volatility (IV) is the markets forecast of the likelihood and amplitude of a price change in the underlying asset. It is defined as the one standard deviation (1SD) expected move in a year.

IV is used to price options contracts where high implied volatility results in options with higher premiums and vice versa. IV usually increases in bearish markets and decreases when the market is bullish, but this isn't always the case. IV helps in quantifying market sentiment and uncertainty. It is affected by the price history and future price expectations of the underlying asset.

### 🔋 Options Greeks

The Options Greeks are symbols assigned to the various risk characteristics or factors that the price of an options contract is subject to. The most common options greeks used are the first partial derivatives of the options pricing model:

* Delta (Δ): Measures the change of an options price when the underlying assets price changes by $1 (or one unit of the cash token). The delta value is a fractional number between -1 to +1. It is always positive for call options (0 to +1) and negative for put options (-1 to 0). When traders refer to "10 delta" options, they are actually referring to call/put options with a ±0.10 delta value. In this case, the absolute delta value is just multiplied by a factor of 10 for ease of verbal communication. The delta may also be interpreted as the approximate probability that the option will expire In-The-Money given the market conditions at that point in time.
* Gamma (Γ): Measures the change of the options delta value when the underlying assets price changes by $1 (or one unit of the cash token).
* Theta (ϴ): Measures the change of an options price after the passage of one day (24 hours) assuming no change in the underlying assets price. This accounts for the variation of the options price due to the passage of time.
* Vega (V): Measures the change of an options price when the volatility of the underlying asset increases by 1%.
* Rho (ρ): Measures the change of an options price when the benchmark interest rate increases by 1%.

Greeks are used by options traders and portfolio managers to understand how their positions will behave as time passes and prices move; and to trade or hedge their positions accordingly.

### 💶 Margin

The Margin is the amount of funds that the option writer (seller) has to deposit to guarantee that the option holder (buyer) can exercise the option at expiration if it is In-The-Money. The margin required may be in the form of the underlying asset (for call options) or cash tokens (for put options and option spreads).

### 🦺 Margin Minimums

Margin Minimum refers to the minimum amount of margin that the option writer (seller) has to deposit to cover an option spread position. For example, writing/selling a one hundred (100) point option spread will require a minimum margin of $100, or 100 units of cash tokens. Writing/selling a five hundred (500) point option spread will require a minimum margin of $500, or 500 units of cash tokens, and so on.

### 🌟 Margin Discounts

The option writer (seller) is eligible to avail a Margin Discount when they simultaneously take on two opposing positions in such a way that only one position is guaranteed to expire In-The-Money. Such a combination of positions is said to be "Hedged," "Non-Directional" and "Multi-Legged." The margin discount will be equal to the margin minimum of the shortest leg. Examples of non-directional multi-legged strategies which avail a margin discount are Iron Condors, Iron Butterflies and Box Spreads.

### 📌 Position

A Position is an option contract that is still open between a buyer and seller, i. e. it has not yet been settled or traded out or closed. When an option contract is open, the position is reflected on both the buyers and sellers accounts. The position may be closed by either the buyer or seller by trading it out in the market to another buyer or seller, or to the original counterparty.

An In-The-Money position may be exercised by the buyer or settled for cash after expiration. A position may become worthless for the buyer if it is Out-of-The-Money at expiration; or a put option seller if the price of the underlying asset crashes to zero.

### ↗️ Open Interest (OI)

Open Interest (OI) is the total number of lots of open positions, or outstanding options contracts, that have not yet been settled or traded out. OI is equal to the total number of bought or sold options contracts that are still open on the market, and not the total of both added together or the total volume. Increasing open interest represents funds coming into the market while decreasing open interest indicates money flowing out of the market.

### ↔️ Settlement/Exercise

Option Settlement, or Option Exercise, refers to the final transaction between the buyer and seller, when both parties close their respective positions and exchange the underlying asset for cash tokens or vice versa at the pre-agreed strike price(s). Settlement can occur only after expiration for European style options, but may be triggered at any time by the buyer for an American style option if it is In-The-Money. Settlements can also occur purely in cash tokens in which case the option is said to have been "Cash Settled". Option spreads are always cash settled.

### 🔄 Liquidity Pool

A Liquidity Pool is a smart contract containing equal (or unequal) amounts of two (or more) different tokens which enables swapping facilities from one token to the other. Traders pay a small fee to the liquidity pool for each swap which is distributed pro-rata to all the liquidity providers who participated in the swap in proportion to their contribution. The swaps are fulfilled without the need for any intermediary or third party. Uniswap V2/V3 liquidity pools also serve as price and liquidity oracles for both the tokens in the pair.

### 🌊 Liquidity

In DeFi, Liquidity refers to the total amount of funds locked in the liquidity pool available for swapping. The liquidity is the total amount of each token in the pair.

In Uniswap V2 liquidity pools, the liquidity is equally and symmetrically distributed in value between the two tokens (50% each). In Uniswap V3 liquidity pools, the liquidity may be unequally or asymmetrically distributed in value between the tokens.

Since the amount of liquidity in a pool affects the slippage, it directly affects the ease and efficiency with which one token can be converted into the other token without affecting its market price within the liquidity pool. Higher liquidity results in lower slippage and vice versa.

### 🔮 Oracle

In blockchain parlance, an Oracle is a smart contract that provides any sort of information or data about on-chain or off-chain events which can be programmatically utilized by other smart contracts to perform some operations. The most common type of data provided by oracles are market related information such as token prices or exchange rates and liquidity.

### 🧙‍♀️ Meta Oracle

A Meta Oracle is an oracle that collates and provides information or data about other oracles. Specifically, in our case: The OptSwap Meta Oracle is a smart contract that observes and retains historic data snapshots of Uniswap V2/V3 oracles (liquidity pools); and is capable of providing current and historic Liquidity & Time Weighted Average Prices (LTWAPs) for any arbitrary token pair. It also supports price aggregation for multiple time durations and observing any untracked Uniswap V2/V3 liquidity pools.

### 🎱 Spot Price

Spot Price refers to the market price at which an asset was bought or sold, or can be bought or sold, at a particular place and time. The spot price is a critical input for pricing options contracts. Based on the current spot price of the underlying asset, traders are able to make projections about the future price movements of both the underlying asset and associated options contracts.

### 🎈 Settlement Price

The Settlement Price is the price level at which an option contract will be exercised by the buyer or cash settled at expiration. The settlement price is determined based on the Liquidity & Time Weighted Average Price (LTWAP) of the underlying asset over the past four (4) hours or 240 minutes.

This ensures that the price levels at which the options expire represents the Fair Market Value of the underlying asset and is highly resistant to instantaneous price manipulations towards the last few minutes or seconds. The settlement price may not match the spot price at the time of expiration due to the liquidity & time weighting mechanisms involved.

### ⏱ Time Weighted Average Price (TWAP)

The Time Weighted Average Price (TWAP) is the average price at which an asset was bought or sold over a specified period of time, called the TWAP Duration. It is said to be "time weighted" because each instantaneous price level over the observed duration is weighted by the amount of time that particular price level existed in the pool.

In general, for large pools over longer periods of time, with no chain congestion, the TWAP is highly resistant to manipulation attacks and represents the on-chain Fair Market Value of the asset over the specified duration.

### 🧩 Liquidity & Time Weighted Average Price (LTWAP)

The Liquidity & Time Weighted Average Price (LTWAP) is determined by observing the TWAP across multiple liquidity pools and weighting them by the amount of liquidity contained in each respective pool. Since each pool may contain a different amount of liquidity and have slightly different TWAPs, the LTWAP represents a blended on-chain Fair Market Value of the asset. It also protects against any single liquidity pool being potentially manipulated from significantly altering the final settlement prices.

### 🙆‍♂ Maker & Taker 🙋‍♂️

A Maker is a trader whose buy or sell order sits unfilled or partially filled on the order books waiting for a counterparty. A maker is said to be providing or adding liquidity to the market to "make" trades happen.

A Taker is a trader whose buy or sell orders are matched against a maker to partially or completely fill one or both orders. A taker is said to be removing or "taking" liquidity off the market while having their order filled.

A taker can also become a maker if their order gets partially filled and the remaining lots sit unfilled on the order book for subsequent takers to trade against. In such cases, the trader is a taker for the first part of the order and a maker for the second part.

Every trade involves exactly one maker and one taker. A single order may result in one or more trades against one or more counterparties.

### 💷 Fees

Fees are the portion of funds paid by users to the protocol or validators/miners for facilitating the trades and settlements to occur. Maker & Taker Fees are based on the premiums traded and are always denominated in cash tokens. The Settlement Fee is based on the total value of the underlying asset to be settled for the option contract and may be paid in the underlying asset or cash tokens depending on the type of position being settled.

Position Conversion Fees are paid by the seller to convert their unlocked positions to locked positions and avail margin minimum benefits based on the margin benefit discount/refund. The Execute Caller Fee is always denominated in OptSwap DAO governance tokens. Gas Fees are denominated in the networks native asset or gas token.

All the fees, except gas fees, are variable and set by on-chain DAO governance proposals. Gas fees are determined by prevailing network conditions.

### 🔂 Staking

Staking refers to the process of temporarily locking up assets or tokens in a smart contract in exchange for rewards of some kind. Staking is the process by which one can potentially earn a yield or return on their staked assets or tokens.


# Making Your First Trade

"The market can stay irrational longer than you can stay solvent." — John Maynard Keynes

{% hint style="info" %}
The screenshots in this walkthrough are based on the **Optimism (Sepolia) Testnet** network. To follow along, head over to our [Testnet Faucet](https://testnet.optswap.org/community/faucet) and grab yourself some Mock Tokens. To get the native asset (ETH) on Optimism (Sepolia) Testnet, visit one of the publicly available [OP Sepolia Faucets](https://docs.optimism.io/builders/tools/build/faucets) and follow their respective instructions.
{% endhint %}

In this guide, we will cover the following topics:

1. Connecting to OptSwap
2. Understanding the Option Chain screen
3. Buying a Bitcoin Call option
4. Selling an Ethereum Call option

### I. Connecting to OptSwap

#### 1. Install MetaMask & fund your Wallet

Download & install the Metamask extension for your browser from the official source: <https://metamask.io>

You will need to fund your wallet with some native asset (ETH) for paying gas fees to the network, as well as the appropriate underlying assets and/or cash tokens for the markets you want to trade in. To get ETH on the Optimism (Sepolia) Testnet, visit one of the publicly available [OP Sepolia Faucets](https://docs.optimism.io/builders/tools/build/faucets) and follow their respective instructions

If you want to first get some practice by paper-trading on the testnet networks, head over to the [Testnet Faucet](https://testnet.optswap.org/community/faucet) to grab some Mock Tokens.

#### 2. Connect your Wallet to the dApp

Click the "Connect Wallet" button and choose your MetaMask Account that you want to connect with OptSwap. Click the "Next" button and "Connect" button on the subsequent confirmation screen.

<figure><img src="/files/PeMEGv4bOD0PQLFwwiTo" alt=""><figcaption><p>Connect Wallet to OptSwap</p></figcaption></figure>

<figure><img src="/files/Coqrvy4ZKAJblFcIrgBW" alt=""><figcaption><p>Select MetaMask Wallet Account</p></figcaption></figure>

You should now be connected to OptSwap. Your public address and balances will be displayed on the top-right of the screen.

✅ Done! You are now connected and can begin trading on OptSwap.

### II. Understanding the option chain

<figure><img src="/files/pMAtnD5bYkh8ZbsGohSP" alt=""><figcaption></figcaption></figure>

#### 1. The Strike Prices

All the strike prices are listed in the center column in ascending order. The option chain is usually centered around the current market price of the underlying asset.

#### 2. Calls & Puts

All the call options details are on the left-hand side of the strike prices column and the put options details are on the right-hand side.&#x20;

The call options with a strike price below the underlying assets current market price, and put options above the market price, are In-The-Money and have a shaded background. Out-of-The-Money options will not have a shaded background.

#### 3. Default Columns

The option chain displays the following default columns for the calls & puts respectively:

* **LTP (% CHG) – Last Traded Price & percentage change:** The price at which the option contract was last traded and the percentage price change from 24-hours ago.
* **BID (QTY) – Bid Price & Quantity:** The best price and number of lots (contracts) that the buyers are bidding at.
* **ASK (QTY) – Ask Price & Quantity:** The best price and number of lots (contracts) that the sellers are asking for.
* **BID IV & ASK IV:** The computed Bid and Ask Implied Volatility (IV) values respectively.
* **OI (% CHG) – Open Interest (OI) & percentage change:** The current open interest for the option contract and the percentage change from 24-hours ago.

#### 4. Action Buttons

Towards the extreme left & right of the option chain, you will see a few buttons to perform various actions on the calls and puts respectively:

* **⨁ – Add New Columns (header):** Clicking this in the table header will reveal additional columns that may be added containing advanced metrics and options greeks.
* **"B" – Buy Limit Order:** Clicking this will open the Limit Order form to buy a call or put option directly on the DEX.
* **"S" – Sell Limit Order:** Clicking this will open the Limit Order form to sell a call or put option directly on the DEX.

Hovering over these will reveal more options:

* **"B 🤖" – Buy Managed Order:** Clicking this will open the Managed Order form for the AMM to buy a call or put option on your behalf.
* **"S 🤖" – Sell Managed Order:** Clicking this will open the Managed Order form for the AMM to sell a call or put option on your behalf.
* ![](/files/lUOF76qWh4R534USImkl) **Add to Watchlist:** Clicking this will add this particular option contract to your watchlist.
* ![](/files/jn0oLvRXJJUvHSHOgrCu) **Market Depth & Chart:** Clicking this will open the market depth (order book depth) and that specific options chart.

<figure><img src="/files/wTfMWZM1fnj4kGob3j6X" alt=""><figcaption><p>Additional Action Buttons (On Hover)</p></figcaption></figure>

#### 5. Network & Graph Health Indicator

The footer contains the network and graph health indicator. Ideally, this should be green indicating that the subgraph and your RPC connection are healthy and receiving up-to-date information from the blockchain. If not, you may see a warning that the data is not in-sync.

✅ Great! You should now be able to see and understand what the market is currently doing. Let's do some trading.

### III. Buying a Bitcoin Call option

So, you're bullish on Bitcoin and want to buy a call option...

#### 1. Choose the WBTC-USDC market.

<figure><img src="/files/cZUuEwXajQoEzetzTRyU" alt=""><figcaption><p>Choose Token Pair</p></figcaption></figure>

#### 2. Set the option style, lot size and expiry.

<figure><img src="/files/TNGqLM6WTViNwTVg73aT" alt=""><figcaption><p>Option Contract Specifications</p></figcaption></figure>

#### 3. Select your strike price.

In this example, we will choose the **61000** Strike.

<figure><img src="/files/2qt9awkEUar2xvjAlZbT" alt=""><figcaption><p>Option Type and Strike Selection</p></figcaption></figure>

#### 4. Click the "B" (Buy) button and enter the number of lots to buy & premium you're willing to pay. Approve the cash tokens for the total premium.

<figure><img src="/files/NBmoqt8791Pk57uMKkPh" alt=""><figcaption><p>Buy BTC 61000 Call Option</p></figcaption></figure>

#### 5. Click the "Buy" Button and confirm the order in your wallet.

<figure><img src="/files/MNo8OJnZi0sZmVc9vGMt" alt=""><figcaption><p>Confirm Order in wallet</p></figcaption></figure>

#### 6. Wait for the confirmation from the blockchain.

<figure><img src="/files/UbIoa45GuGqtkxIPi975" alt=""><figcaption><p>Order Confirmed on Blockchain</p></figcaption></figure>

✅ Congratulations! You just bought a Bitcoin call option. The process of buying put options, which offer downside protection, is very similar! Next, we will sell an Ethereum call option.

### IV. Selling an Ethereum Call option

So, you have some Ethereum and want to earn income selling covered calls -- perhaps to cover some of the cost of that Bitcoin call option you just bought. The steps are quite similar except that you need to post ETH as margin for the short call option.

#### 1. Choose the ETH-USDC market.

#### 2. Set the option style, lot size and expiry.

#### 3. Select your strike price.

In this example, we will choose the 2700 Strike.

<figure><img src="/files/e3BsEexcyAPVPf5huN3a" alt=""><figcaption><p>Option Type and Strike Selection</p></figcaption></figure>

#### 4. Click the "S" (Sell) button, enter the number of lots to sell & premium you expect to receive.

<figure><img src="/files/pLNaVffv863mb9V0codd" alt=""><figcaption><p>Sell ETH 2700 Call Option</p></figcaption></figure>

#### 5. Since the native asset (ETH) is the underlying asset, no additional ERC-20 token approvals are needed. Confirm the order in your wallet.

#### 6. Wait for the confirmation from the blockchain.

✅ Nice! You just sold an Ethereum call option. The process of selling a put option is very similar, except that your margin will be denominated in cash tokens (USDC) instead!

### Further reading

{% content-ref url="/pages/jZoS1MNyIgedDJCYhjo9" %}
[Managing Your Orders](/quick-start/managing-your-orders)
{% endcontent-ref %}

{% content-ref url="/pages/qVZa5XhnqEXHxUufNJAA" %}
[Managing Your Positions](/quick-start/managing-your-positions)
{% endcontent-ref %}

{% content-ref url="/pages/ki9QMhWd1ZSjETdszxuh" %}
[Advanced Order Types](/user-manual/trading/advanced-order-types)
{% endcontent-ref %}

{% content-ref url="/pages/VluYxAELVWyPSKIz0mO0" %}
[Automated Market Maker (AMM)](/user-manual/trading/automated-market-maker-amm)
{% endcontent-ref %}


# Managing Your Orders

"Amateurs think about how much money they can make. Professionals think about how much money they could lose." — Jack Schwager

In this guide, we will cover the following topics:

1. Understanding the Orders screen
2. Modifying your order
3. Cancelling your order

### I. Understanding the Orders screen

<div><figure><img src="/files/m3ZPgVMjEkGSoYJwjV4k" alt=""><figcaption><p>Open Orders Screen</p></figcaption></figure> <figure><img src="/files/ISgESefmmCnHyguBOOIK" alt=""><figcaption><p>Order Status Filter</p></figcaption></figure></div>

#### 1. Order Filters

The topmost section contains filters which can be used to shortlist your Limit Orders based on Full Options or Spreads, specific Underlying-Cash Pairs, Option Types (Calls/Puts) or other contract specifications such as Option Style, Lot Size & Expiry Date.

#### 2. Open Orders

Any limit orders which are still open on the books will be displayed below the filters. The total number of open lots will be displayed in the "Open" column. These may be partially filled or not filled at all. The number of lots filled will be displayed in the "Fill" column.

You may modify or cancel your order by clicking the appropriate button in the row as long as it remains partially or completely unfilled.

#### 3. Complete or Cancelled Orders

Limit orders which have been completely filled or cancelled will be displayed below the open orders. You can create a new order with the same parameters by clicking on the "Repeat Order" button.

### II. Modifying your order

Open orders that are still unfilled may be modified by clicking on the "Modify" button. The number of lots and premium may be changed, but all the other paramters will remain the same. Confirm the modification in your wallet once you are happy with the new values.

### III. Cancelling your order

Open orders that are still unfilled may be cancelled by clicking on the "Cancel" button. Any premium or margin on-hold will be refunded immediately. Confirm the cancellation in your wallet after clicking the "Cancel" button.

<figure><img src="/files/s7J7ffYpmUdq2hUoKZD2" alt=""><figcaption><p>Modify or Cancel Order</p></figcaption></figure>

### Further Reading

{% content-ref url="/pages/qVZa5XhnqEXHxUufNJAA" %}
[Managing Your Positions](/quick-start/managing-your-positions)
{% endcontent-ref %}

{% content-ref url="/pages/ki9QMhWd1ZSjETdszxuh" %}
[Advanced Order Types](/user-manual/trading/advanced-order-types)
{% endcontent-ref %}

{% content-ref url="/pages/VluYxAELVWyPSKIz0mO0" %}
[Automated Market Maker (AMM)](/user-manual/trading/automated-market-maker-amm)
{% endcontent-ref %}


# Managing Your Positions

"If I have positions going against me, I get right out; if they are going for me, I keep them." — Paul Tudor Jones

In this guide, we will cover the following topics:

1. Understanding the Positions screen
2. Adding or Exiting Positions
3. Settlement by Physical Delivery – settling the underlying asset&#x20;
4. Settlement by Cash – settling cash via a swap

### I. Understanding the Positions screen

<figure><img src="/files/DPd5PGLdBvBqvS1alLIO" alt=""><figcaption><p>Open Positions</p></figcaption></figure>

#### 1. Position Filters

You can use various filters to shortlist your positions across markets and specific contracts.

#### 2. Open Positions

The list of open positions are displayed along with the average entry price, current mark-to-market plus bookedf profits & losses and other relevant contract information.

#### 3. Position Actions

Depending on the type of position and whether it's expired or not, the various possible actions are displayed allowing you to Add, Reduce or Exit your positions. You can also choose to create a managed order via the AMM.

Expired positions will have a different set of actions compared to Open positions (shown below.)

### II. Adding or Exiting Positions

Clicking the "Add" button allows you to increase the number of lots you have bought or sold. Clicking "Exit" allows you to reduce the number of lots bought or sold and close your position in a single order.

### III. Underlying/Physical Delivery

After the options contracts have expired, a different set of actions ("Settlement Actions") are possible, allowing the buyer to exercise the underlying asset or settle with the cash token.

<figure><img src="/files/pikMG4LyVcAzCyqLwsr1" alt=""><figcaption><p>Expired Positions Actions</p></figcaption></figure>

Clicking "Exercise" allows for physical settlement of the underlying asset. In this case, the buyer is required to deposit 5600 USDC to settle a 0.1 WBTC long 56000 call option.

<figure><img src="/files/Y6LfGB0L6qST5rCQN3Wj" alt=""><figcaption><p>Exercise 0.1 WBTC 56000 Call Option</p></figcaption></figure>

### IV. Cash Settlement with Swap

Alternatively, the underlying asset (WBTC) can be partially encashed to settle the In-The-Money amount for the option by clicking "Partial Encash" or "Cash Settle."

In this case, the option seller's underlying asset margin is partially swapped into the required settlement amount which is sent to the buyer. The remaining margin amount is refunded to the seller who can subsequently withdraw it from the DEX.

<figure><img src="/files/mmAhEicJFDIhmLqf9BbD" alt=""><figcaption><p>Cash settlement after partially swapping the underlying asset for cash</p></figcaption></figure>

### Further Reading

{% content-ref url="/pages/uoSoiNlMxwh54hlL95SM" %}
[Exercise Option](/user-manual/settlements/exercise-option)
{% endcontent-ref %}

{% content-ref url="/pages/sjc8ddqp05i6r9kNXKZL" %}
[Force Cash Settlements](/user-manual/settlements/force-cash-settlements)
{% endcontent-ref %}

{% content-ref url="/pages/HnnVZO75XPx0NWXtNrMn" %}
[Recover Margin](/user-manual/settlements/recover-margin)
{% endcontent-ref %}

{% content-ref url="/pages/QHWQf4Ec7ooTiulkIE4V" %}
[Automated Settlements](/user-manual/settlements/automated-settlements)
{% endcontent-ref %}


# Trading

"Only the game can teach you the game." — Jesse Livermore

OptSwap provides users with a number of tools to trade quickly and efficiently on-chain. It is important to understand how each of them works so that the various advanced order types and settings can be utilized correctly.

In general, all limit orders and trades are always matched on the Decentralized Exchange (DEX). The Automated Market Maker (AMM) manages orders on your behalf by constantly re-pricing the options contracts based on your pre-defined risk criteria until a counterparty is available who is willing to trade at the latest price.

Batch Orders allow traders to post multiple orders as part of a single transaction; and can ensure that all orders within the batch are either completely filled or the whole batch gets reverted. This is useful for option spread traders who want to be guaranteed the complete fill of all the legs within an advanced multi-legged strategy.

{% hint style="info" %}
Buying options requires paying the premium denominated in cash tokens. Selling options requires posting the margin, which may be denominated in either the underlying asset or cash tokens depending on the option type. Spreads are always cash settled.
{% endhint %}

### Topics

{% content-ref url="/pages/CczZbhpIfC5nXuu1dqq6" %}
[Limit Orders](/user-manual/trading/limit-orders)
{% endcontent-ref %}

{% content-ref url="/pages/BhhoWdWgErKwctiLSgvL" %}
[Option Spreads](/user-manual/trading/option-spreads)
{% endcontent-ref %}

{% content-ref url="/pages/ki9QMhWd1ZSjETdszxuh" %}
[Advanced Order Types](/user-manual/trading/advanced-order-types)
{% endcontent-ref %}

{% content-ref url="/pages/VluYxAELVWyPSKIz0mO0" %}
[Automated Market Maker (AMM)](/user-manual/trading/automated-market-maker-amm)
{% endcontent-ref %}

{% content-ref url="/pages/h6d7JhRpL9aTMzkK8Jsb" %}
[Modify & Cancel Orders](/user-manual/trading/modify-and-cancel-orders)
{% endcontent-ref %}

{% content-ref url="/pages/m42LcVUO4OQv3STEYQxZ" %}
[Positions](/user-manual/trading/positions)
{% endcontent-ref %}

{% content-ref url="/pages/enjj3UTr9LUoAt1P1g1O" %}
[User Accounts](/user-manual/trading/user-accounts)
{% endcontent-ref %}

{% content-ref url="/pages/P7HSna0uRRzNS0FvrZ46" %}
[Options Oracles](/user-manual/trading/options-oracles)
{% endcontent-ref %}

{% content-ref url="/pages/upOm6LSM4WSmozG4yn5j" %}
[Margin Requirements](/user-manual/trading/margin-requirements)
{% endcontent-ref %}

{% content-ref url="/pages/NI3QjLwSDF9lkMExePON" %}
[Fees](/user-manual/trading/fees)
{% endcontent-ref %}


# Limit Orders

TODO

\[Image: Limit Order]

### **Option Contract Specifications**

TODO

### **Order Type**

TODO

### **Order Instruction**

TODO

### **Premium**

TODO

### **Lots**

TODO

### **Memo**

TODO

### **Order Book Index**

TODO

### **Multi-Leg Index**

TODO

### **Order Fill Type**

TODO

### Margin Required

TODO

### **Premium Required**

TODO

### **Slippage**

TODO

### Further Reading

{% content-ref url="/pages/h6d7JhRpL9aTMzkK8Jsb" %}
[Modify & Cancel Orders](/user-manual/trading/modify-and-cancel-orders)
{% endcontent-ref %}

{% content-ref url="/pages/m42LcVUO4OQv3STEYQxZ" %}
[Positions](/user-manual/trading/positions)
{% endcontent-ref %}

{% content-ref url="/pages/VluYxAELVWyPSKIz0mO0" %}
[Automated Market Maker (AMM)](/user-manual/trading/automated-market-maker-amm)
{% endcontent-ref %}


# Option Spreads

TODO

### **Debit vs. Credit Spreads**

TODO

### **Margin Minimums**

TODO

### **Cash-Only Settlements**

TODO


# Advanced Order Types

OptSwap features a number of advanced order types and features for sophisticated options traders.

### Topics

{% content-ref url="/pages/Mv23MSroPz6SVjkIj7Bg" %}
[Batch Orders](/user-manual/trading/advanced-order-types/batch-orders)
{% endcontent-ref %}

{% content-ref url="/pages/z8Zq19qVi9il1arf8q8C" %}
[All-or-None Fill Type](/user-manual/trading/advanced-order-types/all-or-none-fill-type)
{% endcontent-ref %}

{% content-ref url="/pages/DesqSbrggDsqWVgWUrdq" %}
[Multi-Legged Strategies](/user-manual/trading/advanced-order-types/multi-legged-strategies)
{% endcontent-ref %}


# Batch Orders

TODO

### **Limit**

TODO

### **All-Or-None**

TODO


# All-or-None Fill Type

TODO


# Multi-Legged Strategies

TODO

### **Non-Directional Spreads**

TODO

### **Margin Discounts**

TODO

### Converting Positions

To learn more about locking and unlocking options spreads positions to avail margin benefits, read the section about Converting Positions.

{% content-ref url="/pages/zzyGSysVrFjei073zWdc" %}
[Converting Positions](/user-manual/trading/positions/converting-positions)
{% endcontent-ref %}


# Automated Market Maker (AMM)

TODO

### Black-Scholes-Merton (BSM) Pricing Model

TODO

### Limitations & Drawbacks of the BSM Model

TODO

### Overcoming BSM Limitations & Drawbacks

TODO

### Alternative Pricing Models

Implementations of alternative pricing models including the Binomial Option Pricing Model & Bjerksund-Stensland Model will be introduced in future versions of the AMM!

### Topics

{% content-ref url="/pages/uToBHhcZgaoV93ogzK9b" %}
[Managed Orders](/user-manual/trading/automated-market-maker-amm/managed-orders)
{% endcontent-ref %}

{% content-ref url="/pages/jB63YGtztjRymie01bT3" %}
[Aggregated Spot Price](/user-manual/trading/automated-market-maker-amm/aggregated-spot-price)
{% endcontent-ref %}

{% content-ref url="/pages/5GtCmdR7DkzOHCTLwLns" %}
[Liquidity Provider Rewards](/user-manual/trading/automated-market-maker-amm/liquidity-provider-rewards)
{% endcontent-ref %}

{% content-ref url="/pages/Vg4zsOScUTJIDdohB9GF" %}
[Match Finder Rewards](/user-manual/trading/automated-market-maker-amm/match-finder-rewards)
{% endcontent-ref %}


# Managed Orders

TODO

\[Image: Managed Orders]

### **Option Contract Specifications**

TODO

#### **Expiry Range**

TODO

#### **Strike0 Range**

TODO

#### **Strike1 Range**

TODO

### **Order Type**

TODO

### **Order Instruction**

TODO

### **Premium Range**

TODO

### **Lots**

TODO

### **Memo**

TODO

### **Valid Until**

TODO

### Implied Volatility (IV)

TODO

#### Strike0 & Strike1 IV

TODO

### Delta Range

TODO

### Premium Multipliers

TODO

#### In-The-Money & Out-of-The-Money Multiplier

TODO

### Spot Price Aggregation Type

TODO

### Spot Price TWAP Durations

TODO

### Interest Rate

TODO

### Dividend Yield

TODO

### **Margin Required**

TODO

### **Premium Required**

TODO

### **Further Reading**

{% content-ref url="/pages/h6d7JhRpL9aTMzkK8Jsb" %}
[Modify & Cancel Orders](/user-manual/trading/modify-and-cancel-orders)
{% endcontent-ref %}

{% content-ref url="/pages/m42LcVUO4OQv3STEYQxZ" %}
[Positions](/user-manual/trading/positions)
{% endcontent-ref %}


# Aggregated Spot Price

TODO

### Aggregation Types

TODO

### TWAP Durations

TODO


# Liquidity Provider Rewards

TODO -- for AMM Liquidity Providers

### Liquidity Provider Points

TODO

### Liquidity Provider Rewards

TODO


# Match Finder Rewards

TODO -- for OptSwap Miners

### Match Finder Points

TODO

### Match Finder Rewards

TODO

### Further Reading

To learn more, see the section on "AMM: Managed Orders Execution" for the OptSwap Miner.

{% content-ref url="/pages/VmJYeE4DourLoskQjEbd" %}
[OptSwap Miner](/user-manual/governance/optswap-miner)
{% endcontent-ref %}


# Modify & Cancel Orders

TODO -- Orders Screen

### Automatic Order Instruction Selection

TODO -- "To Close" is automatically chosen if you have an option position that you're attempting to exit; special feature of OptSwap -- market makers have the ability to hold both sides of a position simultaneously and settle against themselves at expiry.


# Positions

TODO

### **To-Close Order Instruction**

TODO

### **Exiting Positions**

TODO

### **Delegating Positions to the AMM**

TODO

### **Settling Positions**

TODO

### Locked & Unlocked Positions

TODO

### Converting Positions

To learn more about locking and unlocking options spreads positions to avail margin benefits, read the Converting Positions section.

{% content-ref url="/pages/zzyGSysVrFjei073zWdc" %}
[Converting Positions](/user-manual/trading/positions/converting-positions)
{% endcontent-ref %}


# Converting Positions

TODO

### **Non-Directional Spreads**

TODO -- pair of mutually opposing, max 50% overlapping positions -- i.e. box-spread

### **Locking Positions**

TODO

### **Unlocking Positions**

TODO

### Position Conversion Fees

TODO


# User Accounts

Multi-Currency/Token Accounts are maintained per User per Decentralized Exchange (DEX) and Automated Market Maker (AMM). These contain accrued premiums, settlements and refunds which can be withdrawn by the user at any time.

### My Funds

The current balances can be viewed by clicking the "My Funds" button at the top-right of the screen. This will display the complete breakup of funds denominated by the underlying asset and cash tokens for both the DEX and AMM.

\[Image]

### **Withdrawing Funds**

Users can withdraw their accrued funds at any time by clicking the "Withdraw" button. Since the DEX and AMM are separate smart contracts, funds will need to be separately withdrawn from each. If the user account contains a non-zero balance, the "Withdraw" button will be enabled, and the user will need to confirm the transaction in their wallet.

\[Image]

The funds will be withdrawn to your wallet immediately.


# Options Oracles

The OptSwap DEX itself can serve as an oracle for the options contracts traded on it. The prices of the options contracts are available as the Last Traded Price (LTP) and as the Time Weighted Average Price (TWAP).

While the LTP provides useful information, it should not be utilized directly in smart-contracts as it's subject to instantaneous fluctuations and potential manipulation by bad actors. To overcome this, the prices are aggregated in a price accumulator which can be used to derive the TWAP for a given duration.

{% hint style="warning" %}
Note that the Options LTP/TWAP Oracles for the DEX are optional and are not part of the stock DEXes that are deployed for deploy-time & run-time gas savings. Governance can deploy new contracts with TWAP Oracles separately, if there is demand for them. If your use-case really requires On-Chain TWAP Oracles, get in touch with governance.
{% endhint %}

### Last Traded Price

TODO

### Last Traded Timestamp

TODO

### Cumulative Price

TODO

### Calculating Time Weighted Average Price

TODO


# Margin Requirements

TODO -- sellers need to post margin; all positions are always fully collateralized

### **Margin Minimums**

TODO

### Margin Discounts & Benefits

TODO


# Fees

TODO -- disclose all fees earned by the DAO and/or paid by the users (to match finders & network validators)

### **Maker Fees**

TODO

### **Taker Fees**

TODO

### **Settlement Fees**

TODO

### **Position Conversion Fees**

TODO

### **Match Finder Fees Per Lot**

TODO -- denominated in `OS*` tokens; refundable if unused

### **Gas Fees**

TODO -- payable to the network miners/validators, not to OptSwap


# Settlements

"The most important single central fact about a free market is that no exchange takes place unless both parties benefit." — Milton Friedman

Settlements are an absolutely critical aspect of all options contracts. A timely and fair settlement is key to ensuring that all parties are properly assigned and have immediate access to their underlying assets and cash funds after the expiration time has passed.

All the option contracts on OptSwap are natively settled on-chain. Options can be settled for the underlying asset (physical delivery) or in cash tokens.

{% hint style="info" %}
European style options can only be settled on or after expiration, whereas in-the-money American style options can be settled at any time up to and including the date of expiry.
{% endhint %}

### Topics

{% content-ref url="/pages/uoSoiNlMxwh54hlL95SM" %}
[Exercise Option](/user-manual/settlements/exercise-option)
{% endcontent-ref %}

{% content-ref url="/pages/sjc8ddqp05i6r9kNXKZL" %}
[Force Cash Settlements](/user-manual/settlements/force-cash-settlements)
{% endcontent-ref %}

{% content-ref url="/pages/HnnVZO75XPx0NWXtNrMn" %}
[Recover Margin](/user-manual/settlements/recover-margin)
{% endcontent-ref %}


# Exercise Option

TODO

### Exercise Underlying (Calls & Puts)

TODO

### Exercise Cash with Swap (Calls & Puts)

TODO

### Force Exercise Cash (Calls & Puts)

TODO

### Force Exercise Cash with Partial Swap (Calls Only)

TODO

### Force Exercise Underlying (Calls Only)

TODO


# Force Cash Settlements

TODO

### Force Cash Settlement with Swap

TODO

### Force Exercise Cash with Partial Swap (Calls)

TODO -- seller can call this method "on behalf of the buyer" for partial swap settlements (automatically handled behind the scenes by the UI)


# Recover Margin

TODO -- margin recovery for sellers for expired OTM options/spreads


# Automated Settlements

TODO -- miners will auto-settle to cash only after certain waiting periods have passed

### Max. Underlying Exercise Period

TODO -- Buyers who want to exercise the underlying asset must do so within the "Max. Underlying Exercise Period"

### Max. Force Cash Settlement Wait Period

TODO -- Sellers who want to force a cash settlement and recover their underlying assets may do so within the "Max. Force Cash Settlement Wait Period"


# Settlements Execution Rewards

TODO -- miners earn points (convertible to OS\* rewards) for executing settlements

### Settlements Execution Points

TODO

### Settlements Execution Rewards

TODO


# Meta Oracle

"Love of money and nothing else will ruin Sparta." — The Oracle at Delphi

The Meta Oracle provides the On-Chain Spot Prices, Fair Market Values (FMVs) and Liquidity and Time Weighted Average Prices (LTWAPs) of underlying assets. The prices returned by the Meta Oracle are used for settling options as well as for pricing contracts.

The Meta Oracle is a smart contract that works by observing and storing snapshots of liquidity pools. It is capable of deriving Spot Prices, FMVs, Settlement Prices and various other types of Aggregated Prices depending on the use-case.

### Topics

{% content-ref url="/pages/AaqgtybuQJIAp6wfq5fI" %}
[Methodology](/user-manual/meta-oracle/methodology)
{% endcontent-ref %}

{% content-ref url="/pages/rFwlwZW1k7yupnp34VFZ" %}
[Fetching Price Data](/user-manual/meta-oracle/fetching-price-data)
{% endcontent-ref %}

{% content-ref url="/pages/kantYtPvOIqJC9UagydG" %}
[Price Mining](/user-manual/meta-oracle/price-mining)
{% endcontent-ref %}

{% content-ref url="/pages/Egnb6nKufY8BmA05s0Ne" %}
[Managing Oracles](/user-manual/meta-oracle/managing-oracles)
{% endcontent-ref %}

{% content-ref url="/pages/tZAbyEUfhgiQOuy8UYPO" %}
[Donations](/user-manual/meta-oracle/donations)
{% endcontent-ref %}


# Methodology

TODO

### Liquidity & Time Weighted Average Price (LTWAP)

TODO

### Spot Prices

TODO

### Aggregation Types

TODO


# Fetching Price Data

TODO -- the meta oracle provides various types of prices and aggregations which should be carefully considered and chosen for your particular use case

TODO -- Warning: Be very careful while using the Average aggregation with TWAPDuration = 1 (instantaneous spot price) as manipulating the spot price will also skew the average. Median should still be OK to use though, as long as you're also including at least twice as many sufficiently long enough TWAPDurations!

{% hint style="danger" %}
Be careful while using TWAPs in isolation and without aggregation with low time durations; as short term TWAPS can be easily manipulated by bad actors!
{% endhint %}

### **Spot Price**

TODO

### **Settlement Price**

TODO

### **Multiple Prices**

TODO

### **Aggregated Price**

TODO

### **Safety Considerations**

in general, it's better to use an aggregation. e.g. use MAX of spot & recent LTWAPs (60 sec - 60+ mins) while selling calls, but MIN while buying calls; vice-versa for puts -- such that it's "favorable to the party involved". MEDIAN is also a good choice, generally speaking.&#x20;


# Price Mining

TODO -- OptSwap Miners get rewards in OS\* for snapshotting historic LTWAPs; this is a critical operation for the functioning of the protocol as the DEX depends on the meta oracle for settlement prices and the AMM for LTWAPs for real-time on-chain option pricing

### Treasury Mint Ratio

TODO -- percentage share of newly minted tokens going to treasury (0-100%); uncirculating treasury tokens

### Further Reading

To learn more, see the section on "Meta Oracle: Price Mining" for the OptSwap Miner.

{% content-ref url="/pages/VmJYeE4DourLoskQjEbd" %}
[OptSwap Miner](/user-manual/governance/optswap-miner)
{% endcontent-ref %}


# Managing Oracles

TODO


# Donations

TODO -- donate native assets or any ERC-20 tokens


# Governance

"That government is best which governs least." — Henry David Thoreau

The OptSwap protocol is governed by a Decentralized Autonomous Organization (DAO) whose members vote on proposals put forth by the community.

{% hint style="info" %}
OptSwap DAO Governance Tokens can be Vote-Escrowed for one (1) to four (4) years which grants a proportionally higher voting power to the holder. Vote-Escrowed Tokens are **non-transferrable** and can be used only for voting and staking during the escrow period. **They cannot be unescrowed or sold or withdrawn before the escrow period is complete!** The entire process is non-custodial and handled on-chain by smart contracts.
{% endhint %}

There are various types of proposals which cover every aspect of the protocol including DEXes, AMMs, Oracles, Fundraising Rounds, Airdrops, Commercial Papers and Treasury Operations. All governance actions must take place only through governance proposals for which voting and proposal execution takes place on-chain.

The various aspects of governance, including the scope of powers it can and cannot yield, are detailed in this section.

### Topics

{% content-ref url="/pages/vnGcFpLV702wowSDKojz" %}
[Concepts & Definitions](/user-manual/governance/concepts-and-definitions)
{% endcontent-ref %}

{% content-ref url="/pages/Jfamg29WqOH3NwMtzjxg" %}
[Tokenomics](/user-manual/governance/tokenomics)
{% endcontent-ref %}

{% content-ref url="/pages/rSnhCfy7WtBhTujuVcxT" %}
[Proposals](/user-manual/governance/proposals)
{% endcontent-ref %}

{% content-ref url="/pages/jTGU8jw6Fi9xkpCVHkEG" %}
[Proposal Types](/user-manual/governance/proposal-types)
{% endcontent-ref %}

{% content-ref url="/pages/XYHnobE1Au5VE2eqGJkv" %}
[Voting & Execution](/user-manual/governance/voting-and-execution)
{% endcontent-ref %}

{% content-ref url="/pages/UqII4rhtE6STLlKEpYBX" %}
[Fundraising](/user-manual/governance/fundraising)
{% endcontent-ref %}

{% content-ref url="/pages/T42lmN9BpDtFCwU0zEbB" %}
[Commercial Papers](/user-manual/governance/commercial-papers)
{% endcontent-ref %}

{% content-ref url="/pages/BlsmIRQTAvUk3ESTtF9Z" %}
[Airdrops](/user-manual/governance/airdrops)
{% endcontent-ref %}

{% content-ref url="/pages/FOUTJJWpkmbkVD0AwfwX" %}
[Staking](/user-manual/governance/staking)
{% endcontent-ref %}

{% content-ref url="/pages/VmJYeE4DourLoskQjEbd" %}
[OptSwap Miner](/user-manual/governance/optswap-miner)
{% endcontent-ref %}

{% content-ref url="/pages/RuC1ylo5LmVEJz7M79Bg" %}
[Contracts Registry](/user-manual/governance/contracts-registry)
{% endcontent-ref %}

{% content-ref url="/pages/ufiRcvDcIOt1iCAW88ZD" %}
[Testnet Faucet](/user-manual/governance/testnet-faucet)
{% endcontent-ref %}

{% content-ref url="/pages/QPJrji7TFn7qCrKy21LH" %}
[Donations](/user-manual/governance/donations)
{% endcontent-ref %}


# Concepts & Definitions

### OptSwap DAO

OptSwap Decentralized Autonomous Organization (DAO) is an entity that is comprised of the [Core Smart Contracts](/technical-reference/smart-contracts) and its members who share a common mission and act in the best interest of the entity.

Membership is attained by holding free-floating [Governance Tokens](/user-manual/governance/tokenomics) issued by the DAO. Voting rights are granted to members who Vote-Escrow (i. e. lock) their governance tokens for a set period of time.

### **Governance Contract**

`OptSwapDAOGovernance` is the main contract which controls the Treasury (approve/transfer) and has the ability to deploy new OptSwaps (DEXes & AMMs) and modify the parameters thereof; manage the MetaOracle; create Fundraising Rounds & Airdrops and issue new Commercial Papers.

{% hint style="success" %}
**The governance contract does not and cannot control the funds in the OptSwap DEXes & AMMs which are standalone and entirely non-custodial.** The only permissible parameter changes are the various fees, rewards, allowed settlement types and settlement periods.
{% endhint %}

### **Governance Proposals**

Any actions proposed to be performed by the DAO are recorded on-chain as [Governance Proposals](#governance-proposals). DAO members with voting rights may vote for or against the execution of the proposals. There exist several [Proposal Types](/user-manual/governance/proposal-types) which cover every aspect of the functioning of the DAO. Only proposals which pass the quorum and voting requirements are allowed to be executed.

### **Governance Tokens (OS\*)**

OptSwap DAO issues Governance Tokens (OS\*) on various blockchain networks which grants membership to the DAO on that particular network. The asterisk (\*) suffix acts as a placeholder for the abbreviated network name, e. g. "OptSwap Ethereum" (OSE). OS\* tokens are free-floating and can be bought or sold at any time.

### **Vote-Escrowed Governance Tokens (veOS\*)**

OS\* tokens can be vote-escrowed (i. e. locked) by members to attain voting rights and to participate in governance proposals and staking programs. Escrowing tokens for longer durations, up to a maximum of four (4) years, increases the voting power attained by members. Vote-Escrowed tokens are non-transferrable and cannot be unlocked or sold before the escrow period is complete.

### **Voting**

All governance proposals can be voted upon by DAO members with voting rights until the voting period completes. Votes are registered on-chain as a simple "Yes" or "No" entry with the number of Vote-Escrowed tokens in favor of or against the proposal. Members may also choose to abstain by not voting. All votes are registered immediately and are open to public view. Votes can be modified or withdrawn as long as the voting period is still open.

### **Quorum**

The Quorum is the minimum voter turnout, measured as a percentage of the total supply of vote-escrowed tokens, required to make the proceedings of the proposal and vote be deemed valid and executable. For OptSwap DAO, it must be a minimum of 67% (i. e. more than 2/3rds voter turnout) although it can be set even higher for specific one-off proposals by the proposer.

### **Execution Timelock Period**

A proposal that has passed the quorum and vote requirements enters into a timelock period after the end of voting. Proposals can be executed only after the timelock period has passed. For OptSwap DAO, it must be a minimum of 30 minutes although it can be set higher for specific one-off proposals by the proposer.

### **Proposal Execution**

Proposals that have passed and have had their timelock periods expire can finally be executed on-chain. The effects of executing the proposal are immediate and irreversible.

### **Execution Grace Period**

All proposals must be executed within the Execution Grace Period of one (1) day or 24 hours. If the proposal was not executed with the grace period for any reason, it goes into the "Execution Failed" status and can no longer be processed. A new proposal will need to be created with the same parameters and voted upon again to achieve the desired outcomes.


# Tokenomics

The word "Tokenomics" is a portmanteau of the words "Token" and "Economics."&#x20;

It is the consensus which defines the supply and use-cases of the governance tokens within the various smart contracts of the protocol.

{% hint style="danger" %}
**OPTSWAP IS CURRENTLY ONLY IN TESTNET (PUBLIC ALPHA) AND DOES NOT HAVE ANY TOKEN ON ANY MAINNET BLOCKCHAIN NETWORK! BEWARE OF SCAMS AND ONLY FOLLOW OUR OFFICIAL CHANNELS FOR FUTURE MAINNET RELEASES!**
{% endhint %}

### **OptSwap Governance Tokens (OS\*)**

OptSwap DAO issues Governance Tokens (OS\*) on all the blockchain networks in which it operates. Ownership of OS\* tokens grants membership to the DAO on that specific network.&#x20;

OS\* tokens are free-floating and they can be bought or sold on the open market.&#x20;

The asterisk (\*) suffix is a placeholder for the abbreviated name of the blockchain network. e. g. "OptSwap Ethereum" (OSE), "OptSwap Optimism" (OSO), "OptSwap BNB Chain" (OSB) etc.,

### **Genesis Supply & Distribution**

The genesis (i. e. initial) supply of OS\* tokens is hard-coded at genesis to **126,230,400 (one hundred twenty six million two hundred thirty thousand four hundred)** which is derived as follows:

```
Genesis Supply = Seconds Per Day × Days Per Year × 4 Years

=> 126,230,400 = 86,400 × 365.25 × 4
```

TODO -- init distribution TBD! (will be based on investor demand)

### **Maximum Authorized Supply**

The maximum number of OS\* tokens that are authorized to exist is set to the initial supply at genesis implying that no additional tokens can be minted. However, the maximum authorized supply may be increased or decreased on-chain via the `SetTokenAuthorizedSupply` Governance Proposal. Note that the the authorized supply cannot be decreased below the current circulating total supply of OS\* tokens. Newly authorized tokens do not manifest immediately but are governed by the hard-coded inflation rate.

### **Inflation Rate**

The inflation rate for OS\* tokens is hard-coded at genesis to **one (1) token per second** resulting in approximately **31,557,600 new tokens authorized per year up to the Maximum Authorized Supply** (assuming 365.25 days per year). The inflation is defined at genesis and is immutable providing guarantees against.

### **Minting & Treasury Mint Ratio**

Only the [Meta Oracle](/user-manual/meta-oracle) has the authority to mint new OS\* tokens. The Meta Oracle rewards [OptSwap Miners](/user-manual/governance/optswap-miner) with newly minted OS\* tokens for running critical [Price Mining](/user-manual/meta-oracle/price-mining) operations, i. e. snapshotting historical on-chain prices and liquidity for the tracked token pairs.

New OS\* tokens are minted into the miner's wallet directly as well as the DAO's treasury in the "Treasury Mint Ratio" which can be modified via governance proposals. OS\* tokens in the DAO's treasury are uncirculating treasury tokens and they can only be distributed via governance proposals such as airdrops, fundraising rounds or approvals/transfers.

### **Vote-Escrowed Governance Tokens (veOS\*)**

The primary use-case of OS\* tokens is to obtain voting power within the DAO's governance functions. OS\* tokens must be Vote-Escrowed (i. e. locked) for a specified period of time and the voting power obtained is proportional to the number of tokens escrowed as well as the escrow duration. The exact ratios are provided in the table below:

| Escrow Period (in Years) | OS\* Escrowed | veOS\* Minted |
| ------------------------ | ------------- | ------------- |
| 1                        | 1             | 0.25          |
| 2                        | 1             | 0.5           |
| 3                        | 1             | 0.75          |
| 4                        | 1             | 1             |

Escrowed tokens cannot be transferred, sold, unescrowed or withdrawn until the full escrow period is complete. After the escrow period has passed, veOS\* tokens may be unescrowed and the underlying OS\* tokens withdrawn.

Starting the unescrow process immediately forfeits any voting power associated with the veOS\* tokens and the underlying OS\* tokens are put into a waiting period of 2 (two) weeks. The unescrowed tokens can then be withdrawn linearly over the next 2 (two) weeks after the waiting period is complete.

### **Other Use-Cases**

TODO -- match finder fees are paid in OS\* tokens; trading fees rebates for holders; liquidity provider rewards; staking rewards; miner rewards -- price mining, expired order cancellations, settlements execution rewards; other future use-cases or incentives as may be deemed in the best commercial or reputational interests of the DAO.


# Proposals

The OptSwap DAO Governance contract is the main hub of all governance activity on-chain. The only way to make changes to the protocol are through Governance Proposals which are voted upon by OptSwap DAO Members with Voting Power, i. e. holders of veOS\* tokens.

### Voting & Execution

After a proposal is created, there is a voting period during which members may cast their votes. This is followed by a timelock period during which the proposal cannot yet be executed but is publicly notable as having being passed for execution by the DAO. After the timelock period ends, the execution grace period begins within which any "Passed" proposals must be executed on-chain, otherwise they move into an "Execution Failed" state.

### Execution Conditions

Proposals become "Executable" only after voting has ended and the following criteria are met:

1. A minimum Quorum of 67% of the total Vote-Escrowed token supply was achieved.
2. The total number of "Yes" votes were greater than the "No" votes.
3. The "Yes" votes were greater than 50% of the total supply of Vote-Escrowed tokens.
4. The Execution Timelock period has passed after the end of the vote.
5. The Proposal Execution Grace Period has not yet passed after the Timelock has ended.

This ensures that all proposals are always passed by a majority of Vote-Escrowed token holders or not executed at all. While the Quorum may be set to a value greater than 67% for any proposal, it cannot be set to below this value to ensure that all decisions taken by the DAO are unanimously agreed upon.

### **Creating Proposals**

Each sub-section within the "Govern" area of the DApp has a Menu on the top-right which allows any member to create proposals related to the sub-section. Each type of proposal has different parameters which must be provided by the proposer and these are registered on-chain (see [Proposal Types](/user-manual/governance/proposal-types)). To prevent spam, governance has the ability to set a "Governance Proposal Fee" which may or may not be refundable to the proposer; as well as the ability to redact proposals.

\[TODO -- Image]

### **Proposal Statuses**

Proposals may exist in any one (and only one) of the following statuses at any given time:

* `Voting`: The proposal is currently available to be voted upon by members.
* `Failed`: The proposal failed the quorum or voting requirements after the voting phase ended.
* `Passed`: The proposal is past the voting phase, has passed the quorum and voting requirements.
* `Executed`: The proposal has been executed successfully on-chain with no errors or reverts.
* `Executable`: The proposal has passed, is past the timelock period and is ready to be executed.
* `Error`: The proposal reverted or had an error during execution.
* `ExecutionFailed`: The proposal was `Executable` but the execution transaction wasn't run on-chain before the execution grace period finished.
* `Redacted`: The proposal has been redacted by governance.


# Proposal Types

Every [Governance Proposal](/user-manual/governance/proposals) must be of a single Proposal Type. The parameters required for each Proposal Type differ based on the particular action required to be performed.

{% hint style="warning" %}
**All OptSwap Contracts are Non-Custodial.** While the proposal types below are versatile and quite powerful in terms of the actions that can be performed by the governance, it is just as important (if not more so) to understand what the governance **cannot** do. Specifically, the governance:

* **Cannot** access or withdraw user funds from any contracts (DEX/AMM/Staking/etc.,)
* **Cannot** change or manipulate user positions in the DEX or AMM contracts.
* **Cannot** change or reverse past transactions in any manner whatsoever.
* **Cannot** change the on-chain spot and settlement prices reported by the Meta Oracle.
  {% endhint %}

### **Meta Oracle**

#### Add Oracle

Track a unique Uniswap V2/V3 Pair as an on-chain Oracle to store Time Weighted Average Prices (TWAPs) and liquidity snapshots.

**Parameters:** `token0` (address), `token0Decimals` (number), `token1` (address), `token1Decimals` (number), `router` (address), `liquidityPool` (address), `liquidityPoolType` (`UniV2/UniV3`), `nativeAssetToken` (`Token0/Token1/None`)

#### Disable Oracle

Disable an existing Oracle.

**Parameters:** `token0` (address), `token1` (address), `liquidityPool` (address)

#### Enable Oracle

Re-enable a previously disabled Oracle.

**Parameters:** `token0` (address), `token1` (address), `liquidityPool` (address)

#### Set Treasury Mint Ratio

Sets the Treasury Mint Ratio for OS\* tokens minted by the Meta Oracle as rewards during the Price Mining operations by miners. See [Price Mining](/user-manual/meta-oracle/price-mining).

**Parameters:** `treasuryMintRatio` (percentage between 0-100%)

#### Withdraw Funds

Withdraw any donations to the Meta Oracle back into the treasury.

**Parameters:** `tokens[]` (address array)

### **Treasury Operations**

#### Transfer Native Asset

Transfer an amount of the network's native asset (gas token) from the treasury to the given address.

**Parameters:** `toAddress` (address), `amount` (number)

#### Transfer Tokens

Transfer an amount of ERC-20 tokens from the treasury to the given address.

**Parameters:** `toAddress` (address), `transferToken` (address), `amount` (number)

#### Approve Tokens And Notify Reward

Approve an amount of the native asset (gas token) or ERC-20 token to the given smart contract address and call the `notifyReward` function. This is used mainly for transferring staking and other rewards to the respective smart contracts.

**Parameters:** `toAddress` (address), `rewardToken` (address), `rewardAmount` (number)

### **Commercial Papers**

#### Issue New Commercial Paper

Issues a new [Commercial Paper](#commercial-papers) (C-Paper) which users can subscribe to.

**Parameters:** `name` (string), `symbol` (string), `whitelisted` (boolean), `restrictiveLegend` (boolean), `underlyingToken` (address), `faceValue` (number), `subscriptionDiscount` (number), `issueStartAt` (timestamp), `issueEndAt` (timestamp), `maturityTimestamp` (timestamp), `maxSupply` (number)

#### Whitelist Users

Approves users to be able to subscribe to a commercial paper that is not open to the public.

**Parameters:** `cPaperAddress` (address), `users[]` (address array), `whitelisted[]` (boolean array)

#### Withdraw Funds

Withdraw funds accrued from user subscriptions into the treasury from the relevant C-Paper contract.

**Parameters:** `cPaperAddress` (address), `tokens` (address array)

### **Fundraising**

#### Create Fundraising Round

Creates a new [Fundraising](#fundraising) Round for the specified token at the specified rate.

**Parameters:** `maxSupply` (number), `token` (address), `tokenDecimals` (number), `whitelisted` (boolean), `restrictiveLegend` (boolean), `rate` (number), `startAt` (timestamp), `endAt` (timestamp), `vestingPeriod` (number)

#### Whitelist Users

Approves users to be able to subscribe to a fundraising round that is not open to the public.

**Parameters:** `roundNumbers` (number array), `users[]` (address array), `whitelisted[]` (boolean array)

#### Remove Restrictive Legends

Removes the Restrictive Legend from the specified vesting fundraises.

**Parameters:** `vestingNumbers` (number array)

#### Withdraw Funds

Withdraw funds accrued from fundraising rounds into the treasury.

**Parameters:** `tokens` (address array)

### **Airdrops**

#### Create Airdrops

Creates native asset (gas token) or ERC-20 token [Airdrops](/user-manual/governance/airdrops) for the specified set of users in the specified amounts and also specifies the vesting ending timestamps for each.

**Parameters:** `users[]` (address array), `tokens[]` (address array), `amounts[]` (number array), `vestingEndsAt[]` (timestamp array)

#### Withdraw Funds

Withdraw excess tokens deposited into the Airdrops contract back into the treasury.

**Parameters:** `tokens` (address array)

### **DEXes & AMMs**

#### Deploy New OptSwap DEX Contract

Deploy a new OptSwap Options Decentralized Exchange (DEX) contract for the specified underlying and cash asset pair alongside the contract and exchange specifications.

**Parameters:** `underlyingAsset` (address), `underlyingAssetDecimals` (number), `cashAsset` (address), `cashAssetDecimals` (number), `fixedLotSize` (number), `minTickSize` (number), `maxUnderlyingExercisePeriod` (number), `maxForceCashSettlementWaitPeriod` (number), `metaOracle` (address), `useViaToken` (boolean), `viaTokenAddress` (address)

#### Deploy New OptSwap AMM Contract

Deploy a new OptSwap Automated Market Maker (AMM) contract paired to the specified DEX with the specified strike and expiry parameters.

**Parameters:** `optSwapContract` (address), `standardStrikeDistance` (number), `expiryStart` (timestamp), `expiryFrequency` (number)

#### Update OptSwap Details

Updates the fees, rewards and settlement parameters to the specified values for an existing DEX.

**Parameters:** `optSwapContract` (address), `makerFees` (number), `takerFees` (number), `settlementFees` (number), `positionConversionFees` (number), `underlyingAssetFeesDisbursalContract` (address), `cashAssetFeesDisbursalContract` (address), `feesTransferReward` (number), `maxUnderlyingExercisePeriod` (number), `maxForceCashSettlementWaitPeriod` (number), `rewardPerSettlementsExecutionPoint` (number), `allowForceExerciseCashCalls` (boolean), `allowForceExerciseCashPuts` (boolean), `allowForceExerciseWithPartialSwap` (boolean), `allowForceExerciseUnderlying` (boolean), `matchFinderFeesPerLot` (number)

#### Update OptSwap AMM Address

Registers a new AMM contract with the specified DEX.

**Parameters:** `optSwapContract` (address), `ammAddress` (address)

#### Set OptSwap AMM Rewards

Updates the rewards parameters for the AMM associated with the given DEX.

**Parameters:** `optSwapContract` (address), `rewardPerMatchFinderPoint` (number), `rewardPerLiquidityProviderPoint` (number), `rewardPerManagedOrderCancellationPoint` (number)

### **Staking**

#### Deploy New Staking Contract

Creates a new staking contract for the given staked token & reward token pair. The staked & reward tokens may be any combination of the native asset (gas token) or ERC-20 tokens.

**Parameters:** `stakedToken` (address), `stakedTokenDecimals` (number), `stakedTokenIsNativeAsset` (boolean), `rewardToken` (address), `rewardTokenIsNativeAsset` (boolean)

### **Other**

#### Execute Transaction

Calls the method specified by the signature and data on the target contract (as a delegate call or not). Note that arbitrary transactions are disallowed against the Meta Oracle, Airdrops & Fundraising contracts, any of the issued tokens (OS\*/veOS\*) or any of the previously deployed DEXes/AMMs.

**Parameters:** `target` (address), `value` (number), `signature` (string), `data` (bytes), `executionTime` (timestamp), `withDelegatecall` (boolean)

#### Proxy Upgrade

Upgrade the proxy implementation (logic) contract of one of the Core smart contracts in OptSwap.

**Parameters:** `target` (address), `logicContractAddress` (address), `data` (bytes), `value` (number)

#### Proxy Change Admin

Change the proxy admin of one of the Core smart contracts in OptSwap.

**Parameters:** `target` (address), `newAdmin` (address)

#### Redact Proposal

Redacts the specified proposal by overwriting the string and bytes arguments.

**Parameters:** `proposalNumber` (number)

#### Set Governance Proposal Fee

Set a minimum fee to create a new proposal, payable in OS\* tokens.

**Parameters:** `feeAmount` (number)

#### Set Proposal Execution Reward

Set a maximum reward payable to the miner who executed the proposal, denominated in OS\* tokens.

**Parameters:** `rewardAmount` (number)

#### Set Token Authorized Supply

Set the maximum authorized OS\* token supply.

**Parameters:** `authorizedAmount` (number)

#### Register New Contract

Registers a new contract of the given type with the governance registry. The parameters specific to the particular contract type must be specified by the proposer.

**Parameters:** `target` (address), `contractType` (`OptSwap/OptSwapDAOStaking/OptSwapDAOCommercialPaperToken/MetaOracle/ERC-20/Other`), `{...contractTypeSpecificArguments}` (multi-type)


# Voting & Execution

TODO -- on-chain voting & execution

### **Voting**

TODO

### **Modifying Your Vote**

TODO

### **Execution Timelock**

TODO

### **Proposal Execution**

TODO

### **Proposal Execution Rewards**

TODO

### **Execution Grace Period**

TODO


# Fundraising

TODO -- allows the DAO to fundraise native asset or ERC-20s in exchange for OS\* tokens

### Restrictive Legend

TODO -- U. S. Persons can only be issued tokens stamped with the Restrictive Legend per SEC rules.


# DAO Treasury

TODO -- treasury holds native asset or ERC-20s; also holds uncirculating treasury OS\* tokens minted by the meta oracle (based on the treasury mint ratio); treasury ops require proposals + voting


# Commercial Papers

TODO -- allows the DAO to borrow native asset or ERC-20s; exactly like a standard C-Paper (treasury instrument sold at a discount & repayable at face value)

### Restrictive Legend

TODO -- U. S. Persons can only be issued C-Papers stamped with the Restrictive Legend per SEC rules


# Airdrops

TODO -- airdrop native asset or ERC-20s


# Staking

TODO -- stake-to-earn; non-custodial; native asset and/or ERC-20s


# OptSwap Miner

TODO -- miners provide critical on-chain services and get rewarded by the DAO for valid contributions

### **Meta Oracle: Price Mining**

TODO&#x20;

### **Governance: Proposals Execution**

TODO

### **AMM: Managed Orders Execution (Match Finding)**

TODO

### **AMM: Managed Orders Cancellation**

TODO

### **DEX: Automated Settlements Execution**

TODO

### **DEX: Transfer Fees to Disbursal Contracts**

TODO


# Contracts Registry

TODO -- on-chain contracts registry

### **Contract Types**

TODO&#x20;

### **Querying the Registry**

TODO


# Testnet Faucet

TODO

### **Mock Tokens**

TODO


# Donations

TODO -- donate native assets or any ERC-20 tokens


# API Overview

"At some stage ... we should have to expect the machines to take control." — Alan Turing

### Introduction

The OptSwap protocol is comprised of multiple Core smart contracts which together provide the functionality of Decentralized Exchanges (DEXes), Automated Market Makers (AMMs), Meta Oracles, Staking, Fundraising, Airdrops and Governance.

{% hint style="success" %}
The Core contracts provide all the fundamental safety guarantees for every user interacting with OptSwap. They define the governance rules, options trading & settlement logic, and all the interactions involving the underlying assets and cash tokens therein.
{% endhint %}

External calls will interact directly with the Core contracts using the Application Binary Interfaces (ABIs) which are provided for each of the smart contracts that is deployed. All the external calls are documented in this technical reference documentation. Internal functions and libraries are viewable on the OptSwap Github repository.

### Software Requirements

OptSwap has been developed and compiled using the following libraries or frameworks:

* Truffle
* Ganache
* Solidity
* The Graph

{% hint style="info" %}
For all smart contract interactions from an Externally Owned Account (EOA), you should be able to get by with just Web3.js; or the equivalent libraries/tools which support the Ethereum Virtual Machine (EVM) and EVM Application Binary Interfaces (ABIs) in your favorite programming language or framework.

The subgraphs can be queried with GraphQL using simple HTTPS requests and all responses are in JSON format. Therefore, it should be compatible out-of-the-box with any language or framework of your choice.
{% endhint %}

### Developer APIs

{% content-ref url="/pages/Y1Wu57HHKdv1qBoELCYK" %}
[Smart Contracts](/technical-reference/smart-contracts)
{% endcontent-ref %}

{% content-ref url="/pages/oseFgHegRzY8YigJgRcT" %}
[Subgraphs](/technical-reference/subgraphs)
{% endcontent-ref %}

{% content-ref url="/pages/4xTr98EFgHcSlZCYM4AI" %}
[REST API](/technical-reference/rest-api)
{% endcontent-ref %}


# Smart Contracts

"A valid contract requires voluntary offer, acceptance, and consideration." — Robert Higgs

The OptSwap protocol consists of ten (10) core smart contracts – six (6) of which are deployed at genesis, and four (4) of which are deployable via governance proposals.

The Genesis Smart Contracts are all Singletons, i.e. they have a single instance and canonical address. The Governance Deployable Smart Contracts will have separate (multiple) instances, one for each DEX, AMM, commercial paper or staking contract.

### Genesis Smart Contracts (Singletons)

1. **`OptSwapDAOGovernance`:** The main DAO Governance Contract. No Owner. Governance proposals can only be passed by a greater than two-thirds (67%) majority of votes by `OptSwapDAOVeToken` holders.
2. **`OptSwapDAOFundraising`:** The DAO Fundraising contract. Owned by the `OptSwapDAOGovernance`.
3. **`OptSwapDAOAirdrops`:** The DAO Airdrops contract. Owned by the `OptSwapDAOGovernance`.
4. **`MetaOracle`:** The Liquidity & Price Meta Oracle. Owned by the `OptSwapDAOGovernance`.
5. **`OptSwapDAOToken`:** The DAO Governance Token. Owned & Mintable by the `MetaOracle`.
6. **`OptSwapDAOVeToken`:** The Non-Transferrable Vote-Escrowed Token Contract. Owned by & Mintable by escrowing the `OptSwapDAOToken`.

### Governance Deployable Smart Contracts (Separate Instances)

1. **`OptSwap`:** The OptSwap Decentralized Exchange (DEX) contract for a particular underlying-cash pair. Owned by the `OptSwapDAOGovernance`.
2. **`OptSwapAMM`:** The OptSwap Automated Market Maker (AMM) contact for a particular DEX. Owned by the `OptSwapDAOGovernance`.
3. **`OptSwapDAOStaking`:** OptSwap Staking contracts. No Owner.
4. **`OptSwapDAOCommercialPaperToken`:** OptSwap DAO Commercial Paper contracts. Owned by the `OptSwapDAOGovernance`.


# Deployment Addresses

🚧 Under Construction 🏗

The official deployment addresses for the OptSwap protocols core smart contracts are provided below for each blockchain network.

{% hint style="danger" %}
**Always ensure that you are interacting only with the official contract addresses listed on this page! Any contract not listed on this page should be strictly avoided! It may be impossible to retrieve any funds lost from interacting with malicious contracts!**
{% endhint %}

### **Optimism Sepolia Testnet (L2)**

* **OptSwapDAOGovernance:** `0x...`
* **MetaOracle:** `0x...`
* **OptSwapDAOFundraising:** `0x...`
* **OptSwapDAOAirdrops:** `0x...`
* **OptSwapDAOOptimismTestToken:** `0x...`
* **OptSwapDAOOptimismTestVeToken:** `0x...`
* **OptSwapDAOTestnetFaucet:** `0x...`
* **MockWBTC:** `0xb210fba65DC617bE30eB6B0b99B3CDd5556EF82e`
* **MockUSDC:** `0x298b4c4F9bE251c100724a3bEAe234BD1652CBcE`
* **MockOP:** `0x743cd9ad6a17c0e1230df773047357d4c1154a79`
* **WETH9:** `0xAd6A7addf807D846A590E76C5830B609F831Ba2E`

### **BNB Smart Chain (BSC) Testnet**

TODO -- tBNB (coming soon!)


# MetaOracle

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwap

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapAMM

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOAirdrops

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOFundraising

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOGovernance

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOStaking

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOToken

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOVeToken

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# OptSwapDAOCommercialPaperToken

🚧 Under Construction 🏗

### Constants

#### `TODO`

TODO&#x20;

### Enums

#### `TODO`

TODO

### Structs

#### `TODO`

TODO

### Functions

#### `TODO`

TODO

### Events

#### `TODO`

TODO

### ABI

TODO


# Subgraphs

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom." — Clifford Stoll

All the core smart contracts emit various Blockchain Events which are recorded and collated/aggregated within the subgraphs, developed using The Graph framework. This allows for off-chain access of market and governance data using the GraphQL syntax.

{% hint style="info" %}
The subgraphs are namespaced using the convention `OptSwapDAO*`, where `*` is the name of the blockchain network that this particular graph is indexing.
{% endhint %}

### Subgraph Latencies

Note that subgraphs may have a slight latency associated with indexing the blockchain events before they are queryable. The latencies are caused by various factors, including RPC endpoint response delays, event data processing time, database writing & indexing time and subgraph query processing and response time.

{% hint style="warning" %}
Latencies may range from a few milliseconds to several seconds depending on network conditions, server load and availability. Clients must always validate the freshness of the response data by comparing the timestamps or block numbers of any data they are querying against the latest timestamp or block number from an independent node or RPC endpoint.
{% endhint %}

{% hint style="success" %}
To reduce latency, consider deploying your own OptSwap subgraph locally, using your own local nodes and local RPC endpoints for the networks you are interested in.\
\
TODO -- deploying your own OptSwap subgraph node
{% endhint %}


# Endpoints

🚧 Under Construction 🏗

The subgraphs are deployed at the following endpoints and are sharded by blockchain network.

{% hint style="danger" %}
**Always ensure that you are querying only the official endpoints listed on this page! Any endpoints not listed on this page should be strictly avoided! You may receive incorrect or corrupted data from malicious endpoints!**
{% endhint %}

### **Optimism Sepolia Testnet (L2)**

* **Node 0:** `https://optest-node0.optswap.org/graph/subgraphs/name/OptSwapDAO/*`
* **Node 1:** `https://optest-node1.optswap.org/graph/subgraphs/name/OptSwapDAO/*`

### **BNB Smart Chain (BSC) Testnet**

TODO -- tBNB (coming soon!)


# Entities

OptSwap Subgraph Data Entities and Schema

{% hint style="info" %}
Note that some attributes such as `proposalType`, `optionType`, `optionStyle`, etc., return enumerated values. Please refer to the associated smart contracts documentation for full details about the various enumerated types.
{% endhint %}

{% hint style="warning" %}
Some of these entities may change or be renamed/optimized in future versions which may affect your queries. Subsequent versions will be posted on this page along with the Changelog for developers to update their code. Please consider these entities as currently "in beta" and be prepared to update your applications in the future, if needed.
{% endhint %}

### Changelog

* 2024-xx-xx: Entities & Schema –
  * v0.0.1 created.

### Entities & Schema (v0.0.1)

```graphql
##############
# Block Info #
##############

type LatestBlock @entity {
  id: ID!
  number: BigInt! # uint256
  timestamp: BigInt! # uint256
}

########################
# OptSwapDAOGovernance #
########################

type GovernanceExecutedTransaction @entity {
  id: ID!
  contract: Bytes! # address
  actionHash: Bytes! # bytes32
  target: Bytes! # address
  value: BigInt! # uint256
  signature: String! # string
  data: Bytes! # bytes
  executionTime: BigInt! # uint256
  withDelegatecall: Boolean! # bool
  resultData: Bytes! # bytes
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type NativeAssetDonated @entity {
  id: ID!
  to: Bytes! # address
  user: Bytes! # address
  donationAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwap @entity {
  id: ID!
  contract: Bytes! # address
  contractLogic: Bytes! # address
  token0: Bytes! # address
  token0Decimals: Int! # uint8
  token1: Bytes! # address
  token1Decimals: Int! # uint8
  fixedLotSize: BigInt! # uint32
  minTickSize: BigInt! # uint32
  metaOracle: Bytes! # address
  useViaToken: Boolean! # bool
  viaToken: Bytes! # address
  token0Reserves: BigInt! # uint256
  token1Reserves: BigInt! # uint256
  totalTradeVolume: BigInt! # uint256
  totalUnderlyingSettlementVolume: BigInt! # uint256
  totalCashSettlementVolume: BigInt! # uint256
  totalMakerFeesEarned: BigInt! # uint256
  totalTakerFeesEarned: BigInt! # uint256
  totalUnderlyingSettlementFeesEarned: BigInt! # uint256
  totalCashSettlementFeesEarned: BigInt! # uint256
  totalPositionConversionFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapDayData @entity {
  id: ID!
  contract: Bytes! # address
  dayNumber: BigInt! # uint256
  dayStartTimestamp: BigInt! # uint256
  token0Reserves: BigInt! # uint256
  token1Reserves: BigInt! # uint256
  totalTradeVolume: BigInt! # uint256
  totalUnderlyingSettlementVolume: BigInt! # uint256
  totalCashSettlementVolume: BigInt! # uint256
  totalMakerFeesEarned: BigInt! # uint256
  totalTakerFeesEarned: BigInt! # uint256
  totalUnderlyingSettlementFeesEarned: BigInt! # uint256
  totalCashSettlementFeesEarned: BigInt! # uint256
  totalPositionConversionFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapUpdateDetail @entity {
  id: ID!
  optSwapContract: Bytes! # address
  ammContract: Bytes! # address
  makerFees: BigInt! # uint32
  takerFees: BigInt! # uint32
  settlementFees: BigInt! # uint32
  positionConversionFees: BigInt! # uint32
  matchFinderFeesPerLot: BigInt! # uint96
  token0FeesDisbursalContract: Bytes! # address
  token1FeesDisbursalContract: Bytes! # address
  feesTransferReward: BigInt! # uint32
  maxUnderlyingExercisePeriod: BigInt! # uint32
  maxForceCashSettlementWaitPeriod: BigInt! # uint32
  rewardPerSettlementsExecutionPoint: BigInt! # uint96
  allowForceExerciseCashCalls: Boolean! # bool
  allowForceExerciseCashPuts: Boolean! # bool
  allowForceExerciseWithPartialSwap: Boolean! # bool
  allowForceExerciseUnderlying: Boolean! # bool
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMUpdated @entity {
  id: ID!
  optSwapContract: Bytes! # address
  ammContract: Bytes! # address
  ammContractLogic: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type GovernanceProposalCreated @entity {
  id: ID!
  contract: Bytes! # address
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  proposalType: Int! # uint8
  target: Bytes! # address
  quorum: BigInt! # uint256
  votingEndsAt: BigInt! # uint256
  timelockDuration: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type GovernanceProposalExecuted @entity {
  id: ID!
  contract: Bytes! # address
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  reward: BigInt! # uint256
  resultData: Bytes! # bytes
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type GovernanceProposalExecutionError @entity {
  id: ID!
  contract: Bytes! # address
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  reward: BigInt! # uint256
  callError: Bytes! # bytes
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Maps from RegisterNewContract events wherever applicable
# or gets stamped out based on core contracts deployed
type Contract @entity {
  id: ID! # ID is the address
  contract: Bytes! # address
  contractType: Int! # uint8
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type StakingContract @entity {
  id: ID!
  governanceContract: Bytes! # address
  contract: Bytes! # address
  contractLogic: Bytes! # address
  stakedToken: Bytes! # address
  stakedTokenDecimals: Int! # uint8
  stakedTokenIsNativeAsset: Boolean! # bool
  rewardToken: Bytes! # address
  rewardTokenIsNativeAsset: Boolean! # bool
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type TokensDonated @entity {
  id: ID!
  to: Bytes! # address
  user: Bytes! # address
  donationToken: Bytes! # address
  donationAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type TokensWithdrawn @entity {
  id: ID!
  from: Bytes! # address
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  nVeGovernanceTokens: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type CommercialPaper @entity {
  id: ID!
  governanceContract: Bytes! # address
  contract: Bytes! # address
  contractLogic: Bytes! # address
  whitelisted: Boolean! # bool
  restrictiveLegend: Boolean! # bool
  underlyingToken: Bytes! # address
  faceValue: BigInt! # uint256
  subscriptionDiscount: BigInt! # uint256
  issueStartAt: BigInt! # uint256
  issueEndAt: BigInt! # uint256
  maturityTimestamp: BigInt! # uint256
  maxSupply: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type GovernanceVoteModified @entity {
  id: ID!
  contract: Bytes! # address
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  yesOrNo: Boolean! # bool
  nVeGovernanceTokens: BigInt! # uint256
  voteChanged: Boolean! # bool
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type GovernanceVoted @entity {
  id: ID!
  contract: Bytes! # address
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  yesOrNo: Boolean! # bool
  nVeGovernanceTokens: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

##############
# MetaOracle #
##############

# Inherits NativeAssetDonated from OptSwapDAOGovernance

type ProxyAdminChanged @entity {
  id: ID!
  contract: Bytes! # address
  previousAdmin: Bytes! # address
  newAdmin: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type ProxyUpgraded @entity {
  id: ID!
  contract: Bytes! # address
  implementation: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type Token @entity {
  id: ID!
  decimals: Int! # uint8
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OracleAdded @entity {
  id: ID!
  contract: Bytes! # address
  token0: Bytes! # address
  token0Decimals: Int! # uint8
  token1: Bytes! # address
  token1Decimals: Int! # uint8
  router: Bytes! # address
  liquidityPool: Bytes! # address
  liquidityPoolType: Int! # uint8
  nativeAssetToken: Int! # uint8
  oracleIndex: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OracleDisabled @entity {
  id: ID!
  contract: Bytes! # address
  token0: Bytes! # address
  token1: Bytes! # address
  liquidityPool: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OracleEnabled @entity {
  id: ID!
  contract: Bytes! # address
  token0: Bytes! # address
  token1: Bytes! # address
  liquidityPool: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OwnershipTransferred @entity {
  id: ID!
  contract: Bytes! # address
  previousOwner: Bytes! # address
  newOwner: Bytes! # address
  blockNumber: BigInt! # uint256 
  timestamp: BigInt! # uint256
}

type SnapshotOracle @entity {
  id: ID!
  contract: Bytes! # address
  token0: Bytes! # address
  token1: Bytes! # address
  user: Bytes! # address
  nRewardTokensToUser: BigInt! # uint256
  nRewardTokensToTreasury: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
  spotPriceOfToken0PerToken1: BigInt! # uint256
  spotPriceOfToken1PerToken0: BigInt! # uint256
  LTWAPOfToken0PerToken1: BigInt! # uint256
  LTWAPOfToken1PerToken0: BigInt! # uint256
  reserve0: BigInt! # uint256
  reserve1: BigInt! # uint256
}

# Inherits TokensDonated from OptSwapDAOGovernance

type Withdrawn @entity {
  id: ID!
  contract: Bytes! # address
  token: Bytes! # address
  withdrawnAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

#########################
# OptSwapDAOFundraising #
#########################

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

type FundraisingFunded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  roundNumber: BigInt! # uint256
  nGovernanceTokens: BigInt! # uint256
  fundedAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Inherits OwnershipTransferred from MetaOracle

type FundraisingRestrictiveLegendRemoved @entity {
  id: ID!
  contract: Bytes! # address
  vestingNumber: BigInt! # uint256
  roundNumber: BigInt! # uint256
  user: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type FundraisingRoundCreated @entity {
  id: ID!
  contract: Bytes! # address
  roundNumber: BigInt! # uint256
  maxSupply: BigInt! # uint256
  token: Bytes! # address
  tokenDecimals: Int! # uint8
  whitelisted: Boolean! # bool
  restrictiveLegend: Boolean! # bool
  rate: BigInt! # uint256
  startAt: BigInt! # uint256
  endAt: BigInt! # uint256
  vestingPeriod: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type FundraisingUnvested @entity {
  id: ID!
  contract: Bytes! # address
  vestingNumber: BigInt! # uint256
  user: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type FundraisingVested @entity {
  id: ID!
  contract: Bytes! # address
  vestingNumber: BigInt! # uint256
  roundNumber: BigInt! # uint256
  user: Bytes! # address
  restrictiveLegend: Boolean! # bool
  vestingEndsAt: BigInt! # uint256
  nGovernanceTokens: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type FundraisingWhitelisted @entity {
  id: ID!
  contract: Bytes! # address
  roundNumber: BigInt! # uint256
  user: Bytes! # address
  whitelisted: Boolean! # bool
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Inherits Withdrawn from MetaOracle

######################
# OptSwapDAOAirdrops #
######################

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

type AirdropClaimed @entity {
  id: ID!
  contract: Bytes! # address
  airdropNumber: BigInt! # uint256
  user: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type AirdropCreated @entity {
  id: ID!
  contract: Bytes! # address
  airdropNumber: BigInt! # uint256
  proposalNumber: BigInt! # uint256
  user: Bytes! # address
  token: Bytes! # address
  amount: BigInt! # uint256
  vestingEndsAt: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Inherits OwnershipTransferred from MetaOracle

# Inherits Withdrawn from MetaOracle

#######################################
# OptSwapDAOToken & OptSwapDAOVeToken #
#######################################

type Approval @entity {
  id: ID!
  token: Bytes! # address
  owner: Bytes! # address
  spender: Bytes! # address
  value: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type Transfer @entity {
  id: ID!
  token: Bytes! # address
  from: Bytes! # address
  to: Bytes! # address
  value: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type RoleAdminChanged @entity {
  id: ID!
  contract: Bytes! # address
  role: Bytes! # bytes32
  previousAdminRole: Bytes! # bytes32
  newAdminRole: Bytes! # bytes32
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type RoleGranted @entity {
  id: ID!
  contract: Bytes! # address
  role: Bytes! # bytes32
  account: Bytes! # address
  sender: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type RoleRevoked @entity {
  id: ID!
  contract: Bytes! # address
  role: Bytes! # bytes32
  account: Bytes! # address
  sender: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type TokenUnescrowed @entity {
  id: ID!
  contract: Bytes! # address
  unescrowNumber: BigInt! # uint256
  escrowNumber: BigInt! # uint256
  user: Bytes! # address
  unescrowedAmount: BigInt! # uint256
  escrowedTokensBurnAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type TokenEscrowed @entity {
  id: ID!
  contract: Bytes! # address
  escrowNumber: BigInt! # uint256
  user: Bytes! # address
  escrowPeriodYears: Int! # uint8
  escrowAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type VotingRightsActivated @entity {
  id: ID!
  contract: Bytes! # address
  escrowNumber: BigInt! # uint256
  user: Bytes! # address
  escrowedTokensMintAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type EscrowTokenWithdrawn @entity {
  id: ID!
  contract: Bytes! # address
  token: Bytes! # address
  unescrowNumber: BigInt! # uint256
  user: Bytes! # address
  withdrawnAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

###########
# OptSwap #
###########

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

type OptSwapOption @entity {
  id: ID!
  contract: Bytes! # address
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  maxOpenInterestLots: BigInt! # uint256
  openInterestLots: BigInt! # uint256
  totalTrades: BigInt! # uint256
  totalVolumeLots: BigInt! # uint256
  totalTradeVolume: BigInt! # uint256
  totalUnderlyingSettlementVolume: BigInt! # uint256
  totalCashSettlementVolume: BigInt! # uint256
  totalMakerFeesEarned: BigInt! # uint256
  totalTakerFeesEarned: BigInt! # uint256
  totalUnderlyingSettlementFeesEarned: BigInt! # uint256
  totalCashSettlementFeesEarned: BigInt! # uint256
  lastTradedPrice: BigInt! # uint256
  lastTradedVolumeLots: BigInt! # uint256
  lastTradedBlockNumber: BigInt! # uint256
  lastTradedTimestamp: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapOptionMinuteData @entity {
  id: ID!
  contract: Bytes! # address
  dayNumber: BigInt! # uint256
  dayStartTimestamp: BigInt! # uint256
  hourStartTimestamp: BigInt! # uint256
  minuteStartTimestamp: BigInt! # uint256
  hourOfDay: BigInt! # uint256
  minuteOfHour: BigInt! # uint256
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  openInterestLotsOpen: BigInt! # uint256
  openInterestLotsHigh: BigInt! # uint256
  openInterestLotsLow: BigInt! # uint256
  openInterestLotsClose: BigInt! # uint256
  priceOpen: BigInt! # uint256
  priceHigh: BigInt! # uint256
  priceLow: BigInt! # uint256
  priceClose: BigInt! # uint256
  totalTrades: BigInt! # uint256
  totalVolumeLots: BigInt! # uint256
  totalTradeVolume: BigInt! # uint256
  totalUnderlyingSettlementVolume: BigInt! # uint256
  totalCashSettlementVolume: BigInt! # uint256
  totalMakerFeesEarned: BigInt! # uint256
  totalTakerFeesEarned: BigInt! # uint256
  totalUnderlyingSettlementFeesEarned: BigInt! # uint256
  totalCashSettlementFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapOptionDayData @entity {
  id: ID!
  contract: Bytes! # address
  dayNumber: BigInt! # uint256
  dayStartTimestamp: BigInt! # uint256
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  openInterestLotsOpen: BigInt! # uint256
  openInterestLotsHigh: BigInt! # uint256
  openInterestLotsLow: BigInt! # uint256
  openInterestLotsClose: BigInt! # uint256
  priceOpen: BigInt! # uint256
  priceHigh: BigInt! # uint256
  priceLow: BigInt! # uint256
  priceClose: BigInt! # uint256
  totalTrades: BigInt! # uint256
  totalVolumeLots: BigInt! # uint256
  totalTradeVolume: BigInt! # uint256
  totalUnderlyingSettlementVolume: BigInt! # uint256
  totalCashSettlementVolume: BigInt! # uint256
  totalMakerFeesEarned: BigInt! # uint256
  totalTakerFeesEarned: BigInt! # uint256
  totalUnderlyingSettlementFeesEarned: BigInt! # uint256
  totalCashSettlementFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapPosition @entity {
  id: ID!
  contract: Bytes! # address
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  orderType: Int! # uint8
  user: Bytes! # address
  belongsToAMM: Boolean! # bool
  createdAt: BigInt! # uint256
  lots: BigInt! # uint256
  lotsLocked: BigInt! # uint256
  lotsSettled: BigInt! # uint256
  openLots: BigInt! # uint256
  unlockedOpenLots: BigInt! # uint256
  lockedOpenLots: BigInt! # uint256
  settledAt: BigInt! # uint256
  averagePrice: BigInt! # uint256
  lastAveragePrice: BigInt! # uint256
  bookedProfitsOrLosses: BigInt! # int256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapLockedPosition @entity {
  id: ID!
  contract: Bytes! # address
  expiry: BigInt! # uint256
  callStrike0: BigInt! # uint256
  callStrike1: BigInt! # uint256
  putStrike0: BigInt! # uint256
  putStrike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  user: Bytes! # address
  lockedPositionsIndex: BigInt! # int256
  lots: BigInt! # uint64
  manuallyConverted: Boolean! # bool
  cashMarginDiscount: BigInt! # uint256
  positionConversionFeesEarned: BigInt! # uint256
  lotsUnlocked: BigInt! # uint64
  lotsSettled: BigInt! # uint64
  openLots: BigInt! # uint256
  totalCashMarginRefunds: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapLockedPositionSettlement @entity {
  id: ID!
  contract: Bytes! # address
  lockedPositionsIndex: BigInt! # int256
  lotsSettled: BigInt! # uint64
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapManagePosition @entity {
  id: ID!
  contract: Bytes! # address
  sender: Bytes! # address
  mode: Int! # uint8
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  orderType: Int! # uint8
  user: Bytes! # address
  lots: BigInt! # uint64
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapOrder @entity {
  id: ID!
  logIndex: BigInt! # uint256
  orderNumber: BigInt! # uint256
  contract: Bytes! # address
  orderType: Int! # uint8
  instruction: Int! # uint8
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  premium: BigInt! # uint256
  lots: BigInt! # uint256
  lotsCancelled: BigInt! # uint256
  lotsFilled: BigInt! # uint256
  openLots: BigInt! # uint256
  createdAt: BigInt! # uint256
  filledAt: BigInt! # uint256
  cancelledAt: BigInt! # uint256
  memo: BigInt! # uint256
  user: Bytes! # address
  orderBookIndex: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Inherits OwnershipTransferred from MetaOracle

type OptSwapSettlement @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  lots: BigInt! # uint64
  settlementType: Int! # uint8
  counterparty: Bytes! # address
  intrinsicValue: BigInt! # uint256
  underlyingSettlementFeesEarned: BigInt! # uint256
  cashSettlementFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapSettlementSwap @entity {
  id: ID!
  contract: Bytes! # address
  token0In: BigInt! # uint256
  token0Out: BigInt! # uint256
  token1In: BigInt! # uint256
  token1Out: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapSettlementsExecutionPointsAwarded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  settlementsExecutionPointsAwarded: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapSettlementsExecutionRewardWithdrawn @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  settlementsExecutionReward: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapFeesTransfer @entity {
  id: ID!
  contract: Bytes! # address
  token0FeesDisbursalContract: Bytes! # address
  totalUnderlyingFeesAmount: BigInt! # uint256
  underlyingSettlementFeesEarned: BigInt! # uint256
  token1FeesDisbursalContract: Bytes! # address
  totalCashFeesAmount: BigInt! # uint256
  makerFeesEarned: BigInt! # uint256
  takerFeesEarned: BigInt! # uint256
  cashSettlementFeesEarned: BigInt! # uint256
  positionConversionFeesEarned: BigInt! # uint256
  user: Bytes! # address
  underlyingReward: BigInt! # uint256
  cashReward: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapTrade @entity {
  id: ID!
  logIndex: BigInt! # uint256
  tradeNumber: BigInt! # uint256
  contract: Bytes! # address
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  price: BigInt! # uint256
  lots: BigInt! # uint256
  lockedPositionIndex: BigInt! # int256
  buyer: Bytes! # address
  seller: Bytes! # address
  maker: Bytes! # address
  taker: Bytes! # address
  makerOrderBookIndex: BigInt! # uint256
  takerOrderBookIndex: BigInt! # uint256
  takerPremium: BigInt! # uint256
  buyerTaker: Boolean! # bool
  makerInstruction: Int! # uint8
  takerInstruction: Int! # uint8
  makerMemo: BigInt! # uint256
  takerMemo: BigInt! # uint256
  makerFeesEarned: BigInt! # uint256
  takerFeesEarned: BigInt! # uint256
  openInterestLots: BigInt! # uint256
  totalVolumeLots: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapOrderTradeLookup @entity {
  id: ID!
  optSwapTradeId: String! # string
}

type OptSwapUnlockedPosition @entity {
  id: ID!
  contract: Bytes! # address
  lockedPositionsIndex: BigInt! # int256
  lotsUnlocked: BigInt! # uint64
  cashMarginDeposit: BigInt! # uint256
  cashMarginRefund: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapToken0TransferIn @entity {
  id: ID!
  contract: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapToken0TransferOut @entity {
  id: ID!
  contract: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapToken1TransferIn @entity {
  id: ID!
  contract: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapToken1TransferOut @entity {
  id: ID!
  contract: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapUserTransfer @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  sender: Bytes! # address
  underlyingDiff: BigInt! # uint256
  underlyingPullIn: Boolean! # bool
  cashDiff: BigInt! # uint256
  cashPullIn: Boolean! # bool
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapWithdrawn @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  totalUnderlyingAmount: BigInt! # uint256
  underlyingRefunds: BigInt! # uint256
  underlyingSettled: BigInt! # uint256
  totalCashAmount: BigInt! # uint256
  premiumsEarned: BigInt! # uint256
  premiumRefunds: BigInt! # uint256
  cashRefunds: BigInt! # uint256
  cashSettled: BigInt! # uint256
  feesRefunds: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapRewardAdded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  reward: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

#####################
# OptSwapDAOStaking #
#####################

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

type StakingRewardAdded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  reward: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type StakingRewardPaid @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  reward: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type StakingStaked @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type StakingWithdrawn @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

##################################
# OptSwapDAOCommercialPaperToken #
##################################

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

# Inherits Approval from OptSwapDAOToken

# Inherits Transfer from OptSwapDAOToken

# Inherits OwnershipTransferred from MetaOracle

type CommercialPaperRedeemed @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  amount: BigInt! # uint256
  redemptionAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type CommercialPaperSubscribed @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  amount: BigInt! # uint256
  depositAmount: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type CommercialPaperWhitelisted @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  whitelisted: Boolean! # bool
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Inherits Withdrawn from MetaOracle

##############
# OptSwapAMM #
##############

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

type OptSwapAMM @entity {
  id: ID!
  contract: Bytes! # address
  contractLogic: Bytes! # address
  optSwapContract: Bytes! # address
  governanceToken: Bytes! # address
  standardStrikeDistance: BigInt! # uint32
  expiryStart: BigInt! # uint64
  expiryFrequency: BigInt! # uint32
  token0Reserves: BigInt! # uint256
  token1Reserves: BigInt! # uint256
  totalMatchFinderFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMDayData @entity {
  id: ID!
  contract: Bytes! # address
  dayNumber: BigInt! # uint256
  dayStartTimestamp: BigInt! # uint256
  token0Reserves: BigInt! # uint256
  token1Reserves: BigInt! # uint256
  totalMatchFinderFeesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMMatchFinderFeesEarned @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  lots: BigInt! # uint32
  feesEarned: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMMatchFinderFeesRefundsWithdrawn @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  feesRefunds: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMMatchFinderPointsAwarded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  pointsAwarded: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMLiquidityProviderPointsAwarded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  pointsAwarded: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMManagedOrderCancellationPointsAwarded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  pointsAwarded: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMManagedOrderCancelled @entity {
  id: ID!
  contract: Bytes! # address
  managedOrderNumber: BigInt! # uint256
  lotsCancelled: BigInt! # uint32
  matchFinderFeesHoldRefunds: BigInt! # uint256
  managedOrderCancellationPointsEarned: BigInt! # uint256
  sender: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMManagedOrder @entity {
  id: ID!
  contract: Bytes! # address
  managedOrderNumber: BigInt! # uint256
  orderType: Int! # uint8
  instruction: Int! # uint8
  optionStyle: Int! # uint8
  optionType: Int! # uint8
  lotSize: BigInt! # uint256
  lots: BigInt! # uint32
  lotsCancelled: BigInt! # uint256
  lotsFilled: BigInt! # uint256
  openLots: BigInt! # uint256
  memo: BigInt! # uint32
  validUntil: BigInt! # uint256
  spotPriceAggregationTypeForStrike0: Int! # uint8
  spotPriceAggregationTypeForStrike1: Int! # uint8
  TWAPDuration0: BigInt! # uint32
  TWAPDuration1: BigInt! # uint32
  TWAPDuration2: BigInt! # uint32
  TWAPDuration3: BigInt! # uint32
  TWAPDuration4: BigInt! # uint32
  inTheMoneyMultiplier: BigInt! # uint256
  outOfTheMoneyMultiplier: BigInt! # uint256
  expiryLower: BigInt! # uint256
  expiryUpper: BigInt! # uint256
  strike0Lower: BigInt! # uint256
  strike0Upper: BigInt! # uint256
  strike1Lower: BigInt! # uint256
  strike1Upper: BigInt! # uint256
  premiumLower: BigInt! # uint256
  premiumUpper: BigInt! # uint256
  deltaLower: Int! # int16
  deltaUpper: Int! # int16
  impliedVolatilityStrike0: BigInt! # uint32
  impliedVolatilityStrike1: BigInt! # uint32
  interestRate: BigInt! # uint32
  dividendYield: BigInt! # uint32
  user: Bytes! # address
  totalMatchFinderFeesHold: BigInt! # uint128
  matchFinderFeesPerLot: BigInt! # uint96
  maxFees: BigInt! # uint32
  createdAt: BigInt! # uint256
  filledAt: BigInt! # uint256
  cancelledAt: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMManagedOrderExecuted @entity {
  id: ID!
  contract: Bytes! # address
  managedOrderNumber: BigInt! # uint256
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  expiry: BigInt! # uint256
  premium: BigInt! # uint256
  lots: BigInt! # uint32
  matchFinder: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMManagedOrderFill @entity {
  id: ID!
  contract: Bytes! # address
  managedOrderNumber: BigInt! # uint256
  lotsFilled: BigInt! # uint32
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMManagedOrderModified @entity {
  id: ID!
  contract: Bytes! # address
  managedOrderNumber: BigInt! # uint256
  lots: BigInt! # uint8
  memo: BigInt! # uint32
  validUntil: BigInt! # uint64
  premiumLower: BigInt! # uint128
  premiumUpper: BigInt! # uint128
  deltaLower: Int! # int16
  deltaUpper: Int! # int16
  inTheMoneyMultiplier: BigInt! # uint32
  outOfTheMoneyMultiplier: BigInt! # uint32
  spotPriceAggregationTypeForStrike0: Int! # uint8
  spotPriceAggregationTypeForStrike1: Int! # uint8
  TWAPDuration0: BigInt! # uint32
  TWAPDuration1: BigInt! # uint32
  TWAPDuration2: BigInt! # uint32
  TWAPDuration3: BigInt! # uint32
  TWAPDuration4: BigInt! # uint32
  impliedVolatilityStrike0: BigInt! # uint32
  impliedVolatilityStrike1: BigInt! # uint32
  interestRate: BigInt! # uint32
  dividendYield: BigInt! # uint32
  maxFees: BigInt! # uint32
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

# Inherits OwnershipTransferred from MetaOracle

type OptSwapAMMRewardAdded @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  reward: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMRewardsAndFeesPaid @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  matchFinderPoints: BigInt! # uint256
  matchFinderReward: BigInt! # uint256
  liquidityProviderPoints: BigInt! # uint256
  liquidityProviderReward: BigInt! # uint256
  managedOrderCancellationPoints: BigInt! # uint256
  managedOrderCancellationReward: BigInt! # uint256
  matchFinderFeesPaid: BigInt! # uint256
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

type OptSwapAMMToCloseOrder @entity {
  id: ID!
  contract: Bytes! # address
  optionStyle: Int! # uint8
  expiry: BigInt! # uint256
  optionType: Int! # uint8
  strike0: BigInt! # uint256
  strike1: BigInt! # uint256
  lotSize: BigInt! # uint256
  orderType: Int! # uint8
  premium: BigInt! # uint256
  lots: BigInt! # uint256
  orderBookIndex: BigInt! # uint256
  onBehalfOfUser: Bytes! # address
  blockNumber: BigInt! # uint256
  timestamp: BigInt! # uint256
}

###########################
# OptSwapDAOTestnetFaucet #
###########################

# Inherits ProxyAdminChanged & ProxyUpgraded from MetaOracle

type TestnetFaucetClaimed @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  token: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256 
  timestamp: BigInt! # uint256
}

# Inherits OwnershipTransferred from MetaOracle

type TestnetFaucetWhitelisted @entity {
  id: ID!
  contract: Bytes! # address
  user: Bytes! # address
  token: Bytes! # address
  amount: BigInt! # uint256
  blockNumber: BigInt! # uint256 
  timestamp: BigInt! # uint256
}

# Inherits Withdrawn from MetaOracle

```


# Querying

The OptSwap subgraphs are queryable using standard GraphQL.&#x20;

{% hint style="info" %}
Please note that not all GraphQL query types or aggregations are supported. Please refer to The Graph documents linked below. The OptSwap subgraphs do not support mutations.
{% endhint %}

Explaining the basic GraphQL query syntax is out-of-scope for this document. Links to The Graphs official documentation are provided below. Please refer to the [example queries](/technical-reference/subgraphs/querying/example-queries) to get started.

### GraphQL Basics & API

{% embed url="<https://thegraph.com/docs/en/developer/querying-from-your-app/>" %}
The Graph Official Documentation – Querying from an Application
{% endembed %}

{% embed url="<https://thegraph.com/docs/en/developer/graphql-api/>" %}
The Graph Official Documentation – GraphQL API
{% endembed %}


# Example Queries

Assuming your address is `0xd8da6bf26964af9d7eed9e03e53415d37aa96045` (Hi Vitalik 👋), here are some sample GraphQL queries to get you quickly started with OptSwaps subgraphs. Feel free to explore all the other entities and fields available!

{% hint style="info" %}
Refer to the associated smart contracts documentation for full details about the various returned enumerated types and denominations.
{% endhint %}

### My Orders

```graphql
# All My Orders
query MyOrders {
  optSwapOrders(where: { user: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" }) {
    id
    contract
    optionStyle
    optionType
    strike0
    strike1
    expiry
    lotSize
    orderType
    premium
    lots
    user
    timestamp
    blockNumber
  }
}

# Response:
{
  "data": {
    "optSwapOrders": [
      {
        "id": "0x18bb81e4153528cd8823857726b2ca6f994450ae010bd20a9bb5550436fb6498-2",
        "contract": "0xdbebcddf47ea77561ab5f98c40baf2f89a6770d4",
        "optionStyle": 0, # European Style Option
        "optionType": 1, # Call Option
        "strike0": "12000000", # in basis points of the cash token
        "strike1": "170141183460469231731687303715884105728", # 2^127 for Call Options
        "expiry": "1657267200", # Unix timestamp
        "lotSize": "10000", # in basis points
        "orderType": 1, # Buy Order
        "premium": "100", # in basis points of the cash token
        "lots": "10",
        "user": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "timestamp": "1656920647", # Unix timestamp
        "blockNumber": "27025991"
      },
      ...
    ]
  }
}
```

### My Positions

```graphql
# All My Positions for a given expiry timestamp
query MyPositionsForLastExpiry {
  optSwapPositions(where: { expiry: "1657267200",  user: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" }) {
    id
    contract
    optionStyle
    optionType
    strike0
    strike1
    expiry
    lotSize
    orderType
    lots
    lotsLocked
    lotsSettled
    bookedProfitsOrLosses
    user
    createdAt
    timestamp
    blockNumber
  }
}

# Response:
{
  "data": {
    "optSwapPositions": [
      {
        "id": "0xaccd7b5f1adaab6f911d3a944adcb5966ee220cfbf104e5e3cdd6e4803fec876",
        "contract": "0xdbebcddf47ea77561ab5f98c40baf2f89a6770d4",
        "optionStyle": 1, # American Style Option
        "optionType": 0, # Put Option
        "strike0": "12000000", # in basis points of the cash token
        "strike1": "0", # in basis points
        "expiry": "1657267200", # Unix timestamp
        "lotSize": "10000", # in basis points (of the underlying token)
        "orderType": 0, # Sell Order
        "lots": "3",
        "lotsLocked": "0",
        "lotsSettled": "3",
        "bookedProfitsOrLosses": "-372000000", # Negative values mean losses; in subunits of the Cash Token
        "user": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "createdAt": "1656919724", # Unix timestamp
        "timestamp": "1656919724", # Unix timestamp
        "blockNumber": "27025831"
      },
      ...
    ]
  }
}
```

### Latest Blocks

```graphql
# The latest block indexed by the subgraph
query LastIndexedBlock {
  latestBlock(id: "latest") {
    id
    timestamp
    number
  }
}

# Response:
{
  "data": {
    "latestBlock": {
      "id": "latest",
      "timestamp": "1657379691", # Unix timestamp
      "number": "27097838"
    }
  }
}

# Latest blocks in which each contract was interacted with
query ContractInteractionLatestBlocks {
  latestBlocks {
    id
    timestamp
    number
  }
}

# Response:
{
  "data": {
    "latestBlocks": [
      {
        "id": "MetaOracle",
        "timestamp": "1657365133", # Unix timestamp
        "number": "27095701" # Block number
      },
      {
        "id": "OptSwap-0x83577b77c5a0a169883bc5cd5d7585cc77c94358",
        "timestamp": "1656862308",
        "number": "27017041"
      },
      ...
      {
        "id": "OptSwapDAOVeToken",
        "timestamp": "1656863802",
        "number": "27017299"
      },
      {
        "id": "latest",
        "timestamp": "1657386405",
        "number": "27099049"
      }
    ]
  }
}
```


# REST API

"Truth can only be found in one place: the code." — Robert C. Martin

TODO -- aggregated data which would require too many subgraph queries


# Endpoints

The REST APIs are deployed at the following endpoints and are sharded by blockchain network.

{% hint style="danger" %}
**Always ensure that you are querying only the official endpoints listed on this page! Any endpoints not listed on this page should be strictly avoided! You may receive incorrect or corrupted data from malicious endpoints!**
{% endhint %}

### **Optimism Sepolia Testnet (L2)**

* **Node 0:** `https://optest-node0.optswap.org/api/*`
* **Node 1:** `https://optest-node1.optswap.org/api/*`

### **BNB Smart Chain (BSC) Testnet**

TODO -- tBNB (coming soon!)


# API Methods

The OptSwap API is queryable using standard HTTPS (REST) requests.&#x20;

{% hint style="info" %}
The OptSwap API is read-only, limited in scope and has been developed to overcome some of the drawbacks of querying The Graph (specifically the lack of grouping and aggregation). It cannot be used to send transactions or interact with the smart contracts.
{% endhint %}

TODO -- API Methods


# Terms and Conditions

Last Updated: July 31 2024

These OptSwap Terms and Conditions are entered into between you (hereinafter referred to as "you",  "your" or "user") and OptSwap DAO Inc., incorporated under The BVI Business Companies Act, 2004 (hereinafter referred to as "OptSwap" or "OptSwap DAO"; as defined below).

By accessing, downloading, using or clicking on the "I Agree" button to accept any OptSwap Services (as defined below) provided by OptSwap (as defined below), you agree that you have read, understood and accepted the Privacy Policy, all of the Risk Warnings and Terms and Conditions stipulated (hereinafter referred to as "Terms") in this document.

Please read all the terms carefully as they govern your use of OptSwap. **THESE TERMS CONTAIN IMPORTANT PROVISIONS INCLUDING AN ARBITRATION PROVISION THAT REQUIRES ALL CLAIMS TO BE RESOLVED BY WAY OF LEGALLY BINDING ARBITRATION.** The terms of the arbitration provision are set forth in the Article IX, "Resolving Disputes: Arbitration, Class Action Waiver", hereunder. As with any asset, the values of Crypto Assets (as defined below) may fluctuate significantly and there is a substantial risk of economic losses when purchasing, selling, holding or investing in Crypto Assets and their derivatives.

**BY MAKING USE OF OPTSWAP SERVICES, YOU ACKNOWLEDGE AND AGREE THAT: (1) YOU ARE AWARE OF THE RISKS ASSOCIATED WITH TRANSACTIONS OF CRYPTO ASSETS AND THEIR DERIVATIVES INCLUDING, BUT NOT LIMITED TO, THE RISKS LISTED IN THE RISK WARNINGS DOCUMENT; (2) YOU SHALL ASSUME ALL RISKS RELATED TO THE USE OF OPTSWAP SERVICES AND TRANSACTIONS OF CRYPTO ASSETS AND THEIR DERIVATIVES; AND (3) OPTSWAP DAO SHALL NOT BE LIABLE FOR ANY SUCH RISKS OR ADVERSE OUTCOMES.**

By accessing, using or attempting to use OptSwap Services in any capacity, you acknowledge that you accept and agree to be bound by these Terms. If you do not agree, do not access OptSwap or utilize OptSwap Services.

### I. Definitions

1. **OptSwap** refers to a Decentralized Application (DApp) comprising OptSwap websites (whose domain includes but is not limited to https\://\*.optswap.org), desktop or mobile applications, blockchain applications, smart contracts, clients, governance and other applications that are developed to offer OptSwap Services.
2. **OptSwap DAO** refers to the Decentralized Autonomous Organization (DAO) that runs OptSwap, including but not limited to legal persons, unincorporated organizations and teams that provide OptSwap Services and are responsible for such services. For convenience, unless otherwise stated, references to "OptSwap", "we" and "us" in these Terms specifically mean OptSwap DAO. UNDER THESE TERMS, OPTSWAP DAO MAY CHANGE AS OPTSWAP'S REQUIREMENTS ADJUST, IN WHICH CASE, THE CHANGED ORGANIZATION SHALL PERFORM THEIR OBLIGATIONS UNDER THESE TERMS WITH YOU AND PROVIDE SERVICES TO YOU, AND SUCH CHANGE DOES NOT AFFECT YOUR RIGHTS AND INTERESTS UNDER THESE TERMS. ADDITIONALLY, THE SCOPE OF OPTSWAP DAO MAY BE EXPANDED DUE TO THE PROVISION OF NEW OPTSWAP SERVICES, IN WHICH CASE, IF YOU CONTINUE TO USE OPTSWAP SERVICES, IT IS DEEMED THAT YOU HAVE AGREED TO JOINTLY EXECUTE THESE TERMS WITH THE NEWLY ADDED OPTSWAP DAO. IN CASE OF A DISPUTE, YOU SHALL DETERMINE THE ENTITIES BY WHICH THESE TERMS ARE PERFORMED WITH YOU AND THE COUNTERPARTIES OF THE DISPUTE, DEPENDING ON THE SPECIFIC SERVICES YOU USE AND THE PARTICULAR ACTIONS THAT AFFECT YOUR RIGHTS OR INTERESTS.
3. **OptSwap Services** refer to various services provided to you by OptSwap that are based on Internet and Blockchain technologies and offered via the OptSwap websites, desktop or mobile applications, blockchain applications, smart contracts, clients and other forms (including future developments). OptSwap Services include but are not limited to the Decentralized Exchange, Automated Market Maker, Meta Oracle, Governance, Fundraising, Airdrops, Staking and Commercial Paper programs.
4. **User** refers to any individual, institution or organization that accesses, downloads or uses OptSwap or OptSwap Services and who meet all the criteria required by and conditions set forth by OptSwap.
5. **Crypto Assets** refer to digital cryptocurrencies, tokens, options, option spreads, derivatives or other types of digital assets with a certain value that are based on blockchain and/or cryptographic technology.
6. **Crypto-to-Crypto Trading** refer to transactions in which one crypto asset is exchanged for another crypto asset.
7. **"KYC"** refers to the "Know-Your-Customer" processes and **"AML"** refers to "Anti-Money-Laundering" processes that OptSwap has put in place to comply with any applicable law or regulation.

### II. General Provisions

#### 1. Contractual Relationship

These Terms constitute a legal agreement and create a binding contract between you and OptSwap DAO.

#### 2. Changes to These Terms

OptSwap reserves the right to change or modify these Terms in its discretion at any time. OptSwap will notify such changes by updating the terms on its website and modifying the \[Last Revised] date displayed on this page. ANY AND ALL MODIFICATIONS OR CHANGES TO THESE TERMS WILL BECOME EFFECTIVE UPON PUBLICATION ON THE WEBSITE OR RELEASE TO USERS. THEREFORE, YOUR CONTINUED USE OF OPTSWAP SERVICES IS DEEMED YOUR ACCEPTANCE OF THE MODIFIED AGREEMENT AND RULES. IF YOU DO NOT AGREE TO ANY CHANGES TO THESE TERMS, YOU MUST STOP USING OPTSWAP SERVICES IMMEDIATELY. YOU ARE RECOMMENDED TO BOOKMARK AND FREQUENTLY REVIEW THESE TERMS TO ENSURE YOUR UNDERSTANDING OF THE TERMS AND CONDITIONS THAT APPLY TO YOUR ACCESS TO AND USE OF OPTSWAP SERVICES.

#### 3. Prohibition of Use

BY ACCESSING AND USING OPTSWAP SERVICES, YOU REPRESENT AND WARRANT THAT YOU HAVE NOT BEEN INCLUDED IN ANY TRADE EMBARGOES OR ECONOMIC SANCTIONS LIST (SUCH AS THE UNITED NATIONS SECURITY COUNCIL SANCTIONS LIST), THE LIST OF SPECIALLY DESIGNATED NATIONALS MAINTAINED BY OFAC (THE OFFICE OF FOREIGN ASSETS CONTROL OF THE U.S. DEPARTMENT OF THE TREASURY), OR THE DENIED PERSONS OR ENTITY LIST OF THE U.S. DEPARTMENT OF COMMERCE, OR ANY OTHER SIMILAR LIST FROM ANY OTHER JURISDICTION. OPTSWAP RESERVES THE RIGHT TO CHOOSE MARKETS AND JURISDICTIONS TO CONDUCT OPERATIONS, AND MAY RESTRICT OR REFUSE, IN ITS DISCRETION, THE PROVISION OF OPTSWAP SERVICES IN CERTAIN COUNTRIES OR REGIONS.

#### 4. Eligibility

By using OptSwap, you represent and warrant that (i) as an individual, you are at least 18 or are of legal age to form a binding contract under applicable laws; (ii) as an individual, legal person, or other organization, you have full legal capacity and sufficient authorizations to enter into these Terms; (iii) you are not violating any local or international laws applicable to you, including but not limited to regulations on taxation, anti-money laundering, anti-corruption, and counter-terrorist financing.

If you act as an employee or agent of a legal entity, and enter into these Terms on their behalf, you represent and warrant that you have all the necessary rights and authorizations to bind such legal entity; (iv) your use of OptSwap Services will not violate any and all laws and regulations applicable to you or them, including but not limited to regulations on taxation, anti-money laundering, anti-corruption, and counter-terrorist financing.

#### 5. Account Security

OptSwap is committed to maintaining the best security practices, and has implemented industry standard protection for OptSwap Services. However, the actions of the Users themselves may pose risks. You shall agree to treat your access credentials (such as your private key or seed phrase) as confidential information, and not to disclose such information to any third party. You also agree to be solely responsible for taking the necessary security measures to protect your Crypto Asset wallet and personal information.

OptSwap assumes no liability for any loss or consequences caused by authorized or unauthorized use of your account credentials, including but not limited to information disclosure, information release, consent or submission of various rules and agreements by clicking on the website, etc.

#### 5. Taxation

You acknowledge that you are solely responsible for any and all Tax Liabilities payable in all the legal jurisdictions that you are taxed under; and that OptSwap DAO does not withhold or remit any taxes on your behalf under any legal jurisdiction.

### III. Services

#### 1. License

Provided that you constantly comply with the express terms and conditions stated in these Terms, OptSwap grants you a revocable, limited, royalty-free, non-exclusive, non-transferable, and non-sublicensable license to access and use OptSwap Services through your computer or Internet compatible devices for your business purposes. You are prohibited to use OptSwap Services for resale or commercial purposes, including transactions on behalf of other persons or entities. All the above actions are expressly prohibited and constitute a material violation of these Terms. The content layout, format, function and access rights regarding OptSwap Services should be stipulated in the discretion of OptSwap. OptSwap reserves all rights not expressly granted in these Terms. Therefore, you are hereby prohibited from using OptSwap Services in any way not expressly authorized by these Terms.

These Terms only grant a limited license to access and use OptSwap Services. Therefore, you hereby agree that when you use OptSwap Services, OptSwap does not transfer OptSwap Services or the ownership or intellectual property rights of any OptSwap intellectual property to you or anyone else. All the text, graphics, user interfaces, visual interface, photos, sounds, process flow diagrams, computer code (including HTML, CSS, Javascript, Solidity, or other code), programs, software, products, information and documents, as well as the design, structure, selection, coordination, expression, look and feel, and layout of any content included in the services or provided through OptSwap Services, are exclusively owned, controlled and/or licensed by OptSwap DAO or its members, licensors or affiliates.

OptSwap owns any feedback, suggestions, ideas, or other information or materials (hereinafter collectively referred to as "Feedback") about OptSwap or OptSwap Services that you provide through email, chat, social media, OptSwap Services, or any other way. You hereby transfer all rights, ownership and interests of the Feedback and all related intellectual property rights to OptSwap. You have no right and hereby waive any request for acknowledgment or compensation based on any Feedback, or any modifications based on any Feedback.

#### 2. Restriction

When you use OptSwap Services, you agree and undertake to comply with the following provisions:

1. During the use of OptSwap Services, all activities you carry out should comply with the requirements of applicable laws and regulations, these Terms, and various guidelines of OptSwap; Your use of OptSwap Services should not violate public interests, public morals, or the legitimate interests of others, including any actions that would interfere with, disrupt, negatively affect, or prohibit other Users from using OptSwap Services; You agree not to use the services for market manipulation (such as pump and dump schemes, wash trading, self-trading, front running, quote stuffing, and spoofing or layering, regardless of whether prohibited by law or not).
2. Without prior written consent from OptSwap, you may not modify, replicate, duplicate, copy, download, store, further transmit, disseminate, transfer, disassemble, broadcast, publish, remove or alter any copyright statement or label, or license, sub-license, sell, mirror, design, rent, lease, private label, grant security interests in the properties or any part of the properties, or create their derivative works or otherwise take advantage of any part of the properties.
3. You may not:

   \
   (i) use any deep linking, web crawlers, bots, spiders or other automatic devices, programs, scripts, algorithms or methods, or any similar or equivalent manual processes to access, obtain, copy or monitor any part of the properties, or replicate or bypass the navigational structure or presentation of OptSwap Services in any way, in order to obtain or attempt to obtain any materials, documents or information in any manner not purposely provided through OptSwap Services;

   \
   (ii) attempt to access any part or function of the properties without authorization, or connect to OptSwap Services or any other systems or networks of any OptSwap Services provided through the services by hacking, password mining or any other unlawful or prohibited means;

   \
   (iii) probe, scan or test the vulnerabilities of OptSwap Services or any network connected to the properties, or violate any security or authentication measures on OptSwap Services or any network connected to OptSwap Services;

   \
   (iv) reverse look-up, track or seek to track any information of any other Users or visitors of OptSwap Services;

   \
   (v) take any actions that imposes an unreasonable or disproportionately large load on the infrastructure of systems or networks of OptSwap Services or OptSwap, or the infrastructure of any systems or networks connected to OptSwap services;

   \
   (vi) use any devices, software or routine programs to interfere with the normal operation of OptSwap Services or any transactions on OptSwap Services, or any other persons use of OptSwap Services;

   \
   (vii) forge headers, impersonate, or otherwise manipulate identification, to disguise your identity or the origin of any messages or transmissions you send to OptSwap, or

   \
   (viii) use OptSwap Services in an illegal way.
4. By accessing OptSwap Services, you agree that OptSwap has the right to investigate any violation of these Terms, unilaterally determine whether you have violated these Terms, and take actions under relevant regulations without your consent or prior notice. Examples of such actions include, but are not limited to publishing the alleged violations and actions that have been taken, reporting the incident to the authorities and pursuing legal action to the maximum extent permitted under applicable law.

#### 3. Crypto-to-Crypto Trading

You may conduct Crypto-to-Crypto Trading on OptSwap in accordance with the provisions of these Terms.

1. Orders: Upon sending an instruction of using OptSwap Services for Crypto-to-Crypto Trading (an "Order"), your account will be immediately updated to reflect the open Orders, and your Orders will be included in OptSwap's order book to match other users’ Orders. If one of your Orders fully or partially matches another users Order, OptSwap will execute an exchange (a "Trade"). Once the Trade is executed, your account will be updated to reflect that the Order has been fully executed and closed, or the Order has been partially executed. The Order will remain uncompleted or partially filled until it is fully executed or cancelled under paragraph (2) below. To conclude a Trade, you authorize OptSwap smart contracts to temporarily control the Crypto Asset involved in your Trade.
2. Order Cancellation: For Orders initiated through OptSwap Services, you may only cancel them before they have been matched with other Users’ Orders. Once your Order has been matched with another users Order, you may not change, revoke or cancel OptSwap's authorization to complete the Trade. For any partially matched Order, you may cancel the unmatched part of the Order unless such portion has been matched. If your wallet does not have sufficient amount of Crypto Assets to execute an Order, OptSwap will reject the entire Order. In each case, any Trade related fees payable to OptSwap are deducted as stated in paragraph (3) below).
3. Fees: You agree to pay OptSwap the fees specified in the Trading Fees section of the documentation. OptSwap may, in its discretion, update the fees at any time. Any updated fees will apply to any Trades that occur following the effective date of the updated fees. You authorize OptSwap to deduct from your account any applicable fees that you owe under these Terms.

#### 4. Options Trading

You acknowledge and agree that:

1. You fully understand the risks of Options Trading, including but not limited to the risk of a partial or total loss of Premium or Margin paid (Loss of Capital);
2. You have sufficient investment knowledge and experience and the capacity to take risks arising from Options Trading, and agree to fully assume all the risks arising from the activity of Options Trading;
3. Before performing Options Trading, you have read and understood all the relevant Terms, and have consulted relevant professionals to make informed decisions on whether and how to complete Options Trading according to their recommendations and your own reasonable judgment.

#### 5. Staking & Airdrops Programs

OptSwap will from time to time launch Staking & Airdrops Programs for specific types of Crypto Assets to reward, as per certain rules, users who stake such Crypto Assets in OptSwap smart contracts or for any other reason. When participating in Staking & Airdrops Programs, you should note that:

1. Unless otherwise stipulated by OptSwap, Staking & Airdrops Programs are free of charge and Users may trade during the staking or vesting period;
2. OptSwap does not guarantee Users’ principal, interest, rewards or proceeds under any Staking or Airdrops Program;
3. OptSwap has the right to initiate or terminate Staking or Airdrops Program for any Crypto Assets or modify rules on such programs in its sole discretion;
4. Users shall ensure that sources of the Crypto Assets they hold in OptSwap Accounts are legal and compliant and undertake to observe related laws and regulations related to Airdrops or Staking Rewards, including but not limited to regulations under taxation.

#### 6. Fundraising & Commercial Paper Programs

OptSwap will from time to time launch Fundraising & Commercial Paper Programs for specific types of Crypto Assets to raise funds, as per certain rules, from users. When participating in Fundraising or Commercial Paper Programs, you should note that:

1. Unless otherwise stipulated by OptSwap, Fundraising & Commercial Paper Programs are free of charge and Users may trade during the fundraising, issue or vesting period;
2. OptSwap does not guarantee Users’ principal, interest, or proceeds under any Fundraising or Commercial Paper Program;
3. OptSwap has the right to initiate or terminate Fundraising or Commercial Paper Programs for any Crypto Assets or modify rules on such programs in its sole discretion;
4. You understand and accept that participating in Fundraising or Commercial Paper Programs:\
   \
   (i) is non-refundable and cannot be exchanged for cash (or its equivalent value in any other Crypto Asset or Non-Crypto Asset) or any payment obligation by OptSwap;\
   \
   (ii) does not represent or confer on you any ownership right, shareholding, participation, right, title, or interest of any form with respect to OptSwap DAO or any other enterprise or undertaking, or any of their revenues or assets, including without limitation any right to receive future revenue, dividends, shares, tokens, ownership right or stake, share or security, any voting, distribution, redemption, liquidation, proprietary (including all forms of intellectual property), right to receive accounts, financial statements or other financial data, the right to requisition or participate in shareholder or token holder meetings, the right to nominate a director or governor or other financial or legal rights or equivalent rights, or intellectual property rights or any other form of participation in or relating to OptSwap, OptSwap DAO, OptSwap Services and/or any affiliates and their respective token holders, members, governors, officers, employees, attorneys, agents, representatives, suppliers or contractors of OptSwap;\
   \
   (iii) is not intended to be a representation of currency or money (whether fiat or virtual or Crypto Assets or any form of electronic money), security, commodity, bond, debt instrument, unit in a collective investment scheme or any other kind of financial instrument or security or investment;\
   \
   (iv) is not a loan to OptSwap DAO and is not intended to represent a debt owed by OptSwap DAO, and there shall be no expectation of profit or interest income arising in connection therewith;\
   \
   (v) does not provide you with any guarantees or warranties or ownership or any other interest in OptSwap DAO or OptSwap Services;\
   \
   (vi) is not any form of financial derivative;\
   \
   (vii) is not any form of negotiable instrument;\
   \
   (viii) will not entitle token holders to any promise of fees, dividends, revenue, profits or investment returns, nor should there be any such expectation;\
   \
   (ix) is not any note, debenture, warrant or other certificate that entitles the holder to any interest, dividend or any kind of return from OptSwap DAO or any person;\
   \
   (x) is not any commodity or asset that any person is obliged to purchase or redeem;\
   \
   (xi) is not for speculative investment;\
   \
   (xii) is not intended to constitute securities in the United States of America (USA), Canada, United Arab Emirates (UAE), United Kingdom (UK), the European Union (EU), Switzerland, India, Japan, South Korea, Singapore, Australia, South Africa, Brazil, Mexico, Cayman Islands, British Virgin Islands (BVI), the Bahamas or any other jurisdiction;\
   \
   (xiii) does not result in any mutual covenants, or agreement to rights and obligations, being entered into between you and other holders of OptSwap DAO governance tokens inter se; and\
   \
   (xiv) is subject to limitations and conditions in these Terms and all applicable policies as may be updated from time to time.
5. Users shall ensure that sources of the Crypto Assets they employ in Fundraising & Commercial Paper Programs are legal and compliant and undertake to observe related laws and regulations related to Capital Gains or Interest Earnings, including but not limited to regulations under taxation.
6. **RESTRICTIVE LEGEND: THE TOKENS EVIDENCED BY THE FUNDRAISING ROUNDS OR COMMERCIAL PAPER CERTIFICATES HAVE NOT BEEN REGISTERED UNDER THE SECURITIES ACT OF 1933, AS AMENDED (THE "SECURITIES ACT"), OR ANY OTHER APPLICABLE SECURITIES LAWS AND HAVE BEEN ISSUED IN RELIANCE UPON AN EXEMPTION FROM THE REGISTRATION REQUIREMENTS OF THE SECURITIES ACT UNDER SECTION 4(A)(2) AND SUCH OTHER SECURITIES LAWS. NEITHER THESE TOKENS NOR ANY INTEREST OR PARTICIPATION HEREIN MAY BE REOFFERED, SOLD, ASSIGNED, TRANSFERRED, PLEDGED, ENCUMBERED, HYPOTHECATED OR OTHERWISE DISPOSED OF, EXCEPT PURSUANT TO AN EFFECTIVE REGISTRATION STATEMENT UNDER THE SECURITIES ACT OR SUCH OTHER SECURITIES LAWS OR PURSUANT TO A TRANSACTION THAT IS EXEMPT FROM, OR NOT SUBJECT TO, SUCH REGISTRATION REQUIREMENTS.**
7. NOTHING IN THESE TERMS CONSTITUTES LEGAL, FINANCIAL, BUSINESS OR TAX ADVICE AND YOU SHOULD CONSULT YOUR OWN LEGAL, FINANCIAL, TAX OR OTHER PROFESSIONAL ADVISOR BEFORE ENGAGING IN ANY ACTIVITY IN CONNECTION HEREWITH. THESE TERMS DO NOT CONSTITUTE A PROSPECTUS OR OFFERING DOCUMENT, AND ARE NOT AN OFFER TO SELL, NOR THE SOLICITATION OF AN OFFER TO BUY ANY INVESTMENT OR FINANCIAL INSTRUMENT IN ANY JURISDICTION. IF YOU ARE IN ANY DOUBT AS TO THE SUITABILITY OR OTHERWISE OF PURCHASING, HOLDING OR USAGE OF THE CRYPTO ASSETS REFERRED TO IN THESE TERMS, YOU SHOULD NOT PARTICIPATE IN OR SUBSCRIBE TO THE PROGRAMS AND YOU SHOULD SEEK APPROPRIATE PROFESSIONAL ADVICE.

### IV. Liabilities

#### 1. Disclaimer of Warranties

**OPTSWAP SERVICES OR OTHER ITEM PROVIDED BY OR ON BEHALF OF OPTSWAP ARE OFFERED ON AN "AS IS" AND "AS AVAILABLE" BASIS, AND OPTSWAP EXPRESSLY DISCLAIMS, AND YOU WAIVE, ANY AND ALL OTHER WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT OR WARRANTIES ARISING FROM COURSE OF PERFORMANCE, COURSE OF DEALING OR USAGE IN TRADE. WITHOUT LIMITING THE FOREGOING, OPTSWAP DOES NOT REPRESENT OR WARRANT THAT THE SITE, OPTSWAP SERVICES OR OPTSWAP MATERIALS ARE ACCURATE, COMPLETE, RELIABLE, CURRENT, ERROR-FREE, OR FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. OPTSWAP DOES NOT GUARANTEE THAT ANY ORDER WILL BE EXECUTED, ACCEPTED, RECORDED OR REMAIN OPEN. EXCEPT FOR THE EXPRESS STATEMENTS, AGREEMENTS AND RULES SET FORTH IN THESE TERMS, YOU HEREBY ACKNOWLEDGE AND AGREE THAT YOU HAVE NOT RELIED UPON ANY OTHER STATEMENT OR AGREEMENT, WHETHER WRITTEN OR ORAL, WITH RESPECT TO YOUR USE AND ACCESS OF OPTSWAP SERVICES. WITHOUT LIMITING THE FOREGOING, YOU HEREBY UNDERSTAND AND AGREE THAT OPTSWAP WILL NOT BE LIABLE FOR ANY LOSSES OR DAMAGES ARISING OUT OF OR RELATING TO: (A) ANY INACCURACY, DEFECT OR OMISSION OF CRYPTO ASSETS PRICE DATA, (B) ANY ERROR OR DELAY IN THE TRANSMISSION OF SUCH DATA, (C) INTERRUPTION IN ANY SUCH DATA, (D) REGULAR OR UNSCHEDULED MAINTENANCE CARRIED OUT BY OPTSWAP AND SERVICE INTERRUPTION AND CHANGE RESULTING FROM SUCH MAINTENANCE, (E) ANY DAMAGES INCURRED BY OTHER USERS' ACTIONS, OMISSIONS OR VIOLATION OF THESE TERMS, (F) ANY DAMAGE CAUSED BY ACTIONS OF OTHER THIRD PARTIES OR ACTIONS WITHOUT AUTHORIZED BY OPTSWAP; AND (G) OTHER EXEMPTIONS MENTIONED IN DISCLAIMERS AND PLATFORM RULES ISSUED BY OPTSWAP.**

#### 2. Disclaimer of Damages and Limitation of Liability

**IN NO EVENT WILL OPTSWAP, ITS AFFILIATES AND THEIR RESPECTIVE TOKEN HOLDERS, MEMBERS, GOVERNORS, OFFICERS, EMPLOYEES, ATTORNEYS, AGENTS, REPRESENTATIVES, SUPPLIERS OR CONTRACTORS BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, CONSEQUENTIAL OR SIMILAR DAMAGES OR LIABILITIES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF DATA, INFORMATION, REVENUE, PROFITS OR OTHER BUSINESSES OR FINANCIAL BENEFITS) ARISING OUT OF OPTSWAP SERVICES, ANY PERFORMANCE OR NON-PERFORMANCE OF OPTSWAP SERVICES, OR ANY OTHER PRODUCT, SERVICE OR OTHER ITEM PROVIDED BY OR ON BEHALF OF OPTSWAP AND ITS AFFILIATES, WHETHER UNDER CONTRACT, STATUTE, STRICT LIABILITY OR OTHER THEORY EVEN IF OPTSWAP HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES EXCEPT TO THE EXTENT OF A FINAL JUDICIAL DETERMINATION THAT SUCH DAMAGES WERE A RESULT OF OPTSWAP'S GROSS NEGLIGENCE, FRAUD, WILLFUL MISCONDUCT OR INTENTIONAL VIOLATION OF LAW.**

**NOTWITHSTANDING THE FOREGOING, IN NO EVENT WILL THE LIABILITY OF OPTSWAP, ITS AFFILIATES AND THEIR RESPECTIVE TOKEN HOLDERS, MEMBERS, GOVERNORS, OFFICERS, EMPLOYEES, ATTORNEYS, AGENTS, REPRESENTATIVES, SUPPLIERS OR CONTRACTORS ARISING OUT OF SERVICES OFFERED BY OR ON BEHALF OF OPTSWAP AND ITS AFFILIATES, ANY PERFORMANCE OR NON-PERFORMANCE OF OPTSWAP SERVICES, OR ANY OTHER PRODUCT, SERVICE OR OTHER ITEM, WHETHER UNDER CONTRACT, STATUTE, STRICT LIABILITY OR OTHER THEORY, EXCEED THE AMOUNT OF THE FEES PAID BY YOU TO OPTSWAP UNDER THESE TERMS IN THE TWELVE-MONTH PERIOD IMMEDIATELY PRECEDING THE EVENT GIVING RISE TO THE CLAIM FOR LIABILITY.**

#### 3. Indemnification

You agree to indemnify and hold harmless OptSwap DAO, OptSwap DAO Inc., their affiliates, contractors, licensors, and their respective token holders, governors, officers, employees and agents from and against any claims, actions, proceedings, investigations, demands, suits, costs, expenses and damages (including attorneys' fees, fines or penalties imposed by any regulatory authority) arising out of or related to (i) your use of, or conduct in connection with, OptSwap Services, (ii) your breach or our enforcement of these Terms, or (iii) your violation of any applicable law, regulation, or rights of any third party during your use of OptSwap Services. If you are obligated to indemnify OptSwap DAO, OptSwap DAO Inc., their affiliates, contractors, licensors, token holders and their respective governors, officers, employees or agents pursuant to these Terms, OptSwap will have the right, in its sole discretion, to control any action or proceeding and to determine whether OptSwap wishes to settle, and if so, on what terms.

### V. Announcements

Please be aware that all official announcements, news, promotions, competitions, fundraising rounds, commercial papers and airdrops will be listed on optswap.org. USERS UNDERTAKE TO REFER TO THESE MATERIALS REGULARLY AND PROMPTLY. OPTSWAP WILL NOT BE HELD LIABLE OR RESPONSIBLE IN ANY MANNER OF COMPENSATION SHOULD USERS INCUR PERSONAL LOSSES ARISING FROM IGNORANCE OR NEGLIGENCE OF THE ANNOUNCEMENTS.

### VI. No Financial Advice

OptSwap is not your broker, intermediary, agent, or advisor and has no fiduciary relationship or obligation to you in connection with any trades or other decisions or activities effected by you using OptSwap Services. No communication or information provided to you by OptSwap is intended as, or shall be considered or construed as, investment advice, financial advice, trading advice, or any other sort of advice. Unless otherwise specified in these Terms, all trades are executed automatically, based on the parameters of your order instructions and in accordance with posted trade execution procedures, and you are solely responsible for determining whether any investment, investment strategy or related transaction is appropriate for you according to your personal investment objectives, financial circumstances and risk tolerance, and you shall be solely responsible for any loss or liability therefrom. You should consult legal or tax professionals regarding your specific situation. OptSwap does not recommend that any Crypto Asset should be bought, earned, sold, or held by you. Before making the decision to buy, sell or hold any Crypto Asset, you should conduct your own due diligence and consult your financial advisors prior to making any investment decision. OptSwap will not be held responsible for the decisions you make to buy, sell, or hold Crypto Assets based on the information provided by OptSwap.

### VII. Compliance with Local Laws

It is the User's responsibility to abide by local laws in relation to the legal usage of OptSwap Services in their local jurisdiction as well as other laws and regulations applicable to Users. Users must also factor, to the extent of their local laws all aspects of taxation, the withholding, collection, reporting and remittance to their appropriate tax authorities. OPTSWAP DAO DOES NOT WITHHOLD OR REMIT ANY TAXES ON YOUR BEHALF UNDER ANY LEGAL JURISDICTION. ALL USERS OF OPTSWAP SERVICES ACKNOWLEDGE AND DECLARE THAT THEIR FUNDS COME FROM LEGITIMATE SOURCES AND DO NOT ORIGINATE FROM ILLEGAL ACTIVITIES.

OptSwap maintains a stance of cooperation with law enforcement authorities globally and will not hesitate to cooperate with investigations under any legal mandate.

### VIII. Privacy Policy

As a decentralized and fully on-chain protocol, all orders, trades, positions, participation in governance, fundraising rounds, airdrops and staking rewards are accounted for in the smart contracts against the User's public wallet address only.

OptSwap uses the Browsers Local Storage and Non-Identifying Cookies within the Users' local browser environment to temporarily cache User Account information, User Token Balances and Allowances, User Orders, User Positions and User Votes. This data is only used to render a technically working product and to improve the user experience and does not contain any Personally Identifying Information.

As part of the Know-Your-Customer ("KYC") and Anti-Money-Laundering ("AML") processes, OptSwap may do anything that it deems necessary in order to identify Users, verify their identity, scrutinize and investigate User transactions, or comply with any applicable law or regulation. All Personally Identifying Information collected is strictly processed according to the [OptSwap Privacy Policy](/other/privacy-policy).

The IP address and other metadata associated with your transactions may be separately collected or logged by the blockchain network miners or validators, or RPC (Remote Procedure Call) service providers, or Subgraph data providers, or your Internet Service Provider (ISP), or VPN (Virtual Private Network) service provider, or legal authorities, or other third parties as it travels across the network.

OptSwap utilizes web analytics tools, including but not limited to Google Analytics, to better understand how the software is used, and to improve the OptSwap Services. If you are logged into your Google account, or any other third party account which is linked with a web analytics tool, while you are using OptSwap Services, you may be personally identifiable by Google or the third party account into which you are simultaneously logged in while using OptSwap Services. OptSwap does not, and cannot, transmit any personally identifying information to any third party. ALL USERS OF OPTSWAP ACKNOWLEDGE THAT OPTSWAP IS NOT RESPONSIBLE AND CANNOT BE HELD LIABLE FOR THE INDEPENDENT COLLECTION OF USER DATA, WHETHER PERSONALLY IDENTIFYING OR NOT, BY ANY THIRD PARTY UNDER ANY CIRCUMSTANCES.

### IX. Resolving Disputes: Arbitration, Class Action Waiver

PLEASE READ THIS SECTION CAREFULLY, AS IT INVOLVES A WAIVER OF CERTAIN RIGHTS TO BRING LEGAL PROCEEDINGS, INCLUDING AS A CLASS ACTION.

1. Dispute Resolution: We will use our best efforts to resolve any potential disputes through informal, good faith negotiations. If a potential dispute arises, you must contact us by sending an email to <legal@optswap.org> so that we can attempt to resolve it without resorting to formal dispute resolution. If we aren't able to reach an informal resolution within ninety days of your email, then you and we both agree to resolve the potential dispute according to the process set forth below in paragraph (2).
2. Arbitration: Any claim or controversy arising out of or relating to the OptSwap Services, these Terms, or any other acts or omissions for which you may contend that we are liable, including (but not limited to) any claim or controversy as to arbitrability ("Dispute"), shall be finally and exclusively settled by arbitration. You understand that you are required to resolve all Disputes by binding arbitration. The arbitration shall be held on a confidential basis before a single arbitrator, who shall be selected pursuant to the relevant arbitration rules. The arbitration will be held in the British Virgin Islands (BVI), unless you and we both agree to hold it elsewhere. Unless we agree otherwise, the arbitrator may not consolidate your claims with those of any other party. Any judgment on the award rendered by the arbitrator may be entered in any court of competent jurisdiction.
3. Class Action Waiver and Jury Trial Waiver: You must bring any and all Disputes against us in your individual capacity and not as a plaintiff in or member of any purported class action, collective action, private attorney general action, or other representative proceeding. This provision applies to class arbitration. You and we both agree to waive the right to demand a trial by jury. You and OptSwap agree that any claims relating to these Terms or to your relationship with OptSwap as a user of OptSwap Services (whether based in contract, tort, statute, fraud, misrepresentation, or any other legal theory, and whether the claims arise during or after the termination of these Terms) shall be brought against the other party in an arbitration on an individual basis only and not as a plaintiff or class member in a purported class or representative action. You and OptSwap further agree to waive any right for such claims to be brought, heard, or arbitrated as a class, collective, representative, or private attorney general action, to the extent permissible by applicable law. Combining or consolidating individual arbitrations into a single arbitration is not permitted without the consent of all parties, including OptSwap.
4. Governing Law: You agree that the laws of the British Virgin Islands, without regard to principles of conflict of laws, govern these Terms and any Dispute between you and us. You further agree that the OptSwap Services shall be deemed to be based solely in the British Virgin Islands, and that although the OptSwap Services may be available in other jurisdictions, its availability does not give rise to general or specific personal jurisdiction in any forum outside the British Virgin Islands. You agree that The Magistrate's Court, British Virgin Islands, is the proper forum for any appeals of an arbitration award or for court proceedings in the event that these Terms binding arbitration clause is found to be unenforceable.

### X. Miscellaneous

1. Independent Parties: OptSwap is an independent contractor but not an agent of you in the performance of these Terms. These Terms shall not be interpreted as facts or evidence of an association, joint venture, partnership, or franchise between the parties.
2. Entire Agreement: These Terms constitute the entire agreement between the parties regarding use of OptSwap Services and will supersede all prior written or oral agreements between the parties. No usage of trade or other regular practice or method of dealing between the parties will be used to modify, interpret, supplement, or alter the terms herein.
3. Interpretation and Revision: OptSwap reserves the right to alter, revise, modify, and/or change these Terms at any time. All changes will take effect immediately upon being published on OptSwap websites. It is your responsibility to regularly check relevant pages on our websites/applications to confirm the latest version of these Terms. If you do not agree to any such modifications, your only remedy is to close your positions, withdraw your funds and terminate your usage of OptSwap Services. You agree that, unless otherwise expressly provided in these Terms, OptSwap will not be responsible for any modification or termination of OptSwap Services by you or any third party, or suspension or termination of your access to OptSwap Services.
4. Force Majeure: OptSwap will not be liable for any delay or failure to perform as required by these Terms because of any cause or condition beyond OptSwap's reasonable control.
5. Severability: If any portion of these Terms is held invalid or unenforceable, such invalidity or enforceability will not affect the other provisions of these Terms, which will remain in full force and effect, and the invalid or unenforceable portion will be given effect to the greatest extent possible.
6. Assignment: You may not assign or transfer any right to use OptSwap Services, or any of your rights or obligations under these Terms without prior written consent from OptSwap, including any right or obligation related to the enforcement of laws or the change of control. OptSwap may assign or transfer any or all of its rights or obligations under these Terms, in whole or in part, without notice or obtaining your consent or approval.
7. Waiver: The failure of one party to require performance of any provision will not affect that party's right to require performance at any time thereafter. At the same time, the waiver of one party to seek recovery for the other party's violation of these Terms or any provision of applicable terms shall not constitute a waiver by that party of any subsequent breach or violation by the other party or of the provision itself.
8. Third-Party Website Disclaimer: Any links to third-party websites from OptSwap Services does not imply endorsement by OptSwap of any product, service, information or disclaimer presented therein, nor does OptSwap guarantee the accuracy of the information contained on them. If you suffer loss from using such third-party product and service, OptSwap will not be liable for such loss. In addition, since OptSwap has no control over the terms of use or privacy policies of third-party websites, you should read and understand those policies carefully.
9. Contact Information: If you have questions regarding these Terms and Conditions, please feel free to contact OptSwap for clarification via email to <legal@optswap.org>.


# Risk Warnings

Last Updated: July 31 2024

Cryptocurrencies, Blockchains and Options each carry a number of risks associated with holding, using or trading them. It is important to be fully aware of the sources and types of risks involved when using the OptSwap protocol and to account for them in your trading and business decisions.

**BY MAKING USE OF OPTSWAP SERVICES, YOU ACKNOWLEDGE AND AGREE THAT: (1) YOU ARE AWARE OF THE RISKS ASSOCIATED WITH TRANSACTIONS OF CRYPTO ASSETS AND THEIR DERIVATIVES INCLUDING, BUT NOT LIMITED TO, THE RISKS LISTED IN THIS DOCUMENT; (2) YOU SHALL ASSUME ALL RISKS RELATED TO THE USE OF OPTSWAP SERVICES AND TRANSACTIONS OF CRYPTO ASSETS AND THEIR DERIVATIVES; AND (3) OPTSWAP DAO SHALL NOT BE LIABLE FOR ANY SUCH RISKS OR ADVERSE OUTCOMES.**

### **I. Market Risk**

Cryptocurrencies are volatile both by their nature and due to the structure of the market. This results in large, often unexplainable, rises and falls in the prices of the underlying assets (Price Volatility). Market Events may result in instant, and large, price movements upwards or downwards. The markets are open 24 hours a day, seven (7) days a week. Large price movements may occur at any time, including outside of regular business hours.

The prices of derivatives, such as Options, are based on the price of the underlying assets. Therefore, any price movements of the underlying assets against your options positions may result in a partial or total Loss of Capital.

### **II. Option Buyer Risk**

Option Buyers face the risk of the partial or total Loss of the Premium paid if the option expires Out-of-The-Money. There is no guarantee that a counterparty may be available for you to close your position before expiry since the seller may be willing to allow the option to expire worthless.

### **III. Option Writer (Seller) Risk**

Option Writers (Sellers) face the risk of the partial or total Loss of the Margin deposited if the option expires In-The-Money. There is no guarantee that a counterparty may be available for you to close your position before expiry since the buyer may be willing to take physical delivery of the underlying asset (Option Exercise), or settle for cash after expiration (Cash Settlement).

Writers (Sellers) of American style options face the added risk of Early Exercise or Early Cash Settlement at any time, even before expiration, if the option is In-The-Money.

### **IV. Blockchain Risk**

Blockchains are distributed databases and computing networks usually run by a small or large number of miners or validators. Despite various redundancies which are built into the blockchain systems, the overall network can still experience partial or complete outage (Downtime).

During such downtime incidents, it may be slow or impossible to trade or settle your positions. If/when the network comes back online, there may be large price corrections, or movements, of the underlying assets which can result in unexpected losses in your positions (Mark-To-Market Loss).

Every transaction on the blockchain requires a fee to be paid to the network miners or validators (Gas Fees). During periods of high network congestion, the gas fees increase to accommodate the higher traffic at that time (Surge Pricing). This results in durations of High Gas Fees which may last from a few seconds to several hours or days. The network miners or validators may also choose to temporarily or permanently censor certain transactions; or reject all transactions with gas fees below a certain minimum threshold. This may result in unexpected higher costs, slower network speeds or the inability to perform transactions from your address (such as trading or settlements) on the blockchain network.

Blockchain networks have certain technical characteristics which may result in unanticipated situations such as 51% Attacks, Chain Reorganizations, Chain Forking, Artificial Intelligence or Quantum Computing Brute-Force Attacks (Technology Risks). In such cases, the issues have been historically resolved by technical or social consensus, but there is no guarantee that it may be resolved for future incidents. This may result in unexpected Downtime or a partial or total Loss of Capital.

### **V. Smart Contract Risk**

Smart contracts are discrete pieces of software which operate on a set of given inputs and perform permanent, immutable or irreversible state changes on the blockchain. Transactions cannot be reversed or refunded under any circumstances. The OptSwap protocol runs on, and is governed by, various smart contracts which work together to provide the protocols features and functionality.

Bugs, Hacks or Exploits at the smart contract level may result in unexpected or unintended behavior and cause a partial or total Loss of Capital. Software audits and/or automated tests do not guarantee that a piece of software is free from bugs. New and unanticipated attack vectors may arise in the future due to unknown developments or research.

### **VI. Token Risk**

Blockchain based Tokens (ERC-20, BEP-20, etc.,) are used in the OptSwap smart contracts as either the underlying asset, or cash token, or both. Some of these tokens represent Wrapped versions of other assets – such as Wrapped Bitcoin (WBTC); or are Pegged in value to Fiat Currencies – such as Tether (USDT), USD Coin (USDC) or Dai (DAI) – and are typically redeemable 1:1 for the original wrapped/pegged asset after minimal fees or slippage.

However, under circumstances such as Hacks, Bridge Exploits (Bridge Risk), Token Issuer Insolvencies or Extreme Market Conditions, wrapped/pegged tokens may lose their 1:1 backing, or their market value may drift partially or substantially, temporarily or permanently, from their intended peg or value (Depegging Risk).

Tokens implemented as Proxy Contracts may change their internal functionality resulting in unexpected or unintended behavior. These may result in unexpected partial or total Loss of Capital.

### **VII. Miner/Maximal Extractable Value (MEV) Risk**

Miner/Maximal Extractable Value (MEV) is defined as the maximum value that can be extracted from block production (by network miners or validators) in excess of the standard block reward and gas fees; by including, excluding, and/or changing the order of transactions within a block that they produce or validate.

This may result in orders with unnecessarily high slippage being front-run by Generalized or Specialized Frontrunners or Arbitrage Bots. This may result in a worse than expected trade or fill resulting in a partial Loss of Capital.

### **VIII. Exogenous Protocol Risk**

The Decentralized Price Meta Oracle derives Spot Prices and Settlement Prices for the Automated Market Maker and Decentralized Exchange. The Derived Prices are based on Liquidity & Time Weighted Average Price (LTWAP) Observation Snapshots taken from Decentralized Liquidity Pools based on the Uniswap V2/V3 protocol.

Since the Meta Oracle Derived Prices are wholly dependent on the underlying liquidity and prices reported by the liquidity pools, it inherits any vulnerabilities from the Uniswap V2/V3 protocol (Exogenous Smart Contract Risk). This may result in Cash Settlement Swaps being unavailable or unfeasible, or price or liquidity observations which may drift partially or substantially from off-chain markets. This may result in unexpected partial or total Loss of Capital.

### **IX. Oracle Manipulation Risk**

The Uniswap V2/V3 Liquidity Pools provide Time Weighted Average Prices (TWAPs) which are fully decentralized and highly resistant to manipulation by design over longer durations of time. However, they may be manipulated over shorter periods of time by a bad actor with sufficient access to capital (On-Chain Price Manipulation Risk) and/or hashing power (51% Attack Risk).

While it is highly unlikely that a bad actor would be able to profit from such an attack due to opposing market participants, on-chain vs. off-chain price arbitrageurs, and the payoffs vs. costs of being a bad network miner or validator; such an attack cannot be ruled out when an Irrational Bad Actor is considered. This may result in unexpected partial or total Loss of Capital.

### **X. Divergence or Impermanent Loss Risk**

Liquidity Providers who deposit funds into Uniswap V2/V3-style liquidity pools for staking or market-making activities face the risk of Divergence or Impermanent Loss. If one of the tokens in the pair has a large, sustained, movement to the upside or downside relative to the other, the liquidity provider sustains a loss on the funds held within the pool relative to simply holding the assets outside the pool.

If the funds are withdrawn from the liquidity pool before the exchange rate reverts to the value at which the funds were originally deposited, the liquidity provider may take a permanent loss on the difference (Loss of Capital). There is no guarantee that the exchange rate will revert to the original deposit value.

### **XI. Regulatory Risk**

Changes to the laws and regulations in your country or any other legal jurisdiction may materially affect the value of the underlying assets and/or your positions. This risk is unpredictable and may vary from one legal jurisdiction to another. This may result in unexpected partial or total Loss of Capital.

### **XII. Black Swan Event Risk**

There may be unforeseen, or unforeseeable, events which may occur in the future such as Zero-Day Vulnerability Exploits, Force Majeure Events or Acts of God, which are collectively categorized as Black Swan Events. These may result in unexpected partial or total Loss of Capital.


# Privacy Policy

Last Updated: July 31 2024

OptSwap DAO Inc., ("OptSwap", "we", or "us") is committed to protecting the privacy of our customers, and we take our data protection responsibilities with the utmost seriousness.

This Privacy Policy describes how OptSwap collects and processes your personal information through the OptSwap websites and applications that reference this Privacy Policy. OptSwap refers to an ecosystem comprising OptSwap websites (whose domain names include but are not limited to \*.optswap.org), mobile applications, clients, applets and other applications that are developed to offer OptSwap Services, and includes independently-operated platforms, websites and clients within the ecosystem. "OptSwap Operators" refer to all parties that run OptSwap, including but not limited to legal persons, unincorporated organizations and teams that provide OptSwap Services and are responsible for such services. "OptSwap" as used in this Privacy Policy includes OptSwap Operators.

This Privacy Policy applies to all Personal Information processing activities carried out by us, across platforms, websites, and departments of OptSwap and OptSwap Operators.

To the extent that you are a customer or user of our services, this Privacy Policy applies together with any terms of business and other contractual documents, including but not limited to any agreements we may have with you.

To the extent that you are not a relevant stakeholder, customer or user of our services, but are using our website, this Privacy Policy also applies to you.

OptSwap uses the Browsers Local Storage and Non-Identifying Cookies within the Users' local browser environment to render a technically working product and does not contain any Personally Identifying Information.

### I. OptSwap Relationship With You

OptSwap DAO Inc., is the data controller for personal information collected in connection with provision of OptSwap services worldwide.

However, depending on your place of legal residence certain other OptSwap entities could be involved in processing activities such as Know-Your-Customer ("KYC") and Anti-Money-Laundering ("AML") activities which are necessary for us to provide Services to you. These OptSwap entities could act as Controllers of your personal information and use it in accordance with this Privacy Policy.

### II. Personally Information Collected

OptSwap may collect and process your email address, name, gender, date of birth, home address, phone number, nationality, device ID, video recordings of you and photographic images, the Internet protocol (IP) address used to connect your computer to the Internet, OptSwap Services metrics (e.g. the occurrences of technical errors, your interactions with service features and content, and your settings preferences), and transactional information.

We use your personal information to process your orders, and to communicate with you about orders and services. We use your personal information to communicate with you in relation to OptSwap Services. We collect and process identity information and Sensitive Personal Data to comply with our Know-Your-Customer ("KYC") obligations under applicable laws and regulations, and Anti-Money-Laundering ("AML") laws and regulations.

The legal basis for our use of personal information (EU and UK GDPR) are to comply with our legal obligations under applicable laws and regulations, Know-Your-Customer ("KYC") and Anti-Money-Laundering ("AML") laws and regulations. We collect and process your personal information to also maintain our legitimate interests and the interests of our users when, for example, we detect and prevent fraud and abuse in order to protect the security of our users, ourselves, or others.

When we ask for your consent to process your personal information for a specific purpose that we communicate to you and when you consent to processing your personal information for a specified purpose, you may withdraw your consent at any time and we will stop processing your personal information for that purpose. The withdrawal of consent does not affect the lawfulness of processing based on consent before its withdrawal.

### III. Age Requirements

OptSwap does not allow anyone under the age of eighteen (18) to use OptSwap Services and does not knowingly collect personal information from children under the age of 18.

### IV. Cookies

OptSwap uses the Browsers Local Storage and Non-Identifying Cookies within the Users' local browser environment to temporarily cache User Account information, User Token Balances and Allowances, User Orders, User Positions and User Votes. This data is only used to render a technically working product and to improve the user experience and does not contain any Personally Identifying Information.

### V. Sharing Personal Information

We may share your Personal Data with third parties (including other OptSwap entities) if we believe that sharing your Personal Data is in accordance with, or required by, any contractual relationship with you or us, applicable law, regulation or legal process. When sharing your Personal Information with other OptSwap entities, we will use our best endeavours to ensure that such entity is either subject to this Privacy Policy, or follow practices at least as protective as those described in this Privacy Policy.

We may also share personal information with the following persons:

1. Third party service providers: We employ other companies and individuals to perform functions on our behalf. Examples include analysing data, providing marketing assistance, processing payments, transmitting content, and assessing and managing credit risk. These third-party service providers only have access to personal information needed to perform their functions, but may not use it for other purposes. Further, they must process the personal information in accordance with our contractual agreements and only as permitted by applicable data protection laws.
2. Legal Authorities: We may be required by law or by Court to disclose certain information about you or any engagement we may have with you to relevant regulatory, law enforcement and/or other competent authorities. We will disclose information about you to legal authorities to the extent we are obliged to do so according to the law. We may also need to share your information in order to enforce or apply our legal rights or to prevent fraud.
3. Business transfers: As we continue to develop our business, we might sell or buy other businesses or services. In such transactions, user information generally is one of the transferred business assets but remains subject to the promises made in any pre-existing Privacy Policy (unless, of course, the user consents otherwise). Also, in the unlikely event that OptSwap or substantially all of its assets are acquired by a third party, user information will be one of the transferred assets.
4. Advertisers: In order for us to provide you with the best user experience, we may share your personal information with our marketing partners for the purposes of targeting, modelling, and/or analytics as well as marketing and advertising. You have a right to object at any time to processing of your personal information for direct marketing purposes (see Section VIII below).
5. Protection of OptSwap and others: We release accounts and other personal information when we believe release is appropriate to comply with the law or with our regulatory obligations; enforce or apply our Terms of Use and other agreements; or protect the rights, property or safety of OptSwap, our users or others. This includes exchanging information with other companies and organisations for fraud protection and credit risk reduction.

### VI. International Transfers of Personal Information

To facilitate our global operations, OptSwap may transfer your personal information outside of the European Economic Area ("EEA"), UK and Switzerland. The EEA includes the European Union countries as well as Iceland, Liechtenstein, and Norway. Transfers outside of the EEA are sometimes referred to as "third country transfers".

We may transfer your personal data within our Affiliates, third-party partners, and service providers based throughout the world. In cases where we intend to transfer personal data to third countries or international organisations outside of the EEA. OptSwap puts in place suitable technical, organizational and contractual safeguards (including Standard Contractual Clauses), to ensure that such transfer is carried out in compliance with applicable data protection rules, except where the country to which the personal information is transferred has already been determined by the European Commission to provide an adequate level of protection.

We also rely on decisions from the European Commission where they recognise that certain countries and territories outside of the European Economic Area ensure an adequate level of protection for personal information. These decisions are referred to as "adequacy decisions". We transfer personal data to Japan on the basis of the Japanese Adequacy Decision.

### VII. Information Security

We design our systems with your security and privacy in mind. We have appropriate security measures in place to prevent your information being accidentally lost, used or accessed in an unauthorised way, altered or disclosed. We work to protect the security of your personal information during transmission and while stored by using encryption protocols and softwares. We maintain physical, electronic and procedural safeguards in connection with the collection, storage and disclosure of your personal information. In addition, we limit access to your personal information to those employees, agents, contractors and other third parties who have a business need to know.

Our security procedures mean that we may ask you to verify your identity to protect you against unauthorised access to your account. We keep your personal information to enable your continued use of OptSwap Services, for as long as it is required in order to fulfil the relevant purposes described in this Privacy Policy, and as may be required by law such as for tax and accounting purposes, compliance with Know-Your-Customer (KYC) and Anti-Money-Laundering (AML) laws, or as otherwise communicated to you.

### VIII. Your Rights

Subject to applicable law, as outlined below, you have a number of rights in relation to your privacy and the protection of your personal information. You have the right to request access to, correct, and delete your personal information, and to ask for data portability. You may also object to our processing of your personal information or ask that we restrict the processing of your personal information in certain instances. In addition, when you consent to our processing of your personal information for a specified purpose, you may withdraw your consent at any time. If you want to exercise any of your rights please contact us at <legal@optswap.org>. These rights may be limited in some situations - for example, where we can demonstrate we have a legal requirement to process your personal data.

1. Right to access: you have the right to obtain confirmation that your personal information are processed and to obtain a copy of it as well as certain information related to its processing;
2. Right to rectify: you can request the rectification of your personal information which are inaccurate, and also add to it. You can also change your personal information in your Account at any time.
3. Right to delete: you can, in some cases, have your personal information deleted;
4. Right to object: you can object, for reasons relating to your particular situation, to the processing of your personal information. For instance, you have the right to object where we rely on legitimate interest or where we process your data for direct marketing purposes;
5. Right to restrict processing: You have the right, in certain cases, to temporarily restrict the processing of your personal information by us, provided there are valid grounds for doing so. We may continue to process your personal information if it is necessary for the defense of legal claims, or for any other exceptions permitted by applicable law;
6. Right to portability: in some cases, you can ask to receive your personal information which you have provided to us in a structured, commonly used and machine-readable format, or, when this is possible, that we communicate your personal information on your behalf directly to another data controller;
7. Right to withdraw your consent: for processing requiring your consent, you have the right to withdraw your consent at any time. Exercising this right does not affect the lawfulness of the processing based on the consent given before the withdrawal of the latter;
8. Right to lodge a complaint with the relevant data protection authority: We hope that we can satisfy any queries you may have about the way in which we process your personal information. However, if you have unresolved concerns, you also have the right to complain to the Irish Data Protection Commission or the data protection authority in the location in which you live, work or believe a data protection breach has occurred.

If you have any questions or objection as to how we collect and process your personal information, please contact <legal@optswap.org>.

### IX. Contact Information

Our data protection officer can be contacted at <legal@optswap.org>, and will work to address any questions or issues that you have with respect to the collection and processing of your personal information.

### X. Notices and Revisions

If you have any concerns about privacy at OptSwap, please contact us, and we will try to resolve it in a timely manner. You also have the right to contact your local Data Protection Authority.

Our business changes regularly, and our Privacy Policy may change also. You should check our websites frequently to see recent changes. Unless stated otherwise, our current Privacy Policy applies to all information that we have about you and your account.


