Skip to content

juster-finance/juster-core

Repository files navigation

Juster

This repository contains smart contracts for Juster protocol V1. This is whitepaper implementation that allows to create price dynamic events using Harbinger price data oracle. This contract allows to create multiple events, configure event creation params, customize liquidity provider fees, control retained profit fees and more.

Contracts

  • Juster - core contract that implements price dynamic events logic with internal constant product market maker
  • Pool - liquidity manager that allows to aggregate liquidity from different users and redistribute it to recurring events
  • Token - [work in progress]
  • Reward Program - [work in progress]

Installation

This project managed by poetry. To install all dependencies run:

make install

Compilation

Contract compilation requires ligo compiler version 0.40.0 or higher. The easiest way to run LIGO is using docker. To compile all contracts:

make compile

Testing

All tests written using PyTezos python library. You need to have python 3.10 or higher to run the tests. PyTezos installation requires to have cryptographic libraries in system. This project using poetry to manage python packages. Before running tests you need to install all dependencies and compile contracts. Then you can call:

make test

Deploying

There are python scripts in the scripts directory that allows to run contracts deployment:

poetry shell
python scripts/deploy_juster.py
python scripts/deploy_pool.py

Note that you need to have key.json key file in your project root directory that will be used to deploy the contract. You can get one for test networks here. Also make sure that your ORACLE_ADDRESS and JUSTER_ADDRESS constants refer to the contract you want to.

Description

There are some flow charts that show Juster core contract implementation details: