As Polkadot uses NPoS (Nominated Proof-of-Stake), DOT holders stake their DOT tokens to nominate validators to earn yields. Stakers may want to expand the utility of their staked DOT.
Parallel finance comes out a solution to unlock the liquidity of staked DOT without compromising the security of the network.
When the user deposits DOT to the staking pool, he will receive xDOT based on the exchange rate. The staking pool compounds the reward automatically which incentivizes the user to stake early and longer.
After a user receives xDOT, he could use XDOT in the following scenario:
Supply xDOT to the money market to earn double interest
Use xDOT as collateral to borrow other assets
Trade xDOT in open markets
use xDOT as payment
Rf: risk-free rate (Polkadot net staking rewards)
t: number of timer periods
Parallel finance uses auto-selected validators recommended by the Polkadot network for now, and we will implement features that allow xDOT holders to vote for specific validators.
There is a 28-day cool-down period for xDOT holders who want to redeem DOT. We will improve features to reduce the cool-down period and create an xDOT/DOT market for users who need early redemption.
If a nominated validator is slashed during the staking period, Parallel finance will use its reserve fund to cover the loss.
1.1 User transfer KSM from relaychain account to parachain account
1.2 Through XCM from relaychain to parachain
1.3 User receives KSM in our parachain
2.1 User stake KSM in our parachain pool, this pool is controlled by multi-sig account
2.2 Our parachain mint xKSM to user
3.1 Multi-sig via off-chain stake client, for XCM transfer from parachain to relaychain
3.2 Transfer KSM to our relychain multi-sig account(XCM)
4.1 Multi-sig via off-chain stake client, for relaychain operations, include bond\bond_extra, etc.
4.2 Execute operations in relaychain( bond\unbond\bond_extra...)
5.1 Off-chain stake client will monitor the status of both relaychain and parachain relaychain monitor: stake reward\slash...parachain monitor: user stake\unstake, record_rewards
5.2 DB record off-chain database will record multi-sig sequence, and some necessary info
View Data Storage
The exchange rate converts staking native token to voucher.
pub type ExchangeRate<T: Config> = StorageValue<_, Rate, ValueQuery>;
The total amount of a staking asset.
pub type TotalStakingAsset<T: Config> = StorageValue<_, Balance, ValueQuery>;
The total amount of staking voucher.
pub type TotalVoucher<T: Config> = StorageValue<_, Balance, ValueQuery>;
The queue stores all the pending unstaking requests. Key is the owner of assets.
Put assets under staking, the native assets will be transferred to the account owned by the pallet, the user receives the voucher in return, such vouchers can be further used as collateral for lending.
RETURN: Returns Ok() when process_pending_unstake succeeds, otherwise return a substrate error type.
The unbond waiting period is finished, relay chain accounts transfer the free assets to Parallel, and finish the owner's unstake operation by transfer assets back to the owner. May only be called from T::WithdrawOrigin.