Giter Site home page Giter Site logo

lorbke / pepetuals Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 1.12 MB

ETHGlobal New York hackathon project

Home Page: https://ethglobal.com/showcase/pepetuals-kyyw9

License: MIT License

Solidity 36.72% JavaScript 26.02% TypeScript 34.72% CSS 2.54%

pepetuals's Introduction

CREATED FOR ETHGLOBAL NEW YORK

https://ethglobal.com/showcase/pepetuals-kyyw9

image

Pepetuals

This project is a new approach to perpetual onchain futures. There have been quite a few approaches in the past, but we believe that none of them match our idea, especially in terms of stability.

The presentation can be found here: https://docs.google.com/presentation/d/1SnWZmQYaW7W_3zFY-c6oZT-BYV2DgJLPcIJjkJs1Hws/edit#slide=id.g282cbbbe77c_0_107

Contracts

MultiLongShortPair:

Deploys long short pairs for a given asset. Manages the uniswap pools.

RollingPool:

Deposit futures into the pool. They will automatically be converted into new shares towards the end of each period and can be withdrawn at any point. Bots have to call startRollover as well as rollDeposit / rollWithdraw. As an incentive bonus tokens are given out.

UniswapV3Wrapper:

Wrapper for the uniswap pool for more easy usage.

ApiContract

Mainly used as a wrapper for easy usability from the frontend.

Frontend:

The frontend is built in multiple frameworks. The main underlying framework is React. The main components are build with Near and deployed on their testnet (LSC Component,LSP Compoennt). These two components use the bootstrap framework for styling. For renderening of these components a gateway in Next.js was created. This gateway uses tailwind navigation components and for the basic website styling, but uses bootstrap for the Near components. With this concept anyone who would like to implement our service can add our Near Widget wo their gateway/website. The two main components are structured in the following way:

  1. The LSC (Long/Short Converter) component to swap your USDC funds to a future/perpetular future.
  2. The LSP (Long/Short Positions) component to show all of your current positions youre holding.

Deploy

To test it yourself some solidity versions in the uniswap contracts have to be changed from =0.7.6 to >=0.7.6 NoDelegateCall.sol UniswapV3Factory.sol UniswapV3PoolDeployer.sol lib/uniswapv3-periphery/contracts/base/LiquidityManagement.sol (=0.7.6) lib/uniswapv3-periphery/contracts/libraries/CallbackValidation.sol (=0.7.6) lib/uniswapv3-periphery/contracts/interfaces/external/IWETH9.sol (=0.7.6)

Some tests aren't fully implemented and are expected to fail.

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.