strata-sdk
The official async Rust client for live Strata markets and Sonar quotes.
Install
[]
= "0.1"
= "0.1"
Request a Sonar quote
use ;
use StrataClient;
# async
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
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 for the complete guide.