# Use Voltr

The `Use Voltr` tool, part of AgentiPy, allows users to interact with Voltr, which appears to be a platform for DeFi yield strategies or vaults on Solana. It provides functionalities to deposit into and withdraw from strategies, and to fetch position values. These operations are routed through an Agentipy proxy service.

## Functionality

This tool is implemented in the `VoltrManager` class. All its methods interact with an Agentipy proxy service (`agent.base_proxy_url`), sending encrypted private keys and an OpenAI API key with each request. These proxy calls likely translate to on-chain interactions with Voltr's smart contracts.

### Key Methods:

* `deposit_strategy(agent: SolanaAgentKit, deposit_amount: str, vault: str, strategy: str) -> Optional[Dict[str, Any]]`:
  * Deposits funds into a specific Voltr strategy.
  * Parameters:
    * `agent`: The `SolanaAgentKit` instance.
    * `deposit_amount`: The amount to deposit (as a string, possibly to handle large numbers or specific decimal precision via the proxy).
    * `vault`: The address (string) of the Voltr vault.
    * `strategy`: The address (string) of the specific strategy within the vault.
  * Sends a request to the Agentipy proxy endpoint (`/voltr/deposit-strategy`).
  * Returns a dictionary with the transaction details from the proxy or an error.
* `withdraw_strategy(agent: SolanaAgentKit, withdraw_amount: str, vault: str, strategy: str) -> Optional[Dict[str, Any]]`:
  * Withdraws funds from a specific Voltr strategy.
  * Parameters are similar to `deposit_strategy`, with `withdraw_amount` specifying the amount to withdraw.
  * Sends a request to the Agentipy proxy endpoint (`/voltr/withdraw-strategy`).
  * Returns a dictionary with transaction details or an error.
* `get_position_values(agent: SolanaAgentKit, vault: str) -> Optional[Dict[str, Any]]`:
  * Fetches the current position values for a given Voltr `vault` address.
  * This is likely a read-only operation through the proxy.
  * Sends a request to the Agentipy proxy endpoint (`/voltr/get-position-values`).
  * Returns a dictionary with the position values or an error.

##

**Important Considerations:**

* **Proxy Service:** This tool relies on an Agentipy proxy service. The functionality is dependent on this proxy's correct implementation of Voltr interactions.
* **On-Chain DeFi Operations:** Depositing into and withdrawing from Voltr strategies are on-chain transactions that involve your assets and will incur SOL fees. These actions carry financial risk associated with DeFi protocols.
* **Voltr Protocol Specifics:** Understanding Voltr's vaults, strategies, fee structures, and the specific tokens involved is crucial before interacting with it. Vault and strategy addresses must be correct.
* **API Keys:** An `openai_api_key` is passed to the proxy; its role in Voltr operations should be understood from the proxy's documentation. The agent's Solana private key is also encrypted and sent.
* **Amount as String:** The `deposit_amount` and `withdraw_amount` are passed as strings, which might be to maintain precision for token amounts with many decimals when processed by the proxy or smart contract.

## Source Code

You can find the source code for this tool on GitHub: <https://github.com/niceberginc/agentipy/blob/main/agentipy/tools/use_voltr.py>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agentipy.fun/tools/use-voltr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
