> For the complete documentation index, see [llms.txt](https://docs.switchboard.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.switchboard.xyz/ai-agents-llms/switchboard-agent-skill/switchboard-aptos-feeds.md).

# Switchboard Aptos Feeds Skill

## Purpose

Use Switchboard on-demand feeds on Aptos:

* crank/update feeds client-side (pull model)
* consume verified results in Move
* enforce freshness/deviation policies in app logic

## Dependencies

Use exact pins from the [SDK Version Matrix](/tooling/sdk-version-matrix.md).

* `@switchboard-xyz/aptos-sdk@0.1.5`
* `@switchboard-xyz/common@5.7.0`
* `@aptos-labs/ts-sdk@6.1.0`

## Preconditions

* `OperatorPolicy` exists (Aptos network, signer custody, RPC allowlist).

## Inputs to Collect

* network (mainnet/testnet)
* RPC endpoint
* `crossbarUrl` (default: `https://crossbar.switchboard.xyz`)
* aggregator/feed identifiers (addresses/object IDs)
* safety policy (staleness/deviation/min responses) only if risk-sensitive

## Invariants

* Pull-based: client must crank/update feeds to keep data fresh.
* Ensure update action is executed before reading within the same flow (where applicable).

## Playbook (high-level)

* Off-chain:
  * fetch/update payload(s) for the feed/aggregator
  * submit transaction to run the update action (or include it in the same entry call if supported)
* On-chain:
  * read current result + timestamp
  * enforce staleness and deviation vs last stored value

## Minimal Example

```move
use aptos_framework::aptos_coin::AptosCoin;
use aptos_framework::object::{Self, Object};
use switchboard::aggregator::{Self, Aggregator, CurrentResult};
use switchboard::update_action;

public entry fun read_feed(account: &signer, update_data: vector<vector<u8>>) {
    update_action::run<AptosCoin>(account, update_data);
    let feed: Object<Aggregator> = object::address_to_object<Aggregator>(@0xSomeFeedAddress);
    let current: CurrentResult = aggregator::current_result(feed);
    let _price = aggregator::result(&current);
}
```

## Outputs

Produce an `AptosFeedIntegrationPlan` including:

* identifiers and network alignment checks
* crank strategy (if requested)
* Move consumption point and validation policy (if requested)

## References

* <https://docs.switchboard.xyz/docs-by-chain/aptos>
* <https://docs.switchboard.xyz/tooling/crossbar>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.switchboard.xyz/ai-agents-llms/switchboard-agent-skill/switchboard-aptos-feeds.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.
