#anchor #solana #crates

yi

Yi Token by Crate Protocol: the standard for auto-compounding single token staking pools

5 releases (3 breaking)

0.4.0 Apr 23, 2022
0.3.0 Feb 26, 2022
0.2.0 Feb 16, 2022
0.1.3 Feb 14, 2022
0.1.1 Feb 9, 2022

#19 in #crate


Used in save-token

AGPL-3.0

28KB
491 lines

yi

Crates.io Docs.rs License Build Status Contributors NPM

Yi Token by Crate Protocol: the primitive for auto-compounding single token staking pools.

About

Yi is a Solana primitive for building single-sided, auto-compounded stake pools. It allows projects to launch Yi Tokens, which are tokens convertible to and from an underlying token.

Some example use cases include:

  • Governance token staking. Protocols may want their governance token to be staked, where fees are converted into the governance token. An example of this is the XSUSHI pool in Sushiswap.
  • Interest-bearing derivatives. A protocol may collect revenue in a token that it wants users to stake, so it may pay fees out by compounding that token. An example of this is Anchor UST.

Usage

First, create a Yi Token by invoking the yi::create_yi_token instruction. Then, anyone may stake tokens into the pool via yi::stake.

To send auto-compounded rewards to the pool, deposit tokens to the YiToken::underlying_tokens token account. This will increase the conversion rate of Yi Tokens to underlying tokens.

To exit the pool, invoke yi::unstake.

Fees

Yi Tokens may take stake or unstake fees. These fees cannot be changed after the construction of the Yi Token. Fees get distributed to stakers within the Yi Token pool.

Packages

Address

The Yi program is deployed on mainnet-beta and devnet at YiiTopEnX2vyoWdXuG45ovDFYZars4XZ4w6td6RVTFm.

License

Yi Token by Crate Protocol is licensed under the Affero General Public License, version 3.0.

Dependencies

~10–22MB
~277K SLoC