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_STREAM_SERVER_HEARTBEAT_MS: u64 = 5_000;
63
64pub const BETFAIR_IDENTITY_LOGIN_URL: &str = "https://identitysso.betfair.com/api/login";
66
67pub const BETFAIR_CERT_LOGIN_URL: &str = "https://identitysso-cert.betfair.com/api/certlogin";
69
70pub const BETFAIR_KEEP_ALIVE_URL: &str = "https://identitysso.betfair.com/api/keepAlive";
72
73pub const BETFAIR_RATE_LIMIT_DEFAULT: &str = "default";
75pub const BETFAIR_RATE_LIMIT_ORDERS: &str = "orders";
76
77pub const BETFAIR_CUSTOMER_ORDER_REF_MAX_LEN: usize = 32;
82
83pub const METHOD_LIST_MARKET_CATALOGUE: &str = "SportsAPING/v1.0/listMarketCatalogue";
85pub const METHOD_LIST_EVENTS: &str = "SportsAPING/v1.0/listEvents";
86pub const METHOD_LIST_CURRENT_ORDERS: &str = "SportsAPING/v1.0/listCurrentOrders";
87pub const METHOD_PLACE_ORDERS: &str = "SportsAPING/v1.0/placeOrders";
88pub const METHOD_CANCEL_ORDERS: &str = "SportsAPING/v1.0/cancelOrders";
89pub const METHOD_REPLACE_ORDERS: &str = "SportsAPING/v1.0/replaceOrders";
90
91pub const METHOD_GET_ACCOUNT_FUNDS: &str = "AccountAPING/v1.0/getAccountFunds";
93pub const METHOD_GET_ACCOUNT_DETAILS: &str = "AccountAPING/v1.0/getAccountDetails";
94
95pub const STREAM_OP_AUTHENTICATION: &str = "authentication";
97pub const STREAM_OP_MARKET_SUBSCRIPTION: &str = "marketSubscription";
98pub const STREAM_OP_ORDER_SUBSCRIPTION: &str = "orderSubscription";
99pub const STREAM_OP_RACE_SUBSCRIPTION: &str = "raceSubscription";
100pub const STREAM_OP_CRICKET_SUBSCRIPTION: &str = "cricketSubscription";
101pub const STREAM_OP_HEARTBEAT: &str = "heartbeat";
102
103pub const HEADER_X_AUTHENTICATION: &str = "X-Authentication";
105pub const HEADER_X_APPLICATION: &str = "X-Application";
106
107pub const DEFAULT_BETTING_TYPE: &str = "ODDS";
109pub const DEFAULT_MARKET_TYPE: &str = "WIN";