DeFi derivative development: from zero to hero with Opium v2 pt.1

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • erc721o

    ERC721o - Composable Multiclass Fungible Token Standard

  • One of the design choices that was scrapped was the usage of Opium’s very own token standard ERC 721o - a custom flavor of the more notorious ERC721- whose purpose was to allow for the creation of non-fungible derivative portfolios. Nowadays a similar rationale has been implemented by the ERC1155 standard, however the degree of interoperability and easy-to-reason-about clean API that the good-old-fashioned ERC20 provides are simply undefeated. As such, following a long-existing DeFi trend that was first popularized by Uniswap, Opium makes use of a factory pattern that mints ERC20 tokens in a measure proportional to the ownership of LONG/SHORT option positions of their respective owners. However, as the scope of the article is to give enough of a rundown for a developer to get their feet wet with Opium v2, we will postpone a deep dive into the Opium Protocol architecture to a later date. If you have any questions, feel free to drop by on the governance forum!

  • opium-protocol-v2

    Smart contracts of Opium Protocol v2

  • The struct above is the schema that we use in the Opium Protocol. Let’s quickly walk through it: uint256 margin: aka the reference collateral that is (usually) parsed by the IDerivativeLogic SyntheticId getMargin function to set the collateral requirements of the option contract. uint256 endTime: aka the maturity date of the contract. It is the point in time at which the buyers will have the right to exercise their contract. uint256[] params: option contracts can differ greatly in the complexity of their financial requirements, as such Opium uses a dynamic array to ensure a high degree of flexibility to the consumers of the protocol, as to enable them to encode arbitrary parameters in their LibDerivative asset definition if needed. One convention to keep in mind is that, however, the first item of the params array is always expected to be the strike price. The strike price is the value that determines the profitability of an option upon expiry: if the market price is above the strike price in case of a call option or the market price is below the strike price in the context of a put option, the option is said to be ‘in the money’ and the buyer stands to make a profit. Vice-versa, the option is said to be out of the money and the buyer stands to lose the premium or the collateral that they had to exchange for the ownership of the option contract. oracleId: oracles are the entities that inform the Opium Protocol about the value of an asset upon its maturity date. The Opium Protocol does not enforce any specification as for what can be used as an oracle, be it on-chain or off-chain. token: the address of the ERC20 token to be used as a collateral syntheticId: the address of the contract where the financial logic of the derivative is encoded. The Opium Protocol expects the syntheticId contracts to be compliant with the specifications of the IDerivativeLogic interface.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Building an Escrow Smart Contract

    1 project | dev.to | 28 Apr 2024
  • Interacting with Smart Contracts using ethers.js

    1 project | dev.to | 25 Apr 2024
  • Show HN: Burn ETH, mint BURNTH, a contract-less privacy solution on Ethereum

    1 project | news.ycombinator.com | 6 Mar 2024
  • Noir on Scroll

    1 project | dev.to | 6 Feb 2024
  • Karma: An ERC20-compatible Reputation-based Money on the Ethereum Blockchain

    1 project | dev.to | 29 Dec 2023