acta-maker-sdk 0.8.0

Rust SDK for the Acta options RFQ venue on Solana: maker and vault-operator WebSocket clients, order signing, chain builders
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// The bot's admission for the trading sends an SDK driver makes.
///
/// `admit` runs `enqueue`, a non-blocking enqueue, only while the bot still
/// trades in `connection_epoch`; running it under the gate's own lock keeps a
/// concurrent close from slipping between the check and the enqueue.
pub trait SendGate {
    fn admit<R>(&self, connection_epoch: u64, enqueue: impl FnOnce() -> R) -> Option<R>;
}

/// Admits every send; the epoch check still applies.
#[derive(Debug, Clone, Copy, Default)]
pub struct Ungated;

impl SendGate for Ungated {
    fn admit<R>(&self, _connection_epoch: u64, enqueue: impl FnOnce() -> R) -> Option<R> {
        Some(enqueue())
    }
}