> For the complete documentation index, see [llms.txt](https://docs.stake.link/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stake.link/lst-rewards-splitter-contracts/lstrewardssplitter.md).

# LST Rewards Splitter

The `LSTRewardsSplitter` enables an account to deposit LSTs and split any earned rewards between itself and other addresses.

## View Functions

### controller

Returns the address of the controller contract

```solidity
function controller() external view returns (address)
```

#### Return Values

| Name       | Type    | Description                             |
| ---------- | ------- | --------------------------------------- |
| controller | address | address of LSTRewardsSplitterController |

### lst

Returns the address of the liquid staking token handled by this contract

```solidity
function lst() external view returns (address)
```

#### Return Values

| Name | Type    | Description    |
| ---- | ------- | -------------- |
| lst  | address | address of LST |

### principalDeposits

Returns the total number of tokens deposited without rewards

```solidity
function stakingPool() external view returns (uint256)
```

#### Return Values

| Name              | Type    | Description              |
| ----------------- | ------- | ------------------------ |
| principalDeposits | uint256 | total principal deposits |

### checkUpkeep

Returns whether a call should be made to performUpkeep to split new rewards

```solidity
function checkUpkeep(bytes) external view returns (bool, bytes)
```

#### Return Values

| Name         | Type  | Description                                             |
| ------------ | ----- | ------------------------------------------------------- |
| upkeepNeeded | bool  | true if performUpkeep should be called, false otherwise |
|              | bytes |                                                         |

### getFees

Returns a list of all fees

```solidity
function getFees() external view returns (struct LSTRewardsSplitter.Fee[])
```

#### Return Values

| Name | Type                             | Description  |
| ---- | -------------------------------- | ------------ |
| fees | struct LSTRewardsSplitter.Fee\[] | list of fees |

## Write Functions

### deposit

Deposits tokens

```solidity
function deposit(uint256 _amount) external
```

#### Parameters

| Name     | Type    | Description       |
| -------- | ------- | ----------------- |
| \_amount | uint256 | amount to deposit |

### withdraw

Withdraws tokens

```solidity
function withdraw(uint256 _amount, address _receiver) external
```

#### Parameters

| Name       | Type    | Description               |
| ---------- | ------- | ------------------------- |
| \_amount   | uint256 | amount to withdraw        |
| \_receiver | address | address to receive tokens |

### performUpkeep

Splits new rewards between fee receivers

```solidity
function performUpkeep(bytes) external
```

### splitRewards

Splits new rewards between fee receivers

*Bypasses rewardThreshold*

```solidity
function splitRewards() external
```

### addFee

Adds a new fee

```solidity
function addFee(address _receiver, uint256 _feeBasisPoints) external
```

#### Parameters

| Name             | Type    | Description         |
| ---------------- | ------- | ------------------- |
| \_receiver       | address | receiver of fee     |
| \_feeBasisPoints | uint256 | fee in basis points |

### updateFee

Updates an existing fee

```solidity
function updateFee(uint256 _index, address _receiver, uint256 _feeBasisPoints) external
```

#### Parameters

| Name             | Type    | Description         |
| ---------------- | ------- | ------------------- |
| \_index          | uint256 | index of fee        |
| \_receiver       | address | receiver of fee     |
| \_feeBasisPoints | uint256 | fee in basis points |


---

# 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.stake.link/lst-rewards-splitter-contracts/lstrewardssplitter.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.
