Skip to main content
avnu Earn allows users to stake tokens directly through your application, earning rewards while maintaining full custody.
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.

Features

Native Staking

Stake tokens directly to the Starknet staking protocol via avnu’s infrastructure.

Reward Management

Claim rewards or restake them to compound earnings.

Flexible Unstaking

Initiate withdrawals and claim funds after the 7-day unbonding period.

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
// Simple integration
const result = await executeStake({
  provider: account,
  poolAddress: '0x362dc7da60bfddc8e3146028dfd94941c6e22403c98b5947104e637543b475d',
  amount: parseUnits('100', 18)
});

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

Available Actions