# Nosana Staking

# Nosana Staking

The staking program allows users to stake `NOS`

tokens for a variable amount of time. There are 2 values associated with a users stake:

- Staked NOS
- xNOS (Staked NOS x duration)

The staked NOS is the amount of tokens that the vault actually holds for the user that can be slashed or unstaked, while xNOS is a value indicating a users rank for purposes like giveaways and voting.

## Program Information

Info | Description |
---|---|

Type | Solana Program |

Source Code | GitHub |

Build Status | Anchor Verified |

Accounts | `3` |

Instructions | `9` |

Types | `0` |

Domain | `nosana-staking.sol` |

Address | `nosScmHY2uR24Zh751PmGj9ww9QRNHewh9H59AfrTJE` |

## Instructions

A number of 9 instruction are defined in the Nosana Staking program.

## Example

To load the program with Anchor.

```
const programId = new PublicKey('nosScmHY2uR24Zh751PmGj9ww9QRNHewh9H59AfrTJE');
const idl = await Program.fetchIdl(programId.toString());
const program = new Program(idl, programId);
```

## Accounts

A number of 3 accounts make up for the Nosana Staking Program's state.

## xNOS calculation

For people that like to know exactly how Nosana calculate a stakers's $xNOS$ score, we've written it down as a function $f(NOS) = xNOS$. Where $NOS$ denotes the number of Nosana Tokens a staker has staked in the Nosana Staking Program.

$\begin{aligned} f(NOS) &= xNOS \\ &= 1 \frac{ s }{ 10512000 } \times NOS \\ \\ s.t. &\phantom{=} \set{ s \in \mathbb{Z} \mid 1209600 \leq s \leq 31536000 } \end{aligned}$

The $s$ parameter denotes time in seconds, which represents the duration a staker has staked his or her tokens. The parameter $s$ is subject to a set. The stake duration $s$ belongs to the set of integers $\mathbb{Z}$, such that $s$ is greater than or equal to $1209600$ seconds and less than or equal to $31536000$ seconds.

Because it's somewhat difficult to intuitively understand numbers of this magnitude, we can simplify above function to use days rather seconds, which are denoted $d$.

$\begin{aligned} xNOS &= 1 \frac{ d }{ 121 \frac{ 2 }{ 3 } } \times NOS \\ \\ s.t. &\phantom{=} \set{ d \in \mathbb{N} \mid 14 \leq s \leq 365 } \end{aligned}$

The stake duration $d$ belongs to the set of natural numbers $\mathbb{N}$, such that $d$ is greater than or equal to $14$ days and less than or equal to $365$ days.

In more simple phrasing. A staker can stake Nosana Tokens for a minimum of two weeks and a maximum of one year. The longer the duration of a stake, the higher the multiplier against the number of tokens in stake. The maximum multiplier is this system is $4$, because $1 \frac{ 365 }{ 121 \frac{ 2 }{ 3 } } = 4$.