> For the complete documentation index, see [llms.txt](https://soroban-cost-estimator.gitbook.io/soroban-cost_estimator-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soroban-cost-estimator.gitbook.io/soroban-cost_estimator-docs/introduction.md).

# Introduction

`soroban-cost-estimator` is a CLI tool that wraps Stellar's `simulateTransaction` RPC to report the real resource consumption of your compiled Soroban contract `.wasm` files — CPU instructions, memory, read/write ledger entries and bytes, transaction size, and the resulting fee in stroops and XLM. It works from compiled artifacts: no test harness, no local container, no instrumentation of your test code. It simulates the invocation against a live RPC endpoint (testnet, mainnet, or futurenet) and prints a cost report, or a machine-readable JSON document for CI pipelines.

Every other Soroban cost tool tells you what your contract costs today; this one tells you when your cost report is lying to you because the network changed its prices. It snapshots the network's resource-pricing configuration (the `ConfigSettingContract*` ledger entries) as a versioned artifact, diffs it against previous snapshots, and cross-references its own cache of past estimates to tell you exactly which ones are now stale after a pricing change. That makes it a maintenance and monitoring tool, not just a one-shot calculator.

## How this tool relates to other Soroban cost tools

The [Stellar Resource Usage Report](https://github.com/57blocks/stellar-resource-usage-report) is a real-time profiler: it instruments your JavaScript/TypeScript test code and prints resource tables (CPU instructions, memory, ledger entry sizes) from transactions executed against a local `stellar/quickstart` container. It answers *"what did my contract consume while I ran it just now?"*

This tool solves a different problem by a different mechanism. It needs no test harness and no local container — it works from your compiled artifacts and gets real numbers from live `simulateTransaction` RPC simulation against testnet/mainnet. And it does something no other Soroban cost tool does: it tracks the network's resource-pricing configuration as a first-class, versioned artifact.

> ⚠️ **Disclaimer:** This is unaudited developer tooling. Always verify fee estimates against your target network before mainnet deploy.

## Project layout

| Directory | Purpose                                                                                                                                               |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `src/`    | CLI (`cli.rs`), WASM parsing (`wasm/`), RPC client (`rpc/`), fee math (`report/`), config snapshots (`config_snapshot/`), estimate cache (`cache.rs`) |
| `tests/`  | Integration tests plus the fixture contract and its cross-check record (`fixtures/contract/README.md`)                                                |

The full source is on GitHub: <https://github.com/aigbagbobila/soroban-cost-estimator>


---

# 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, and the optional `goal` query parameter:

```
GET https://soroban-cost-estimator.gitbook.io/soroban-cost_estimator-docs/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
