Learn
StakeWise v2

StakeWise v2

https://v2.stakewise.io/ (opens in a new tab)

Deployments

Since StakeWise leverages Uniswap v3 pools for farming, many of its whitelisted functions are a subset of those available in Uniswap v3. The PositionsNFT contract below is, in fact, a deployment of Uniswap v3.

NameAddress
PositionsNFT0xC36442b4a4522E871399CD717aBDD847Ab11FE88 (opens in a new tab)
MerkleDistributor0xA3F21010e8b9a3930996C8849Df38f9Ca3647c20 (opens in a new tab)

Action: deposit

Parameters

NameTypeDescription
targetsstring[] (required)Pool name | Pool address
⚠️

If the avatar has approved the Uniswap v3 Positions NFT contract to spend tokens other than the ones specified in tokens, the role will be able to increase any existing positions' liquidity in these tokens as well.

For each StakeWise v2 pool we allow specifying the deposit targets using any of the following identifiers:

  • Pool name.
  • Pool address.

TOKEN below refers to the pool tokens of each element given in targets.

FEE below refers to the fee percentage of each element given in targets.

TOKEN · approve

Approve PositionsNFT to spend TOKEN tokens on behalf of the avatar.

  • Contract: TOKEN

  • Function: approve(address,uint256)

    ParameterConstraint
    spenderequal to PositionsNFT
    amount-

mint · PositionsNFT

Deposit TOKEN tokens to the corresponding Uniswap v3 pool and receive an ERC-721 token (NFT) representing the newly minted liquidity position.

  • Contract: PositionsNFT

  • Function: mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256)) Ξ allow sending ETH

    ParameterConstraint
    params.token0equal to TOKEN
    params.token1equal to TOKEN
    params.feeequal to FEE
    params.tickLower-
    params.tickUpper-
    params.amount0Desired-
    params.amount1Desired-
    params.amount0Min-
    params.amount1Min-
    params.deadline-

Increase the liquidity in a NFT position by adding the desired amounts of token0 and token1.

  • Contract: PositionsNFT

  • Function: increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256)) Ξ allow sending ETH

    ParameterConstraint
    params.tokenId-
    params.amount0Desired-
    params.amount1Desired-
    params.amount0Min-
    params.amount1Min-
    params.deadline-

All positions owned by the avatar will be considered. Ownership is checked dynamically at condition evaluation time through the AvatarIsOwnerOfERC721 (opens in a new tab) custom condition applied to params.tokenId.

decreaseLiquidity · PositionsNFT

Decrease the liquidity in a NFT position by removing the the desired liquidity amount.

  • Contract: PositionsNFT

  • Function: decreaseLiquidity((uint256,uint128,uint256,uint256,uint256))

    ParameterConstraint
    params.tokenId-
    params.liquidity-
    params.amount0Min-
    params.amount1Min-
    params.deadline-

collect · PositionsNFT

Collect accumulated fees from a specific NFT position.

  • Contract: PositionsNFT

  • Function: collect((uint256,address,uint128,uint128))

    ParameterConstraint
    params.tokenId-
    params.recipientequal to AVATAR
    params.amount0Max-
    params.amount1Max-

MerkleDistributor · claim

Claim accrued rewards in rETH2 and SWISE tokens.

  • Contract: MerkleDistributor

  • Function: claim(uint256,address,address[],uint256[],bytes32[])

    ParameterConstraint
    index-
    accountequal to AVATAR
    tokens-
    amounts-
    merkleProof-

If WETH is involved:

collect · PositionsNFT

Collect accumulated fees from a specific NFT position.

  • Contract: PositionsNFT

  • Function: collect((uint256,address,uint128,uint128))

    ParameterConstraint
    params.tokenId-
    params.recipientequal to 0x0000000000000000000000000000000000000000
    params.amount0Max-
    params.amount1Max-

In the Uniswap v3 PositionsNFT contract, the collect function has a special modifier called isAuthorizedForToken. This modifier acts like a gatekeeper, ensuring that only authorized senders can perform this action. Uniswap v3 has these checks built into its system, so there's no need for additional constraints.

refundETH · PositionsNFT

Refunds the unused ETH to the sender address.

  • Contract: PositionsNFT

  • Function: refundETH()

    ParameterConstraint
    N/AN/A

unwrapWETH9 · PositionsNFT

Unwraps a specified amount of WETH and transfers the corresponding ETH to the designated recipient address.

  • Contract: PositionsNFT

  • Function: unwrapWETH9(uint256,address)

    ParameterConstraint
    amountMinimum-
    recipientequal to AVATAR

sweepToken · PositionsNFT

Transfers the specified token amount from the PositionsNFT contract balance to the provided recipient address.

  • Contract: PositionsNFT

  • Function: sweepToken(address,uint256,address)

    ParameterConstraint
    token-
    amountMinimum-
    recipientequal to AVATAR