# Use Manifest

The `Use Manifest` tool, part of AgentiPy, allows users to interact with the Manifest protocol on Solana. Manifest appears to be a decentralized exchange or order book protocol. This tool provides functionalities to create markets, place limit orders (individually or in batches), cancel orders, and withdraw assets from markets. These operations are routed through an Agentipy proxy service.

## Functionality

This tool is implemented in the `ManifestManager` 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.

### Key Methods:

* `create_market(agent: SolanaAgentKit, base_mint: str, quote_mint: str) -> Optional[Dict[str, Any]]`:
  * Creates a new trading market on Manifest for a pair of assets.
  * Parameters: `base_mint` (mint address of the base asset) and `quote_mint` (mint address of the quote asset).
  * Returns a dictionary with the transaction details from the proxy or an error.
* `place_limit_order(agent: SolanaAgentKit, market_id: str, quantity: float, side: str, price: float) -> Optional[Dict[str, Any]]`:
  * Places a single limit order on a specified Manifest `market_id`.
  * Parameters: `quantity` (amount to trade), `side` ("buy" or "sell"), and `price`.
  * Returns a dictionary with the transaction details or an error.
* `place_batch_orders(agent: SolanaAgentKit, market_id: str, orders: List[Dict[str, Any]]) -> Optional[Dict[str, Any]]`:
  * Places multiple limit orders in a batch on a specified `market_id`.
  * `orders` is a list of dictionaries, each specifying `quantity`, `side`, and `price`.
  * Returns a dictionary with the transaction details or an error.
* `cancel_all_orders(agent: SolanaAgentKit, market_id: str) -> Optional[Dict[str, Any]]`:
  * Cancels all open orders for the agent's wallet on a specified `market_id`.
  * Returns a dictionary with the transaction details or an error.
* `withdraw_all(agent: SolanaAgentKit, market_id: str) -> Optional[Dict[str, Any]]`:
  * Withdraws all settled assets for the agent's wallet from a specified `market_id`.
  * Returns a dictionary with the transaction details or an error.

##

**Important Considerations:**

* **Proxy Service:** This tool relies on an Agentipy proxy service. The availability, authentication (including the role of the OpenAI API key), and terms of use for this proxy are critical.
* **On-Chain Financial Transactions:** Creating markets, placing orders, and withdrawing assets are all on-chain actions that involve spending SOL for fees and interacting with valuable tokens. Use with caution, especially on Mainnet.
* **Manifest Protocol:** Understanding the specific rules, fee structures, and market identifiers of the Manifest protocol is essential for correct usage.
* **Market ID:** Operations like placing orders require a `market_id`. This ID is likely obtained when a market is created or by querying existing markets on Manifest.

## Source Code

You can find the source code for this tool on GitHub: <https://github.com/niceberginc/agentipy/blob/main/agentipy/tools/use_manifest.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-manifest.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.
