Skip to main content

1. Overview of Position Monitoring

Monitoring positions helps developers retrieve information on liquidity positions associated with a specific wallet. It scans the Solana blockchain for token accounts owned by the wallet, determines which ones represent positions, and decodes the data to provide detailed information about each position. With position monitoring, you can:
  • Identify all liquidity positions held by a wallet
  • Gather information about liquidity, price ranges, and fees earned
  • Track position performance over time
  • Make informed decisions about adjusting or closing positions

2. Fetching Positions

To fetch all position accounts of a wallet, you can use getAllPositionAccountsByOwner.
TypeScript

3. Working with Position Data

After fetching position information, you can use it to:
  1. Track Position Performance: Monitor the performance of each position over time, including fees earned and value changes.
  2. Identify Optimal Actions: Determine when to adjust liquidity, harvest rewards, or close positions based on performance metrics.
  3. Calculate Returns: Compute the return on investment for each position by comparing current value to initial deposit.
  4. Build Trading Strategies: Develop automated strategies for position management based on market conditions.
  5. Portfolio Analytics: Create dashboards to visualize position performance across multiple pools.

4. Implementation Example

Suppose you’re building a portfolio tracker for Whirlpool positions. You can create a monitoring service that periodically:
  1. Fetches all positions for a user’s wallet
  2. Calculates current value and accumulated fees for each position
  3. Compares performance against market benchmarks
  4. Alerts users when positions require attention (e.g., out of range, significant fee accumulation)
This monitoring capability is essential for both manual traders and algorithmic strategies. For example, an autonomous LP management agent can fetch all positions on a schedule, check whether each one is still in range, check whether accumulated fees exceed a harvest threshold, and then act — harvesting, rebalancing, or closing — without human intervention. Combine this page with Harvest and Close Position to build a complete agent loop.

5. Next Steps

After monitoring positions, you might want to:
  • Adjust Liquidity: Modify the amount of liquidity in positions based on their performance.
  • Harvest Rewards: Collect accumulated fees and rewards from profitable positions.
  • Close Position: Exit positions that are no longer aligned with your strategy.
By effectively monitoring positions, you gain the insights needed to optimize your liquidity management strategy and maximize returns.