nautilus_betfair/common/
consts.rs1use std::sync::LazyLock;
19
20use nautilus_model::identifiers::{ClientId, Venue};
21use ustr::Ustr;
22
23pub const BETFAIR: &str = "BETFAIR";
25
26pub static BETFAIR_VENUE: LazyLock<Venue> = LazyLock::new(|| Venue::new(Ustr::from(BETFAIR)));
28
29pub static BETFAIR_CLIENT_ID: LazyLock<ClientId> =
31 LazyLock::new(|| ClientId::new(Ustr::from(BETFAIR)));
32
33pub const BETFAIR_PRICE_PRECISION: u8 = 2;
35
36pub const BETFAIR_QUANTITY_PRECISION: u8 = 2;
38
39pub const BETFAIR_IDENTITY_URL: &str = "https://identitysso-cert.betfair.com/api";
41
42pub const BETFAIR_BETTING_URL: &str = "https://api.betfair.com/exchange/betting/json-rpc/v1";
44
45pub const BETFAIR_ACCOUNTS_URL: &str = "https://api.betfair.com/exchange/account/json-rpc/v1";
47
48pub const BETFAIR_NAVIGATION_URL: &str =
50 "https://api.betfair.com/exchange/betting/rest/v1/en/navigation/menu.json";
51
52pub const BETFAIR_STREAM_HOST: &str = "stream-api.betfair.com";
54
55pub const BETFAIR_RACE_STREAM_HOST: &str = "sports-data-stream-api.betfair.com";
57
58pub const BETFAIR_STREAM_PORT: u16 = 443;
60
61pub const BETFAIR_IDENTITY_LOGIN_URL: &str = "https://identitysso.betfair.com/api/login";
63
64pub const BETFAIR_KEEP_ALIVE_URL: &str = "https://identitysso.betfair.com/api/keepAlive";
66
67pub const BETFAIR_RATE_LIMIT_DEFAULT: &str = "default";
69pub const BETFAIR_RATE_LIMIT_ORDERS: &str = "orders";
70
71pub const BETFAIR_CUSTOMER_ORDER_REF_MAX_LEN: usize = 32;
76
77pub const METHOD_LIST_MARKET_CATALOGUE: &str = "SportsAPING/v1.0/listMarketCatalogue";
79pub const METHOD_LIST_CURRENT_ORDERS: &str = "SportsAPING/v1.0/listCurrentOrders";
80pub const METHOD_PLACE_ORDERS: &str = "SportsAPING/v1.0/placeOrders";
81pub const METHOD_CANCEL_ORDERS: &str = "SportsAPING/v1.0/cancelOrders";
82pub const METHOD_REPLACE_ORDERS: &str = "SportsAPING/v1.0/replaceOrders";
83
84pub const METHOD_GET_ACCOUNT_FUNDS: &str = "AccountAPING/v1.0/getAccountFunds";
86pub const METHOD_GET_ACCOUNT_DETAILS: &str = "AccountAPING/v1.0/getAccountDetails";
87
88pub const STREAM_OP_AUTHENTICATION: &str = "authentication";
90pub const STREAM_OP_MARKET_SUBSCRIPTION: &str = "marketSubscription";
91pub const STREAM_OP_ORDER_SUBSCRIPTION: &str = "orderSubscription";
92pub const STREAM_OP_RACE_SUBSCRIPTION: &str = "raceSubscription";
93pub const STREAM_OP_CRICKET_SUBSCRIPTION: &str = "cricketSubscription";
94pub const STREAM_OP_HEARTBEAT: &str = "heartbeat";
95
96pub const HEADER_X_AUTHENTICATION: &str = "X-Authentication";
98pub const HEADER_X_APPLICATION: &str = "X-Application";
99
100pub const DEFAULT_BETTING_TYPE: &str = "ODDS";
102pub const DEFAULT_MARKET_TYPE: &str = "WIN";