Deposit into pTokens
Last updated
Last updated
When depositing into the AeroSTETH_ETHPToken, you're providing Aerodrome stETH-ETH LP tokens that will automatically earn yields through Aerodrome. Here's how to do it:
First, check the user's balance and ensure they have enough LP tokens:
Then approve and make the deposit by calling deposit()
in the pToken contract, or depositAsCollateral()
to both deposit and post as collateral all in one transaction.
Function arguments when:
calling deposit()
uint256
assets
The amount of underlying assets to deposit
address
receiver
The account that should receive the pToken shares
calling depositAsCollateral()
uint256
assets
The amount of underlying assets to deposit
uint256
receiver
The account that should receive the pToken shares
Alternatively, if your app requires users depositing for another address, you can use depositAsCollateralFor()
.
When you deposit LP tokens into this yield-optimized pToken:
Your Aerodrome stETH-ETH LP tokens are transferred to the pToken contract.
The pToken automatically stakes these LP tokens in Aerodrome.
The staked position begins earning AERO rewards.
When harvested, these rewards are swapped to ETH and STETH and then deposited into to the Aerodrome pool to mint new LP tokens, which are then staked back in Aerodrome gauge.
This increases the total assets of the pToken, vesting until the next harvest, benefiting all depositors proportionally.