> For the complete documentation index, see [llms.txt](https://docs.aftermath.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aftermath.finance/liquid-staking-afsui/architecture/entry-points.md).

# Entry Points

The protocol provides the following entry points:

## AFSUI Getters

**public fun afsui\_to\_sui\_exchange\_rate()**: Returns AFSUI<->SUI exchange rate for the current epoch.

**public fun afsui\_to\_sui()**: Given AFSUI amount returns corresponding SUI amount.

**public fun sui\_to\_afsui\_exchange\_rate():** Returns SUI<->AFSUI exchange rate for the current epoch.

**public fun sui\_to\_afsui()**: Given SUI amount returns corresponding AFSUI amount.

**public fun total\_sui\_amount()**: Returns total SUI amount locked in the protocol (all principals + rewards)

## Total amounts getters

**public fun total\_rewards\_amount()**: Returns total collected rewards amount.

**public fun epoch\_was\_changed()**: Initiates epoch change processing. May need to be called several times in a row.

## Staking

**public fun request\_stake()**: Delegate SUI coin to the specified validator and return an equivalent amount of AFSUI instantly. Note that the validator has to be active.

**entry fun request\_stake\_and\_keep()**: Keep version which transfers AFSUI to the transaction sender account directly.

**public fun request\_stake\_vec()**: Get a vector of SUI coins, join them, stake to the specified validator and return an equivalent amount of AFSUI instantly. Note that the validator has to be active.

**entry fun request\_stake\_vec\_and\_keep()**: Keep version which transfers AFSUI to the transaction sender account directly.

**public fun request\_stake\_staked\_sui()**: Re-stake provided StakedSui object, mint corresponding amount of AFSUI and return them.

**public fun request\_stake\_staked\_sui\_and\_keep()**: Keep version which transfers AFSUI to the transaction sender account directly.

**public fun request\_stake\_staked\_sui\_vec()**: Get a vector of StakedSui objects, re-stake them, mint corresponding amounts of AFSUI and return them.

**public fun request\_stake\_staked\_sui\_vec\_and\_keep()**: Keep version which transfers AFSUI to the transaction sender account directly.

## Regular Unstaking

**public fun request\_unstake()**: The method gets AFSUI as an input, registers the request to mint the corresponding amount of SUI at the beginning of the next epoch .

**public fun request\_unstake\_vec()**: The method gets a vector of AFSUI coins as an input, joins them, registers the request to mint the corresponding amount of SUI at the beginning of the next epoch.

## Atomic Unstaking

**public fun request\_unstake\_atomic()**: The method gets AFSUI coin as input and returns corresponding amount of SUI instantly.

**entry fun request\_unstake\_atomic\_and\_keep()**: Keep version which transfers SUI to the transaction sender account directly.

**public fun request\_unstake\_vec\_atomic()**: The method gets a vector of AFSUI coins as input, joins them into one, and returns corresponding amount of SUI instantly.

**public fun request\_unstake\_vec\_atomic\_and\_keep()**: Keep version which transfers SUI to the transaction sender account directly.

## Validator Fee

**public fun rotate\_operation\_cap()**: Create and register new Operation Capability Object.

**public fun update\_validator\_fee()**: Change corresponding validator fee.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.aftermath.finance/liquid-staking-afsui/architecture/entry-points.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
