Skip to main content

rungbot_exec/
lib.rs

1//! `rungbot-exec` — opt-in live execution.
2//!
3//! This crate is deliberately **not** a dependency of the `rungbot` crate. The `rungbot`
4//! binary holds no venue key and contains no request signing, and a test asserts that
5//! stays true. Everything that can move money lives here, behind its own binary that you
6//! have to install and arm on purpose.
7//!
8//! The order of operations is the safety property:
9//!
10//! 1. The ladder decides, in `rungbot-core`, with no credential in the process.
11//! 2. [`guard::check`] refuses anything outside the rails.
12//! 3. [`journal`] writes a deterministic id **before** the venue is called.
13//! 4. Only then does a venue client ([`gate`], [`revx`], [`binance`]) sign a request.
14//! 5. [`reconcile`] later reads back what the venue did and books it, and
15//!    [`housekeeping`] acts on it: cost basis, paired sells, retries, reprices, drift.
16//!
17//! Every network call goes through [`http::Transport`], which refuses all of them while
18//! `RUNGBOT_OFFLINE` is set.
19
20#![forbid(unsafe_code)]
21#![deny(clippy::all)]
22
23pub mod balances;
24pub mod binance;
25pub mod clients;
26pub mod dashboard;
27pub mod deploy;
28pub mod deposits;
29pub mod gate;
30pub mod guard;
31pub mod health;
32pub mod heartbeat;
33pub mod housekeeping;
34pub mod http;
35pub mod ids;
36pub mod import;
37pub mod journal;
38pub mod keys;
39pub mod pyfmt;
40pub mod reconcile;
41pub mod revx;
42pub mod run;
43pub mod sellcheck;
44pub mod shadow;
45pub mod store;
46#[cfg(test)]
47mod testenv;
48pub mod venue;
49
50pub use binance::Binance;
51pub use clients::Clients;
52pub use gate::{Gate, PairInfo};
53pub use guard::{Caps, Context, Intent, Mode, Refusal};
54pub use http::VenueError;
55pub use journal::{client_id, root_id, Journal, Order, Side};
56pub use keys::{Credentials, KeyError};
57pub use reconcile::{reconcile, settle_cancel, Adopted, Reconciled, Settled, VenueSource};
58pub use revx::{Revx, RevxCredentials};
59pub use venue::{Balance, Limits, ParsedOrder, Venue};
60
61pub const VERSION: &str = env!("CARGO_PKG_VERSION");
62
63/// The User-Agent of requests that are not venue calls.
64pub const USER_AGENT: &str = concat!("rungbot-exec/", env!("CARGO_PKG_VERSION"));