> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avnu.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Integrate native staking into your application

avnu Earn allows users to stake tokens directly through your application, earning rewards while maintaining full custody.

<Info>
  **Earn** is our native staking solution for Starknet tokens, starting with STRK and expanding to other assets like BTC variants. Users can delegate their tokens to earn network rewards.
</Info>

## Features

<CardGroup cols={2}>
  <Card title="Native Staking" icon="layer-group">
    Stake tokens directly to the Starknet staking protocol via avnu's infrastructure.
  </Card>

  <Card title="Reward Management" icon="gift">
    Claim rewards or restake them to compound earnings.
  </Card>

  <Card title="Flexible Unstaking" icon="unlock">
    Initiate withdrawals and claim funds after the 7-day unbonding period.
  </Card>
</CardGroup>

## SDK Methods

### Data Fetching

* `getUserStakingInfo(tokenAddress, userAddress)` - Fetch user's staking position
* `getAvnuStakingInfo(tokenAddress)` - Fetch protocol-wide staking stats

### Simple Integration

* `executeStake(params)` - Stake tokens with automatic approvals
* `executeInitiateUnstake(params)` - Start 7-day unbonding period
* `executeUnstake(params)` - Claim unstaked tokens after unbonding
* `executeClaimRewards(params)` - Claim or restake rewards

### Advanced Integration

* `stakeToCalls(poolAddress, amount)` - Build staking calls for custom execution
* `initiateUnstakeToCalls(poolAddress, amount)` - Build unstaking initiation calls
* `unstakeToCalls(poolAddress)` - Build unstaking claim calls
* `claimRewardsToCalls(poolAddress, restake)` - Build reward claim calls

```typescript theme={null}
// Simple integration
const result = await executeStake({
  provider: account,
  poolAddress: '0x362dc7da60bfddc8e3146028dfd94941c6e22403c98b5947104e637543b475d',
  amount: parseUnits('100', 18)
});

// Advanced: compose with other operations
const stakeCalls = await stakeToCalls({ poolAddress, amount });
const { calls: swapCalls } = await quoteToCalls({
  quoteId: quote.quoteId,
  slippage,
  takerAddress: account.address,
});
await account.execute([...swapCalls, ...stakeCalls]);
```

## Available Actions

<CardGroup cols={2}>
  <Card title="Stake" icon="plus" href="/docs/staking/stake">
    Deposit tokens into the staking pool.
  </Card>

  <Card title="Unstake" icon="minus" href="/docs/staking/unstake">
    Withdraw tokens from the staking pool.
  </Card>

  <Card title="Claim Rewards" icon="coins" href="/docs/staking/claim-rewards">
    Harvest earned staking rewards.
  </Card>

  <Card title="Get Info" icon="circle-info" href="/docs/staking/get-info">
    Fetch user staking positions and pool stats.
  </Card>
</CardGroup>
