This project uses the Ethereum blockchain to generate and execute "cost average" orders in a decentralized pipeline. For example:
"Use 100 DAI to buy ETH in 5 batches of 20 DAI, one per day."
Vulcan Swap is divided across three Github repos:
- a smart contracts backend (this repo)
- a React and Drizzle-based client (
vulcanswap-client
) - a serverless script used to queue order execution (
vulcanswap-remote
)
This repo contains the Ethereum smart contracts that are deployed on the Rinkeby network, as well as the contracts and Truffle migrations needed to set up a local development environment with Compound loans and Uniswap's exchange framework. It is configured for development and deployment using the Truffle Framework.
(Note: the migrations only initialize a Compound instance enough to be able to mint and redeem cTokens. It does not provide a Price Oracle or allow for collateralizing or taking out loans.)
https://github.com/SeanJCasey/vulcanswap-client
This repo contains the single page dApp, built on a React + Drizzle frontend.
https://github.com/SeanJCasey/vulcanswap-remote
This repo contains the Node script for calling and executing the checkConversionDueAll()
and executeDueConversion()
methods on the CostAverageOrderBook
smart contract. This is how Uniswap swaps are triggered for orders after a particular amount of time has elapsed.
npm install -g truffle
git clone [email protected]:SeanJCasey/vulcanswap-truffle.git vulcanswap && cd vulcanswap && npm i
git clone [email protected]:SeanJCasey/vulcanswap-client.git client && cd client && npm i && cd..
(Note: the client/builds
folder is where truffle-config.js
is set up to build its smart contracts for easy integration with frontend development.)
git clone [email protected]:SeanJCasey/vulcanswap-remote.git remote && cd remote && npm i & cd..
5. Deploy a local blockchain with Vulcan Swap's main smart contract, plus mock ERC20 tokens, Uniswap, and Compound
truffle develop
Then at the develop>
prompt:
compile
migrate
cd client && npm start
See instructions at https://github.com/SeanJCasey/vulcanswap-remote
Voila! You should be ready to "Go long and prosper" locally.