Skip to content

Demo of the Lendroid Protocol showing Leverage on-chain using 0x

Notifications You must be signed in to change notification settings

lendroidproject/protocol-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protocol-demo

This repository of smart contracts contains the Lendroid Protocol to demonstrate Leverage on-chain using 0x and Relayers

Experimental code

This repository contains experimental code and is not suitable for production usage.

Smart Contracts

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.

Running the code

git clone git@github.com: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

About

Demo of the Lendroid Protocol showing Leverage on-chain using 0x

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published