This repository of smart contracts contains the Lendroid Protocol to demonstrate Leverage on-chain using 0x and Relayers
This repository contains experimental code and is not suitable for production usage.
The smart contracts are being built using truffle, and tested on the Kovan network. All contracts currently belong in the same file for ease of use while importing to the Remix IDE for quick tests.
Oracle.sol
Provides price feeds sourced from various price feed providers
PriceFeed module
Currently uses price feed from api.coinmarketcap.com via Oraclize. This module is open to contributors who can add their own PriceFeedProvider contracts (extend PriceFeedProviderBase.sol)
Wallet.sol
Contains business logic to calculate Lender, Margin account, & Wrangler balances. Also calculates margin balances.
LoanManager.sol
Handles loans. Contains simple CRUD operations on Loan objects.
PositionManager.sol
Handles positions. Contains simple CRUD operations on Position objects.
A placeholder OrderManager.sol
Temporarily handles orders for demo purposes.
git clone [email protected]:gedanziger/protocol-demo.git
cp data_snapshot data
docker-compose run --rm geth_rpc --identity LocalNode --datadir ./data --networkid 1999 removedb
docker-compose run --rm geth_rpc --identity LocalNode --datadir ./data --networkid 1999 account new --password <(echo 123456qwerty)
docker-compose run --rm geth_rpc --identity LocalNode --datadir ./data --networkid 1999 init ./data/genesis.json
docker-compose run --rm geth_rpc --identity LocalNode --datadir ./data --networkid 1999 --gasprice 1
docker-compose run --rm geth_rc --identity LocalNode --datadir ./data --networkid 1999 console