Git Product home page Git Product logo

lqty-contracts's Introduction

lqty-contracts

Original project documentation

install required packagegs

Run: make install

start services

Run: make start-node

run all tests (with services up)

Run: make test

run demos

Demo 1

Open 3 troves, change AE price and liquidate one in Emergency mode, debt and collateral is porportionally redistributed between rest of open troves.

Calculation are verified in sheet

How to run it: make demo1

Demo 2

Check LQTY token handling, LQTY token holder invest in LQTY pool and get rewards from open and withrdaw AEUSD operations

Calculation are verified in sheet

How to run it: make demo2

Demo 3

Check stability pool, user invest AEUSD in stability pool and get rewards from liquidations.

Calculation are verified in sheet

How to run it: make demo3

Demo oracle

Simple test using the oracle ae-oracle-pricefeed to get AE/USD price from coingeko, also installs a service price-service which periodically pools new prices from the oracle and injects it in loan app.

Run it: make demo-oracle

There is also a variation price-service-query.js, where the pooling service does not inject directly the price from the oracle, instead when the query is ready it sends the query id to the loan app, and the loan app gets directly the price using the query id.

Price feed pooling service

Service that periodically pools new prices ae-oracle-pricefeed oracle, depoying an instance of it, and injects it in loan app (PriceFeedTestnet).

The frequency of the price refreshing can be modified with the environment variable AWAIT_TIMEOUT_SECONDS, the default frequency is 10 seconds.

Run it locally: DEFAULT_NETWORK_NAME=local WALLET_FILE='./config/wallet-price-feed.json' CONTRACT_ADDRESS='ct_2Eee1pWXH6HFTeuTGTFMxMwKg6ydGea4jbo1MQdG7Y9ViuS6BD' AWAIT_TIMEOUT_SECONDS=60 node price-service/price-service.js

Run it testnet: DEFAULT_NETWORK_NAME=testnet WALLET_FILE='./config/wallet-pricefeed-testnet.json' CONTRACT_ADDRESS='ct_6xfAeDxJdYHe6H7WTigtW5p3UHDhRr27PMmUg2iJpDfcCiqJb' AWAIT_TIMEOUT_SECONDS=60 node price-service/price-service.js

lqty-contracts's People

Contributors

bogdan-manole avatar ernius avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lqty-contracts's Issues

[js-tests] Overall tests

https://github.com/liquity/dev/tree/main/packages/contracts/test

  • DeployAndFundLCsTest.js
  • DeployLQTYContractsTest.js
  • DuringLockupPeriodTest.js
  • PostLockupPeriodTest.js
  • AccessControlTest.js
  • BorrowerOperationsTest.js
  • CollSurplusPool.js
  • ConnectContractsTest.js
  • DefaultPoolTest.js
  • FeeArithmeticTest.js
  • GasCompensationTest.js
  • GrowthTokenTest.js
  • HintHelpers_getApproxHintTest.js
  • LQTYIssuanceArithmeticTest.js
  • LQTYStakingFeeRewardsTest.js
  • LUSDTokenTest.js
  • LiquityMathTest.js
  • LiquitySafeMath128Test.js
  • OwnershipTest.js
  • PoolsTest.js
  • PriceFeedTest.js
  • ProxyBorrowerWrappersScript.js
  • SortedTrovesTest.js
  • StabilityPoolTest.js
  • StabilityPool_LQTYIssuanceTest.js
  • StabilityPool_RoundingErrors.js
  • StabilityPool_SPWithdrawalTest.js
  • StabilityPool_SPWithdrawalToCDPTest.js
  • TroveManagerTest.js
  • TroveManager_L

[contracts-dev] test contracts

https://github.com/liquity/dev/tree/main/packages/contracts/contracts/TestContracts

  • DappSys
  • ActivePoolTester.sol
  • BorrowerOperationsTester.sol
  • CDPManagerTester.sol
  • CommunityIssuanceTester.sol
  • DefaultPoolTester.sol
  • Destructible.sol
  • EchidnaProxy.sol
  • EchidnaTester.sol
  • FunctionCaller.sol
  • LQTYStakingTester.sol
  • LQTYTokenTester.sol
  • LUSDTokenCaller.sol
  • LUSDTokenTester.sol
  • LiquityMathTester.sol
  • LiquitySafeMath128Tester.sol
  • MockAggregator.sol
  • MockTellor.sol
  • NonPayable.sol
  • PriceFeedTester.sol
  • PriceFeedTestnet.sol
  • SortedTrovesTester.sol
  • StabilityPoolTester.sol

setup project

  • setup aeproject
  • add initial contracts
  • make support for test
  • add test utilities

revise comments

  • general revise
  • change all camel case identifier names to snake case

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.