Parallel finance a decentralized lending protocol built on top of the Polkadot ecosystem. Our unique approach will allow users to earn "double interests" from staking and lending their tokens simultaneously.

Overview

Parallel Finance

GitHub last commit CI Discord chat

A new Cumulus-based Substrate node, ready for hacking 🚀

Getting Started

Follow these steps to get started with the Cumulus Template 🛠️

Setup

First, complete the basic Rust setup instructions.

If necessary, refer to the setup instructions at the Substrate Developer Hub.

Build

Once the development environment is set up, build the node template. This command will build the Wasm and native code:

cargo build --release

Run

Local Testnet

Polkadot (rococo-v1 branch, better use commit hash: f3e2cbf49f179104d20b9f1b54830710ddac8be3):

cargo build --release --features real-overseer

./target/release/polkadot build-spec --chain rococo-local --raw --disable-default-bootnode > rococo_local.json

./target/release/polkadot --chain ./rococo_local.json -d cumulus_relay0 --validator --alice --port 50555

./target/release/polkadot --chain ./rococo_local.json -d cumulus_relay1 --validator --bob --port 50556 \
        --bootnodes /ip4/127.0.0.1/tcp/50555/p2p/<ALICE's peer id>

Substrate Parachain Template:

# this command assumes the chain spec is in a directory named polkadot that is a sibling of the working directory
./target/release/parallel -d local-test --collator --alice --ws-port 9915 --parachain-id 200 -- --chain ../polkadot/rococo_local.json \
        --bootnodes /ip4/127.0.0.1/tcp/50555/p2p/<ALICE's peer id>

Registering on Local Relay Chain

In order to produce blocks you will need to register the parachain as detailed in the Substrate Cumulus Workshop by going to

Developer -> sudo -> paraSudoWrapper -> sudoScheduleParaInitialize(id, genesis)

Ensure you set the ParaId to 200 and the parachain: Bool to Yes.

The files you will need are in the ./resources folder, if you need to build them because you modified the code you can use the following commands

cargo build --release
# Build the Chain spec
./target/release/parallel build-spec --disable-default-bootnode > ./resources/template-local-plain.json
# Build the raw file
./target/release/parallel build-spec --chain=./resources/template-local-plain.json --raw --disable-default-bootnode > ./resources/template-local.json


# export genesis state and wasm
./target/release/parallel export-genesis-state --parachain-id 200 > ./resources/para-200-genesis
./target/release/parallel export-genesis-wasm > ./resources/para-200.wasm

Embedded Docs

Once the project has been built, the following command can be used to explore all parameters and subcommands:

./target/release/parallel -h

Learn More

Refer to the upstream Substrate Developer Hub Node Template to learn more about the structure of this project, the capabilities it encapsulates and the way in which those capabilities are implemented. You can learn more about The Path of Parachain Block on the official Polkadot Blog.

