GithubHelp home page GithubHelp logo

web3v / lighter-v1-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kenadia/lighter-v1-core

0.0 0.0 0.0 44 KB

Lighter V1 Core Contracts

License: Other

TypeScript 44.93% Solidity 55.07%

lighter-v1-core's Introduction

Lighter Exchange V1

Installing the dependencies

yarn install

Compiling the contracts

npx hardhat compile

Running the tests

npx hardhat test

Deployment

This repository also implements a deployment script for test purposes. Deployment script implements functions to for ERC20 token deployments, library, factory, router and order book deployments. On each step of the deployment you need to call the necessary function with necessary parameters and constants.

npx hardhat run scripts/deploy.ts --network yourNetwork

Matching Engine Test

This repository also implements a matching engine test script. Test script implements a matching engine with same functionality as contracts. It creates random limit/market orders, updates/cancels limit orders and compares if the contract has the same limit orders after the transaction with the js matching engine. It also checks if there are any mismatches between the contract token balances and existing orders (sum of active order sizes = contract balance). To run it, you first need to change the constants in the code.

npx hardhat run scripts/test/matchingEngineTest.ts --network yourNetwork

Market Making Script

This repository also implements a simple market maker script. It uses binance APIs to create new market/limit orders on a deployed contract. Once you deploy the contract you need to change the constants in the code to configure it to your deployed contracts.

npx hardhat run scripts/market-making/marketMaking.ts --network yourNetwork

lighter-v1-core's People

Contributors

muratekici 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.