Rewards Structure for Spacewalk Bridge
Introduction
The Spacewalk ecosystem uses a sophisticated fee and reward system to incentivize participants and ensure the smooth operation of the decentralized financial platform. In this blog post, we’ll dive deeper into Spacewalk’s fee and reward model, including its computations, structure, and vital function in promoting network involvement. At the time of publishing. Spacewalk on Amplitude rewards are not yet turned on, but will be soon.
Understanding the Fee and Rewards Source
Fee Distribution from Issue and Redeem Operations
Spacewalk distributes fees generated from issue and redeem operations to collateral providers and nominators. These fees are paid in the wrapped currency associated with the operation. The distribution is proportional to the USD value of collateral across all vaults.
PEN & AMPE Token Rewards
To attract and reward vault operators, Spacewalk will issue PEN tokens as rewards on Pendulum and AMPE tokens on Amplitude. These rewards are fixed in quantity per block and decay exponentially over a monthly basis. The distribution is based on the total collateral provided by each participant, measured in a fixed reference currency (e.g., USD).
Fee and Rewards Model
Two-Layered Rewards System
The rewards system operates in two layers: Layer 1 manages pools per collateral currency, grouping vaults with the same currency, while Layer 2 focuses on individual nominator’s stakes in specific vaults.
Reward Model
Layer 1: Collateral Currency Pools
The first layer consists of pools dedicated to each collateral currency, with one pool per possible collateral currency. Each pool in this layer represents all vaults associated with a specific collateral currency, aggregating their contributions. Within this layer, rewards sourced from fees or those allocated per block are distributed among the pools. The distribution is proportionate to the total USD value staked in each pool, ensuring a fair allocation across the system. This layer distributes the rewards either from the fees or the ones given per block into each pool, proportional to the total staked per pool in USD.
Layer 1 mode
Layer 2: Nominator Stake Tracking and Distribution
In this layer, the system monitors the stake amount contributed by each nominator to individual vaults. Additionally, this layer is responsible for the equitable distribution of rewards among individual nominators.
Layer 2 model
Implementation
Pool types
This implementation uses the following types of pools. We distinguish between pools that are used to store pending rewards to be paid out vs. pools that are used to hold collateral. These two pool types correspond to the two-layer system explained above, namely, Nominator Stake Tracking and Distribution Pools for managing pending rewards distribution, and Collateral Currency Pools for handling and securing the collateralized assets
- (Reward) Each collateral currency used in Spacewalk has its own pool for storing rewards. We will call it
CollateralRewardPool(currency)
. - These are configured to have
PoolId = CurrencyId
andStakeId = VaultId
, meaning that the pools are identified by aCurrencyId
(the collateral currency) and the stakes are deposited byVaultId
s - Managed by the
PooledRewards
pallet. - (Collateral) Each vault has its own internal collateral staking pool that is used by the nominators to contribute to the collateral and is used to distribute the slashing across all participants of that vault.
- This pool is used to hold the collateral of each vault and it also keeps tracks of the rewards each nominator has pending on the vault, although this operation does not happen every time fees are distributed.
- Managed by the
Staking
pallet.
Collateral Reward Pool Update
At any given point, the stake of each vault_id
on its corresponding pool CollateralRewardPool(currency)
of the pooled-rewards
pallet is maintained to be equal to that vault_id
s total_staking
amount from the staking
pallet.
For this reason, for any operation that might change this value like a Withdraw, Deposit, Slash, etc. the pool is updated using the PoolManager
trait implementation.
Calculating the block rewards per collateral
On every new block, the on_initialize
hook of the RewardDistribution
pallet:
- Ensures that the Spacewalk bridge is running (because we only pay out rewards while it’s ‘online’)
- Calculates the total reward that is to be paid out in this block.
- Checks if the reward needs to be adapted based on the decay interval.
- Distributes the fair share of the total reward to each CollateralRewardPool based on the current USD price of each collateral, described in the following section.
Distributing the reward to each vault based on the collateral price
When distributing the reward, we need to consider not only the quantity of collateral provided, but also its current value. For instance, the price of 1 KSM is not equal to the price of 1 USDT, so providing collateral of 1000 KSM versus 1000 USDT should yield different rewards. To accommodate for this, we:
- Calculate the USD value of the total collateral deposited across all collateral currencies
- For each collateral currency:
- Calculate the value of the stake in USD
- Calculate the percentage of how much this collateral contributes to the total collateral.
- Multiply this percentage times the total reward to derive the ‘fair share’ and deposit this reward into the CollateralRewardPool of that collateral currency
More formally, this process is expressed in [1]. We can then obtain the reward per vault using [2].
Distributing bridging fees to each vault and its nominators
All participants within the network, comprising both vaults and their nominators, receive bridging fees. These fees, accrued from issue and redeem requests, are collectively referred to as bridging fees.
Collecting rewards
Old limitation
Previously, it was not possible to withdraw accumulated rewards in any currency. With the current implementation of the fee structure, fees for executed issue and redeem requests are distributed among all network participants (vaults and nominators). This means, that even if a nominator deposits their stake on a specific vault with wrapped currency X
, the nominator would also receive the bridging fees that happen for requests targeting another vault with a different wrapped currency Y
. However, the implementation of the withdraw_rewards
extrinsic of the Fee
pallet was limited to the wrapped and native currency, thus nominators would never be able to claim their other rewards.
Summary of the New Solution
A new extrinsic, collect_reward
, has been introduced in the RewardDistribution
pallet, allowing users to withdraw rewards in any currency. To ensure fairness, pending rewards for all currencies are now distributed whenever a nominator updates their stake to a vault. The system maintains knowledge of existing currencies through the [RewardCurrencies]
storage item in the Staking
pallet, ensuring accurate reward calculations during stake changes.
Importance for the ecosystem
The introduction of the collect_reward
extrinsic in the RewardDistribution
pallet marks a crucial advancement, empowering users to withdraw rewards in any currency, enhancing flexibility. The systematic distribution of pending rewards for all currencies ensures fairness, preventing undue claims. The ecosystem benefits from this innovation by promoting user-friendly reward management and maintaining accurate calculations, fostering a more inclusive and efficient blockchain environment.
About Amplitude
Pioneering the internet of fiat. Amplitude is the sister network of Pendulum on Kusama. It will act as a testing ground for Pendulum applications and network parameters and be powered by the AMPE token.
About Pendulum
Building the missing link between fiat and DeFi through a fiat-optimized smart contract blockchain based on Polkadot’s Substrate. Allowing traditional finance fiat services to integrate with DeFi applications such as specialized forex AMMs, lending protocols, or yield farming opportunities. Developed by SatoshiPay.
Keep your eyes on the Pendulum!
Twitter | Telegram Announcements | Telegram Community | Discord | Reddit