Skip to main content

Crate strategy_sdk

Crate strategy_sdk 

Source
Expand description

The Rust SDK for agent authors.

An agent is one long-lived async program. The host starts its run once and never schedules it again: whatever the agent does, it does inside that call, awaiting the streams and the drivers it cares about.

Everything it can reach is an import of the shonin:agent world, and the only way out to a venue is drivers::submit. An agent holds no key and signs nothing; the executor does that, and the venue and the vault’s contracts between them make sure those signatures can only ever move the vault’s own money between the vault’s own accounts.

An agent’s settings are constants in its own code, so run takes no arguments.

Re-exports§

pub use bindings::Guest as Agent;
pub use bindings::shonin::agent::types::Verdict;
pub use bindings::shonin::agent::data;
pub use bindings::shonin::agent::drivers;
pub use bindings::shonin::agent::inference;
pub use bindings::shonin::agent::secrets;
pub use bindings::shonin::agent::transfers;
pub use bindings::shonin::agent::types;
pub use bindings::shonin::agent::vault;
pub use bindings::shonin::agent::websocket;
pub use bindings::wasi::http;
pub use bindings::wasi::keyvalue;
pub use local::AccountEvent;
pub use local::AccountState;
pub use local::Action;
pub use local::MarketState;
pub use local::Order;
pub use local::PositionState;
pub use local::Query;
pub use local::Receipt;
pub use local::Side;
pub use payload::Decimal;
pub use payload::decimal;
pub use payload::from_payload;
pub use payload::millionths;
pub use payload::to_payload;
pub use sizing::Limits;
pub use sizing::size_for;

Modules§

bindings
The generated bindings for the shonin:agent world.
hyperliquid
What an agent says to the hyperliquid driver, and what it hears back.
lighter
What an agent says to the lighter driver, and what it hears back.
local
What an agent says to the local driver, and what it hears back.
orca
What an agent says to the orca driver, and what it hears back.
payload
Turning typed values into the bytes a venue’s adapter reads.
robinhood
What an agent says to the robinhood driver, and what it hears back.
sizing
How big a position an agent will take, and what stops it.
state
The agent’s state: a key-value store of its own, through the standard wasi:keyvalue interfaces.
streams
Shonin’s shared venue streams, as crate::data::subscribe hands them over.

Macros§

export_agent
Declare the agent the host should run.

Constants§

VERSION
This crate’s version. The build service compiles every agent against the SDK it carries, and takes a lock naming the SDK from crates.io at this version or an earlier one compatible with it.