Comments
  • Refactor/bond amount

    Refactor/bond amount

    Close #924

    • Remove StakingPool storage
    • Remove TotalSlash storage
    • Remove record_staking_settlement call
    • Add update_bond_amount call to update exchange rate
    opened by alannotnerd 103
  • AMM pool creation via governance only

    AMM pool creation via governance only

    This PR modifies the pallet-amm to stop allowing normal users to create any pool. Instead, an AMM pool need to be created by a dedicate Origin, configurable via CreatePoolOrigin.

    TBD:

    • [x] update runtimes and bump versions
    • [x] update amm benchmarks
    • [x] update router benchmarks
    • [x] recompute weights
    opened by ETeissonniere 28
  • allow to dissolve vault

    allow to dissolve vault

    When a vault is Closed of Failed we need a method to cleanup the vault.

    Cleaning up a vault requires us to refund any contributions to the vault before removing the item from storage.

    We’ll need to implement two new extrinsics that 1. allow us to refund contributors and 2. dissolve the vault.

    Below details are provided that explain the steps of this process.

    opened by GopherJ 17
  • [`loans`] Incorporate `Market` structure

    [`loans`] Incorporate `Market` structure

    Part 2 of #248. Depends on #256

    Only cargo check is working. Tomorrow I will fix cargo test and all remaining non-production code. In the meanwhile, feel free to review this PR.

    opened by c410-f3r 13
  • Add incentive reserved ratio &  Add liquidation threshold

    Add incentive reserved ratio & Add liquidation threshold

    @zhoujia6139 @yz89

    After checking the liquidate_borrow impl seems for ED-1392 we do not need to setup another reserve address. Just update liquidator's voucher_balance a little less should be enough and the left part will automatically reserved in our pallet account. Correct me if I'm wrong.

    PS: The pr is not ready yet, just ignore the hard coded ratio will remove to runtime config later or as initialized parameter of market.

    opened by yrong 12
  • Release cDOT-lease only after winning

    Release cDOT-lease only after winning

    Since we would like to mint cDOT only when vault becomes succeeded. To achieve this, we can mint cDOT in on_idle hook instead of XCM callback.

    However, since we will transfer user's balance to vault_account_id, for the failed ones, then don't have cDOT anymore so they cannot claim cDOT on their own. We will need to add RefundingVaults storage and refund DOT to users after failing.

    Basically MintingVaults and RefundingVaults are arrays. They just record the succeeded/failed vaults. When the governance call auction_succeeded we should add the vault 's paraid and id to MintingVaults after receiving the notification. When the governance call auction_failed or slot_expired we should add the vault's paraid and id to RefundingVaults after receiving the notification.

    Then in on_idle hook, we can refund to user OR mint cDOT for user using contribution_iterator

    opened by GopherJ 12
  • release stake-client v1

    release stake-client v1

    There are still some errors which need to be solved

    RawEvent:Err(Codec(Error { cause: Some(Error { cause: None, desc: "Could not decode `DispatchClass`, variant doesn't exist" }), desc: "Could not decode `DispatchInfo::class`" }))
    RawEvent:Err(Codec(Error { cause: Some(Error { cause: None, desc: "Could not decode `DispatchClass`, variant doesn't exist" }), desc: "Could not decode `DispatchInfo::class`" }))
    
    opened by GopherJ 12
  •  Asset-manager for foreign xcm related assets

    Asset-manager for foreign xcm related assets

    • [x] Sync upstream & make it compile
    • [x] Integrate into heiko runtime first
    • [x] Add some integration test for crosschain transfer
    • [x] Add an foreign asset from statemine in this way as demonstration
    • [x] Some test in kusama to finalize fee required
    • [x] Some refact and add to other runtime
    • [x] Some integration test to make sure not break anything previously work
    • [x] Revamp retrieving statemine transfer fee from on-chain storage(seems xcm-helper a good option)
    • [x] Benchmark
    • [x] Temporary remove from heiko and add to kerria first
    • [x] Resolve conflicts
    • [x] Some test in polkadot network to finalize
    opened by ghost 10
  • Test storage migration and try runtime

    Test storage migration and try runtime

    Motivation

    Since parallel-heiko become a parachain of Kusama, it's better for us to use runtime-upgrade in our test network, so storage migration and try runtime is necessary.

    Suggested Solution

    • [x] test storage migration
    • [x] test try-runtime
    • [x] https://github.com/paritytech/substrate/issues/10407
    • [x] test locally (need two times upgrade)
    • [ ] ~~test runtime upgrade on westend~~
    high priority require-storage-migration 
    opened by MrPai 9
  •  highly out of sync

    highly out of sync

    Restarting the docker service node will synchronize to the latest height, and then it will not be synchronized

    logs image

    config --chain=parallel --ws-port=9944 --ws-external --rpc-external --rpc-cors=all --execution=wasm --ws-max-connections=2000

    question 
    opened by zmyya 3
  • Repeaters should sync with ORML members

    Repeaters should sync with ORML members

    we should be able to abstract members and repeaters. We should be able to fetch data about repeaters as members in the orml pallet.

    • what was repeater X's last submission for Asset 1
    • ^ if last value was >30% from mean value; slash
    question 
    opened by drbh 0
Releases(v1.9.4)
Owner
parallel-finance
parallel-finance
Parallel iterator processing library for Rust

Parallel iterator processing library for Rust I keep needing one, so I wrote it. See [IteratorExt] for supported operations. In essence, if you have:

