Giter Site home page Giter Site logo

chainlinkcalloptions's Introduction

ChainlinkCallOptions

Contract that allows writing, buying and exercising of ETH and LINK call options using Chainlink pricefeeds

//Takes which token, a strike price(USD per token w/18 decimal places), premium(same unit as token), expiration time(unix) and how many tokens the contract is for

function writeOption(string memory token, uint strike, uint premium, uint expiry, uint tknAmt)

//Purchase a call option, needs desired token, ID of option and payment

function buyOption(string memory token, uint ID)

//Exercise your call option, needs desired token, ID of option and payment

function exercise(string memory token, uint ID)

//Allows option writer to cancel and get their funds back from an unpurchased option

function cancelOption(string memory token, uint ID)

//Allows writer to retrieve funds from an expired, non-exercised, non-canceled option

function retrieveExpiredFunds(string memory token, uint ID)

All uints input (strike, premium, tknAmt) are 18 decimal (meaning 1 is represented as 1e18 or 1 * 10^18) with the exception of expiry which is Unix time formatted.

chainlinkcalloptions's People

Contributors

gmondok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.