Coder Social home page Coder Social logo

iguana-dex / iguana-frontend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balancer/frontend-v2

1.0 1.0 1.0 122.58 MB

🦎 Front-end for IguanaDEX.com

Home Page: https://IguanaDEX.com

License: GNU General Public License v3.0

Shell 0.08% JavaScript 1.04% TypeScript 49.12% CSS 0.41% HTML 0.10% Vue 49.23% Dockerfile 0.03%
ethers tailwindcss typescript vite vue dapp

iguana-frontend's Introduction

🦎 IguanaDEX Frontend

Development

This project will ONLY work properly if you use Node.js version 16.x (Gallium LTS) and NPM version 8+.

To setup the development environment first clone the repo:

git clone https://github.com/iguana-dex/iguana-frontend.git && cd iguana-frontend

Local env

Install dependencies:

npm install

Start the app:

npm run dev

The app should now be live at http://localhost:8080

Testing

Run unit tests:

npm run test:unit

Run unit tests in watch mode:

npm run test:unit:watch

Run unit tests with coverage:

npm run test:unit:coverage

Build

Run build:

npm run build

Preview build:

npm run preview

Run build in watch mode:

npm run build:watch

This mode is useful when you need to reproduce/fix bugs/issues in a production-like environment.

Vite setup

This app is powered by vite, which:

  • Runs a development dev server with esbuild.
  • Builds production bundle with Rollup.

Both tools above rely on native ES modules but our app also depends on libraries like ethers.js which use Node.js built-in modules (like Buffer, stream or crypto) that require browser polyfills. This is why our vite.config.ts uses node-pollyfills and rollup-plugin-polyfill-node.

unplugin-vue magic 🪄

We use some Vite plugins to improve the Vue developer experience.

unplugin-vue-components:

Auto imports components located in src/components/_global so that they are available from every other component in the application (and from vitest). (It also auto generates a d.ts file for the auto imported components).

Analyze bundle

Analyze and visualize the bundle dependencies by adding these env vars to your .env file before running the build:

# Local .env file
VITE_BUILD_ANALIZE=true
VITE_BUILD_VISUALIZE=true

📚  General Info


This repository contains the main features of iguanadex.com:
A) Home tab/landing page
B) Swaps tab
C) DMI Pool tab
D) DMI Borrow Market tab
E) DMI Perpetual Swaps tab
F) DAO tab

The overall website is jungle-themed. Numerous animations are used to make it livelier, some of which are triggered by user interactions. On the sides of the page, there is a forest background with falling leaves. The leaves of the trees move when the pointer hovers over them. There are also iguanas sporadically showing up and sticking out their long curly red tongues.

Color Palette:
+ Green for the main color
- Red undertones

A) Home tab & landing page:

The landing page displays the latest information about the Digital Market Index - the bedrock of the products offered by Iguana.

There is also a "Time Machine" tab providing a wealth of information and charts regarding index changes, the index's performance and its components since January 2018.

This is meant as information, something that users refer to quite often. Iguana uses it to promote the trading part of the DApp along with the option to buy the DMI token off-chain.

B) Pool tab:

Here investors can deposit to the main DMI pool - which is a SMM ("Smart Automated Market-Maker) with weights set to match the Digital Market Index. Note that the Digital Market Index's weights change at 12am UTC on the 1st of each month.

C) Trade tab:

a) Spot trading:

Here traders are able to swap a coin for another directly on-chain as long as both the token they're selling and the one they're buying are part of the 11 coins in the DMI pool (top 10 coins by real market cap + USDT)

The swap fee differs depending on the pair you are trading. This swap fee is collected in the token being sold, e.g. if a trader is swapping 1 BTC for ETH (swap fee 0.05%), then 0.0005 BTC will be collected as swap fees.

b) Perpetual swap trading:

Leveraged traders and hedgers can go long or short the Digital Market Index with up to 50x leverage in a cost-effective way and in decent size. The trading of those perpetual swaps is underpinned by an auction mechanism occuring twice a day, at 9am UTC and 9pm UTC.

This process is similar to Nasdaq's Opening Cross. 30 minutes before the auction, iggies can place limit buy and limit sell orders for DMI perpetual swaps.

D) DMI Borrow Market tab:

Here traders and arbitragers can either provide DMI tokens and borrow some USDT against them or vice-versa. The interest rate on the DMI and/or USDT borrowed is based on a utilisation curve. This market will be based on Aave v3's isolated markets implementation (?).

It is important that arbitragers are able to borrow DMI tokens so that they can short-sell spot DMI tokens and buy perpetual swaps against them in cases where the perpetual swap trades lower than the spot DMI token. This will be incentivised by a classic funding mechanism in addition to the opportunity to capture small price differentials - more on this in 4.

E) Portfolio tab:

Monitor your entire crypto portfolio in one place. Here you can view your positions on all EVM chains along with spot and future positions on the Binance and Bybit centralized exchanges.

F) DAO tab:

Can buy or sell IGN tokens here. IGN is the native token of Iguana - IGN holders collect 100% of the revenues of Iguana. IGN holders can also vote on various proposals directly on this tab (thanks to snapshot.org's API). Minimal information about the breakdown of revenues and usage of the protocol are also available here?

iguana-frontend's People

Contributors

garethfuller avatar arb000r avatar evgenyboxer avatar markusbkoch avatar timjrobinson avatar bonustrack avatar zekraken-bot avatar tomafrench avatar pkattera avatar endymionjkb avatar alter-eggo avatar johngrantuk avatar matthews3301 avatar simeonkerkola avatar mikemcdonald avatar styliann-eth avatar mendesfabio avatar agualis avatar gtaschuk avatar dependabot[bot] avatar rabmarut avatar danielmkm avatar bakamoto20 avatar mikebmikeb avatar acryptosx avatar findtoni avatar alexvansande avatar dkuppitz avatar davis-ramsey avatar cianfru avatar

Stargazers

Luis J. Espinoza avatar

Watchers

 avatar

Forkers

vshailesh

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.