Dawid Ciężarkiewicz 82 Dec 31, 2022
A simple and fast download accelerator, written in Rust

zou A simple and fast download accelerator, written in Rust Zou is a Snatch fork by @k0pernicus. Snatch is a fast and interruptable download accelerat

Antonin Carette 173 Dec 4, 2022
GTK application for browsing and installing fonts from Google's font archive

Font Finder This project is a from-scratch implementation of TypeCatcher in Rust. It is a GTK3 application for browsing through and installing fonts f

Michael Murphy 252 Dec 26, 2022
Linux Kernel Manager and Activity Monitor 🐧💻

Linux Kernel Manager and Activity Monitor ?? ?? The kernel is the part of the operating system that facilitates interactions between hardware and soft

Orhun Parmaksız 1.7k Jan 5, 2023
A project for automatically generating and maintaining Debian repositories from a TOML spec.

Debian Repository Builder A simple utility for constructing and maintaining Debian repositories. Configuration of a repo is based on the directory hie

Pop!_OS 52 Feb 7, 2022
Utility that takes logs from anywhere and sends them to Telegram.

logram Utility that takes logs from anywhere and sends them to Telegram. Supports log collection from files, journald and docker containers. More abou

Max Eliseev 85 Dec 22, 2022
A safe and ergonomic alternative to rm

rip (Rm ImProved) rip is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does not imple

Kevin Liu 781 Jan 7, 2023
A simple, fast and user-friendly alternative to 'find'

fd [中文] [한국어] fd is a program to find entries in your filesytem. It is a simple, fast and user-friendly alternative to find. While it does not aim to

David Peter 25.8k Dec 30, 2022
Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux.

Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux. When is this Rust crate useful? Performance or latency is crucial, and

null 72 Jan 3, 2023
CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path

Move Links CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path (or name). Usage execu

Ben Mefteh 18 May 22, 2022
A tool to simplify reprovisioning a fresh OS. Installs packages and manages dotfiles.

[[TOC]] Comtrya This is better, yes? Warning This tool is ridiculously early in its development. I'm building out features as I migrate my dotfiles ov

David McKay 2 Dec 29, 2022
A tool to simplify reprovisioning a fresh OS. Installs packages and manages dotfiles.

Comtrya This is better, yes? Warning This tool is ridiculously early in its development. I'm building out features as I migrate my dotfiles over. Thos

Comtrya 272 Jan 7, 2023
idf-env tool helps set up and manage ESP-IDF installations

idf-env Tool for maintaining ESP-IDF environment. Quick start Install serial drivers for ESP boards on Windows. Execute following command in PowerShel

Espressif Systems 19 Dec 4, 2022
A system handler to get information and interact with processes written in Rust

A system handler to get information and interact with processes written in Rust

Guillaume Gomez 1.1k Jan 3, 2023
OCI Runtime, Image and Distribution Spec in Rust

oci-spec-rs Open Container Initiative (OCI) Specifications for Rust This library provides a convenient way to interact with the specifications defined

Containers 119 Dec 29, 2022
It is a backup tool that creates backups and stores them on an object storage

Hold My Backup It is a backup tool that creates backups and stores them on an object storage. By default it uses minio but you can use AWS: S3 as well

Taylan Dogan 13 Feb 17, 2022
desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust

desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust. 基于 Rust / WASM 提供截图、取色、键鼠事件监听模拟、压缩解压、图像处理、获取已安装应用等跨平台功能的现代异步 Nodejs 模块,占用空间小, 安装便捷, 使用简单, 高性能, 资源占用极小, 可取代 iohook 和 robotjs

null 48 Dec 15, 2022
`haproxy_autconfd` is a daemon that automatically assembles a HAProxy config and restarts HAProxy if the config changes

haproxy_autconfd Welcome to haproxy_autconfd ?? haproxy_autconfd is a daemon that automatically assembles a HAProxy config and restarts HAProxy if the

null 0 Nov 9, 2021
Reproducible builds, dev envs and deployments.

?? Toros An implementation of Nix in Rust. Syntax support: With NixEL Interpreter support: Int Binding (aliasing) Let-in (flat bindings without interp

Kevin Amado 35 Dec 23, 2022