Skip to main content

Manage Position

Generate the transactions needed to perform management actions on an existing yield position. This includes claiming rewards, restaking rewards, claiming unstaked tokens after cooldown, rebonding, voting, and other position lifecycle operations.

When to Use

Activate this skill when the user asks to:
  • Claim staking rewards (e.g., “Claim my ATOM rewards”)
  • Restake/compound rewards (e.g., “Restake my Cosmos rewards”)
  • Claim unstaked tokens after cooldown (e.g., “Claim my unstaked DOT”)
  • Rebond unstaking tokens (cancel unstake)
  • Vote or re-vote with staked tokens
  • Migrate a position
  • Perform any maintenance on an existing position

Authentication

Base URL

Step-by-Step Instructions

Step 1: Check Current Position and Available Actions

First, check the user’s balances to see what management actions are available:
The response shows balance types that indicate available actions:
  • rewards > 0 → CLAIM_REWARDS or RESTAKE_REWARDS available
  • unstaked > 0 → CLAIM_UNSTAKED available
  • unstaking > 0 → REBOND may be available
  • locked > 0 → UNLOCK_LOCKED may be available
  • staked > 0 → VOTE, REVOTE may be available

Step 2: Determine the Management Action

Step 3: Create the Manage Action

Endpoint: POST /v1/actions/manage Request Body (CreateManageActionDto):
The action field is required and must be one of the action types listed above. Example: Claim rewards
Example: Restake rewards
Example: Claim unstaked tokens (after cooldown)
Example: Rebond (cancel unstake)
Response (ActionDto):

Step 4: Sign and Submit Transactions

For each transaction in the response:
  1. Sign the unsignedTransaction
  2. Broadcast to the blockchain
  3. Submit the hash:

Step 5: Verify Completion

Common Workflows

Claim and Restake Rewards (Compound)

  1. Check balances → confirm rewards > 0
  2. Call POST /v1/actions/manage with action: "RESTAKE_REWARDS"
  3. Sign and submit transactions
  4. Rewards are automatically re-deposited into the yield

Claim Unstaked After Cooldown

  1. Check balances → confirm unstaked > 0 (cooldown must be complete)
  2. Call POST /v1/actions/manage with action: "CLAIM_UNSTAKED"
  3. Sign and submit transactions
  4. Tokens are returned to the user’s wallet

Switch Validators (Redelegate)

  1. Query available validators: GET /v1/yields/{yieldId}/validators
  2. Call POST /v1/actions/manage with action: "DELEGATE" and the new validatorAddress
  3. Sign and submit

Error Handling

Edge Cases

  • No rewards to claim: If rewards balance is 0, CLAIM_REWARDS will return a 400. Always check balances first.
  • Cooldown not complete: CLAIM_UNSTAKED will fail if the cooldown period hasn’t elapsed. Check the balance’s completionDate field.
  • Action not supported: Not all manage actions are available for all yields. Lending protocols may not support CLAIM_REWARDS. Check the yield metadata.
  • Validator required: For staking yields, most manage actions require validatorAddress in the arguments.
  • Multiple validators: If the user is staked with multiple validators, manage actions may need to be called per validator.
  • Minimum claim amount: Polygon native staking requires > 1 POL in claimable rewards before claiming is allowed.