# suix_getStakes

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://sui-mainnet.g.alchemy.com/v2/{apiKey}

Retrieves all delegated staking positions associated with the specified Sui address. Each entry includes the validator address, the staking pool, and the individual stake details such as amount, status, and epochs.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/suix-get-stakes

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| owner | string | Yes | The Sui address of the staking position owner. |

## Result

**result** (object[]): List of staking entries, grouped by validator address.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "suix_getStakes",
  "params": [
    "0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "validatorAddress": "0x3befb84f03a24386492bd3b05b1fd386172eb450e5059ce7df0ea6d9d6cefcaa",
      "stakingPool": "0x9a95cf69368e31b4dbe8ee9bdb3c0587bbc79d8fc6edf4007e185a962fd906df",
      "stakes": [
        {
          "stakedSuiId": "0xb4eeb46b70f0bebcae832aeef9f7c5db76052ab656e5f81853d0cf701cdbc8eb",
          "stakeRequestEpoch": "62",
          "stakeActiveEpoch": "63",
          "principal": "200000000000",
          "status": "Active",
          "estimatedReward": "520000000"
        },
        {
          "stakedSuiId": "0xf27ab513fc6ef8c344406c78da3d5ad3a5fcc295dc8803c15989a62d33ee8590",
          "stakeRequestEpoch": "142",
          "stakeActiveEpoch": "143",
          "principal": "200000000000",
          "status": "Pending"
        }
      ]
    },
    {
      "validatorAddress": "0x14cfd5e91c13a481370240e392464c329a203fb9f0a8158aaab9b2a90044b26e",
      "stakingPool": "0x14cc7fee4100fdcabda6d15c63c4b49c45ae23f2b936495cd38b1a4b04010295",
      "stakes": [
        {
          "stakedSuiId": "0xbaa75ac72e548aeecf2ce8b4e88530651d6e8f93e0fb79b4bc65a512beb5b9f3",
          "stakeRequestEpoch": "244",
          "stakeActiveEpoch": "245",
          "principal": "200000000000",
          "status": "Unstaked"
        }
      ]
    }
  ],
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://sui-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_getStakes",
  "params": [
    "0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'suix_getStakes',
    params: ['0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e']
  })
};

fetch('https://sui-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getStakes",
    "params": ["0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getStakes\",\n  \"params\": [\n    \"0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://sui-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getStakes\",\n  \"params\": [\n    \"0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://sui-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getStakes\",\n  \"params\": [\n    \"0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e\"\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: suix_getStakes
summary: Governance Read API - Return all [DelegatedStake]
description: |
  Retrieves all delegated staking positions associated with the specified Sui address. Each entry includes the validator address, the staking pool, and the individual stake details such as amount, status, and epochs.
params:
  - name: owner
    required: true
    description: The Sui address of the staking position owner.
    schema:
      type: string
result:
  name: result
  description: List of staking entries, grouped by validator address.
  schema:
    type: array
    items:
      type: object
      properties:
        validatorAddress:
          type: string
          description: Sui address of the validator receiving the stake.
        stakingPool:
          type: string
          description: Sui object ID of the associated staking pool.
        stakes:
          type: array
          description: Individual delegated stake entries.
          items:
            type: object
            properties:
              stakedSuiId:
                type: string
                description: Object ID representing the staked SUI coin.
              stakeRequestEpoch:
                type: string
                description: Epoch in which the staking request was submitted.
              stakeActiveEpoch:
                type: string
                description: Epoch in which the stake becomes active.
              principal:
                type: string
                description: Amount of SUI staked.
              status:
                type: string
                description: Current status of the stake (e.g., Active, Pending, Unstaked).
              estimatedReward:
                type: string
                nullable: true
                description: Estimated reward for the active stake (optional).
examples:
  - name: Get all delegated stakes for an address
    params:
      - name: owner
        value: '0x7d20dcdb2bca4f508ea9613994683eb4e76e9c4ed371169677c1be02aaf0b58e'
    result:
      name: result
      value:
        - validatorAddress: '0x3befb84f03a24386492bd3b05b1fd386172eb450e5059ce7df0ea6d9d6cefcaa'
          stakingPool: '0x9a95cf69368e31b4dbe8ee9bdb3c0587bbc79d8fc6edf4007e185a962fd906df'
          stakes:
            - stakedSuiId: '0xb4eeb46b70f0bebcae832aeef9f7c5db76052ab656e5f81853d0cf701cdbc8eb'
              stakeRequestEpoch: '62'
              stakeActiveEpoch: '63'
              principal: '200000000000'
              status: Active
              estimatedReward: '520000000'
            - stakedSuiId: '0xf27ab513fc6ef8c344406c78da3d5ad3a5fcc295dc8803c15989a62d33ee8590'
              stakeRequestEpoch: '142'
              stakeActiveEpoch: '143'
              principal: '200000000000'
              status: Pending
        - validatorAddress: '0x14cfd5e91c13a481370240e392464c329a203fb9f0a8158aaab9b2a90044b26e'
          stakingPool: '0x14cc7fee4100fdcabda6d15c63c4b49c45ae23f2b936495cd38b1a4b04010295'
          stakes:
            - stakedSuiId: '0xbaa75ac72e548aeecf2ce8b4e88530651d6e8f93e0fb79b4bc65a512beb5b9f3'
              stakeRequestEpoch: '244'
              stakeActiveEpoch: '245'
              principal: '200000000000'
              status: Unstaked
```
