Documentation Index
Fetch the complete documentation index at: https://docs.orca.so/llms.txt
Use this file to discover all available pages before exploring further.
Monitor Positions
- Rust
- TypeScript Kit
- TypeScript Legacy
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
Fetching Positions for a Wallet
Fetching positions is a straightforward process:- RPC Client: Use a Solana RPC client to interact with the blockchain.
- Wallet Address: Provide the wallet address of the user whose positions you want to fetch.
- Fetch Positions: Use the appropriate function to retrieve all positions held by the specified wallet.
Fetching Positions in a Whirlpool
To fetch all positions in a specific Whirlpool:- RPC Client: Use a Solana RPC client to interact with the blockchain.
- Whirlpool Address: Provide the whirlpool address for the positions you want to fetch.
- Fetch Positions: Use the appropriate function to retrieve all positions in a whirlpool.
3. Working with Position Data
After fetching position information, you can use it to:- Track Position Performance: Monitor the performance of each position over time, including fees earned and value changes.
- Identify Optimal Actions: Determine when to adjust liquidity, harvest rewards, or close positions based on performance metrics.
- Calculate Returns: Compute the return on investment for each position by comparing current value to initial deposit.
- Build Trading Strategies: Develop automated strategies for position management based on market conditions.
- 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:- Fetches all positions for a user’s wallet
- Calculates current value and accumulated fees for each position
- Compares performance against market benchmarks
- Alerts users when positions require attention (e.g., out of range, significant fee accumulation)
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.
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
Fetching Positions for a Wallet
Fetching positions is a straightforward process:- RPC Client: Use a Solana RPC client to interact with the blockchain.
- Wallet Address: Provide the wallet address of the user whose positions you want to fetch.
- Fetch Positions: Use the appropriate function to retrieve all positions held by the specified wallet.
Fetching Positions in a Whirlpool
To fetch all positions in a specific Whirlpool:- RPC Client: Use a Solana RPC client to interact with the blockchain.
- Whirlpool Address: Provide the whirlpool address for the positions you want to fetch.
- Fetch Positions: Use the appropriate function to retrieve all positions in a whirlpool.
3. Working with Position Data
After fetching position information, you can use it to:- Track Position Performance: Monitor the performance of each position over time, including fees earned and value changes.
- Identify Optimal Actions: Determine when to adjust liquidity, harvest rewards, or close positions based on performance metrics.
- Calculate Returns: Compute the return on investment for each position by comparing current value to initial deposit.
- Build Trading Strategies: Develop automated strategies for position management based on market conditions.
- 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:- Fetches all positions for a user’s wallet
- Calculates current value and accumulated fees for each position
- Compares performance against market benchmarks
- Alerts users when positions require attention (e.g., out of range, significant fee accumulation)
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.
Identifying Wallet Positions
To fetch all position accounts of a wallet, you can usegetAllPositionAccountsByOwner.
Note: This documentation section is currently being expanded. More detailed examples and usage patterns will be added in future updates.
