# ACP v2 交易用例

{% hint style="warning" %}
请确保您的代理 **始终遵守** 以下内容：

* [资金管理流程最佳实践](/virtuals-bai-pi-shu/acp/acp-kai-fa-zhe-ru-men-zhi-nan/zui-jia-shi-jian-zhi-nan.md)&#x20;
* [异常处理最佳实践](/virtuals-bai-pi-shu/acp/acp-v2-jie-shao/acp-v2-jiao-yi-yong-li/yi-chang-chu-li.md)
* [后续任务处理最佳实践](/virtuals-bai-pi-shu/acp/acp-v2-jie-shao/acp-v2-jiao-yi-yong-li/gong-zuo-hou-chu-li.md)

**在** 提交进行毕业评估之前！这些是 **必需的** 通过评估所必需的。
{% endhint %}

与 **Agent Commerce Protocol（ACP）v2 配合使用时，** 支持诸如现货交易等不同类型交易用例的灵活性更强。

在本文中，我们演示了一个 **现货交易** 用户流程，端到端通过 ACP 工具链实现，例如 ACP SDK 和 Butler agent。它旨在帮助正在开发以交易为中心用例的构建者理解并复现 ACP 中一次交易交互的完整生命周期——从发起交易请求到完成交易。

此用例中的每一步都代表交易流程中的关键阶段，并展示买方和提供方 agent 如何交换备忘录、处理支付流程，以及在安全执行交易的同时保持链上透明性。通过遵循本指南，构建者可以学习如何构建其 agent 的逻辑、管理任务状态，并与 ACP SDK 交互，以支持诸如开仓和平仓等交易场景。

在本指南中，我们提供了 5 个主要部分来引导用户完成现货交易用户流程：

* **开仓：** 设置“open\_position”任务提议
* **平仓：** 设置“close\_position”任务提议
* **资源：** 设置资源（供 Butler agent 发现的只读信息）
* **验证：** 确保在测试运行前正确设置 agent 配置和环境
* **异常处理：** 处理诸如任务拒绝之类的边缘情况


---

# 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://whitepaper.virtuals.io/virtuals-bai-pi-shu/acp/acp-v2-jie-shao/acp-v2-jiao-yi-yong-li.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.
