strata-sdk 0.1.2

Official Rust SDK for Strata markets and Sonar quotes.
Documentation
# `strata-sdk`

The official async Rust client for live Strata markets and Sonar quotes.

## Install

```toml
[dependencies]
strata-public-contract = "0.1"
strata-sdk = "0.1"
```

## Request a Sonar quote

```rust
use strata_public_contract::{QuoteRequest, QuoteSide, DEFAULT_SLIPPAGE_BPS};
use strata_sdk::StrataClient;

# async fn run() -> Result<(), Box<dyn std::error::Error>> {
let strata = StrataClient::production()?;

let quote = strata
    .quote(QuoteRequest {
        market_id: "SOL/USDC".into(),
        side: QuoteSide::Sell,
        amount_in_atoms: "10000000".into(),
        slippage_bps: DEFAULT_SLIPPAGE_BPS,
    })
    .await?;

println!("Sonar output: {}", quote.amount_out_atoms);
println!("Minimum:      {}", quote.minimum_output_atoms);
println!("Price impact: {}%", quote.price_impact_pct);
# Ok(())
# }
```

Sonar is Strata's unified liquidity and matching system. The response brings
together expected output, consumed input, fees, minimum output, price impact,
and expiry in one typed result.

## Client operations

| Method | Result |
| --- | --- |
| `capabilities()` | Features currently available through the public contract |
| `markets()` | Strata markets, token decimals, and Sonar quote readiness |
| `quote(request)` | A short-lived Sonar economic quote |
| `execute_quote(...)` | Authenticated Vault-session execution when enabled |

Token amounts use unsigned decimal strings in atomic units. The client validates
contract compatibility, quote binding, lifetime, and economic fields before
returning data to the caller.

`DEFAULT_SLIPPAGE_BPS` is `0` for exact read-only quotes. Set a non-zero
execution tolerance explicitly only when your application is willing to accept
less than the quoted output; `minimum_output_atoms` is the resulting floor.

## Terminal companion

```sh
cargo install strata-agent-cli

strata-agent markets
strata-agent quote --market SOL/USDC --side sell --amount-atoms 10000000
```

Add `--json` for scripts, pipes, and agents.

Execution uses application-owned implementations of `SessionSigner` and
`ExecutionVerifier`. The SDK validates the one-time authorization, quote,
minimum output, expiry, blockhash, prepared response, and receipt. It calls the
verifier before the session adapter can sign and never accepts private key
bytes. The live prepare and submit capabilities remain disabled by default;
the terminal and MCP clients do not submit transactions.

See the [workspace README](https://github.com/alsk1992/strata-sdk-rs) for the
complete guide.