Git Product home page Git Product logo

options-protocol's Introduction

Charm Options

This repository contains an automated market-maker for options

It implements an AMM that allows an asset to be split up into tokenized payoffs such that different combinations of payoffs sum up to different call/put option payoffs. An LMSR (Hanson's market-maker) is used to provide liquidity for the tokenized payoffs.

Deployer privileges

Please note the deployer is highly privileged and has the permissions below. These are only intended to be used in an emergency situation and will be removed in future versions.

  • Withdraw all funds from market

  • Modify parameters of market

  • Pause the contract indefinitely. This includes preventing users from buying, selling, and redeeming their options.

  • Override the expiry price

Repository

The main contract that users will interact with is OptionMarket.sol, which implements the buy, sell, deposit and withdraw methods.

OptionMath.sol implements calculation logic for the LMSR cost function and for option payoffs.

OptionToken.sol is an ERC-20 token representing a long or short option position.

ChainlinkOracle.sol and UniswapOracle.sol are price oracles used to retrieve the price of the underlying asset at expiration.

OptionFactory.sol is a factory contract. createMarket is the intended way to deploy a new market.

OptionSymbol.sol is used to build the symbols and names of the option and LP tokens. It's adapted from https://github.com/opynfinance/GammaProtocol/blob/master/contracts/Otoken.sol.

Commands

Run solidity linter

npm run lint:fix

Run python formatter on unit tests

black .

Run unit tests

brownie test

Compile

brownie compile

options-protocol's People

Contributors

mxwtnb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.