# Core Smart Contracts

## The Vault Contract

The `Vault` contract sits at the heart of the Kinstu Liquid Staking process. This contract is the user-facing entry point to the Ike Protocol, and serves a number of functions:

1. **User entry point:** The `Vault` is the user-facing interface to the protocol. Users who want to participate in staking yield can deposit AZERO to the `Vault` contract and receive sA0 tokens in return. Users can also request to redeem their sA0 for staked AZERO along with their pro-rata share of the yield accrued by the protocol.&#x20;
2. **Orchestrates staking delegation & redemption:** The `Vault` delegates staking tokens to, and interfaces with, [Validators](/overview/proof-of-stake-blockchains.md#staking-and-validators), according to the [Target Weights](#target-weights) stored in the [`Registry`](#the-registry-contract) contract. This is done using Ike's [Constant Retargeting Algorithm](/the-ike-protocol/architecture/staking-and-un-staking-mechanisms.md#constant-regargeting-algorithm).
3. **Calculates Protocol Fees:** The `Vault` calculates and stores [Virtual Shares](/the-ike-protocol/definitions.md) used to facilitate protocol [Management Fees](/the-ike-protocol/dao-and-governance/protocol-management-fees.md). For more information, see the docs on Governance & [Management Fees](/the-ike-protocol/dao-and-governance/protocol-management-fees.md).

### Vault Functions

The `Vault` contract contains the [Staking Functions](/the-ike-protocol/architecture/smart-contract-functions.md#staking-functions) and [Unstaking Functions](/the-ike-protocol/architecture/smart-contract-functions.md#unstaking-functions).&#x20;

### Vault Contract Variables

The Vault keeps track of a number of metrics. These include:

1. **Total Pooled:** The total of all AZERO staked via the protocol.
2. **Total Shares:** Denotes the total outstanding supply of sA0 created by the Vault
3. **Virtual Shares:** Denotes the Virtual Shares allocated for [Management Fee](/the-ike-protocol/dao-and-governance/protocol-management-fees.md).
4. **Fee Percentage:** Denotes the protocol's annualized [Management Fee](/the-ike-protocol/dao-and-governance/protocol-management-fees.md).

{% hint style="info" %}
Note: the Redemption Ratio is not stored as a variable, however the`Vault` contract contains methods to calculate it in both directions (from sA0 to AZERO, and vice versa).
{% endhint %}

## The Registry Contract

The `Registry` smart contract maintains a list of [Validators](/overview/proof-of-stake-blockchains.md#staking-and-validators) that are actively participating in the Ike protocol, along with a set of Target Weights for allocation of staked AZERO to those Validators.&#x20;

### Registry Contract Variables

#### Target Weights

These weights represent the target percentage of the total amount of staked AZERO allocated to each Validator. These target weights are meant to uphold decentralization of the protocol, and will be set by Governance in a decentralized way.

## The Share Token Contract

The `share_token` contract is the core contract of the sA0 token. It is a PSP22 token contract.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ike.xyz/the-ike-protocol/architecture/core-smart-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
