ClayStack is a multichain liquid staking platform that allows users to stake their assets, mint staking derivatives, and participate in DeFi.
csMATIC on Polygon
ClayStack Staked MATIC (PoS) is the csMATIC mapped token. Anytime you interact with csMATIC tokens, verify that the addresses correspond.
ClayMatic interacts directly with Polygon's staking contracts, and not with any validating node.
ClayMatic interacts directly with Polygon's staking contracts, and not with any validating node. This delegated staking structure ensures maximum safety for the users as staked funds are protected by Polygon's contracts and are at no point in custody of the validating node.
To understand more about the contract inner workings, see StakeManager.sol and ValidatorShare.sol.
Polygon's Staking Contracts
ClayMatic interacts directly with Polygon's staking contracts, and not with any validating node.
Rewards APY can range depending on the percentage of MATIC staked across the network.
Unstaking Conditions
ClayStack Standard Unstake feature will use Polygon's checkpoint system to unstake, which currently requires the user to wait for a period of 80 checkpoints before the locked MATIC can be released. Currently this translates to a period of 3-5 days.
Polygon has allocated 12% of its total supply of 10 billion tokens to fund the staking rewards. These rewards are to be distributed over 5 years across participating validating nodes and delegators. Through ClayStack, the user delegates MATIC across several trusted validators.
Rewards APY can range depending on the percentage of MATIC staked across the network.
Staking Rewards
Polygon has allocated 12% of its total supply of 10 billion tokens to fund the staking rewards. These rewards are to be distributed over 5 years across participating validating nodes and delegators.
ClayMatic is the staking protocol implementation for Polygon PoS. A user stakes their MATIC and receives csMATIC, which accrues staking rewards without the need of claiming or re-staking. Polygon's staking protocol lives on Ethereum, where ClayMatic pools MATIC from deposits. The ERC20 token is then staked across trusted validator nodes, and ClayMatic claims and re-stakes rewards on a regular basis.
Overview
ClayMatic is the staking protocol implementation for Polygon PoS. A user stakes their MATIC and receives csMATIC, which accrues staking rewards without the need of claiming or re-staking.
TimeLock
Implements Openzeppelin's TimelockController to introduce time delay on some given functions in ClayMain.
CS_SERVICE_ROLE: Role to execute daily operations on ClayMain without the need of TimeLock
TIMELOCK_ROLE: Role to execute ClayMain operations functions through a TimeLock contract
TIMELOCK_UPGRADES_ROLE: Role to upgrade ClayMain through a TimeLock contract
RoleManager
The protocol implements Openzeppelin's AccessControl contract to determine roles and limit access on methods to ClayMain. The roles implemented are:
Nodes are pre-approved by ClayStack as trusted validators. Their selection is based on their performance record validating transactions, their fees and their SLA.
Nodes
Nodes are pre-approved by ClayStack as trusted validators.
As part of the staking process, the contract will reserve a portion of the funds to act as a liquidity pool, thus enabling the feature "Flash Exit". During a Flash Exit transaction, no unstaking from the validating nodes takes place, instead funds come directly from the contract's token balance.
Flash Exit & Liquidity Pool
As part of the staking process, the contract will reserve a portion of the funds to act as a liquidity pool, thus enabling the feature "Flash Exit".
Rewards
As the staking rewards are distributed to the validators, ClayMain will account for such rewards, while a percentage will be transferred to the ClayStack treasury in accordance to the current fees.
Exchange Rate
The exchange rate of the underlying token to csToken (e.g. MATIC to csMATIC) is calculated as the total amount of tokens (deposits + rewards) divided by the supply of csTokens. The value of the csToken will increase over time with respect to the base token.
On some chains, where slashing is enabled, a particular validator may be penalized due to missing validation checkpoints or misbehaviour, and thus a portion of the staked funds on that given validator is slashed. This will in turn cause the exchange rate to decrease.
Architecture
ClayMain
ClayMain upgradable contract (aka ClayMatic for MATIC or ClayGraph for GRT) is the core contract that acts as a liquid staking pool aggregator. It is responsible for token deposits, minting and burning liquid staking tokens (csTokens), staking/unstaking funds to the validating nodes and applying fees.
On a regular basis an off-chain service calls the public method autobalance triggering the staking of funds into the validating nodes. Any contract or user can call this method.