pub const DEFAULT_LIMITS_TOML: &str = "# T-Bank (T-Invest API) rate limits.\n#\n# Source: developer.tbank.ru/invest/intro/intro/limits,\n# error codes: developer.tbank.ru/invest/errors (80001 open streams, 80002 request limit, 80006 error limit).\n#\n# SCOPE (several accounts of one user): the limits are per USER, not per account and not per\n# token. The docs say: \"\u{41b}\u{438}\u{43c}\u{438}\u{442}\u{43d}\u{430}\u{44f} \u{43f}\u{43e}\u{43b}\u{438}\u{442}\u{438}\u{43a}\u{430} \u{440}\u{430}\u{441}\u{43f}\u{440}\u{43e}\u{441}\u{442}\u{440}\u{430}\u{43d}\u{44f}\u{435}\u{442}\u{441}\u{44f} \u{43d}\u{430} \u{432}\u{441}\u{435} \u{430}\u{43a}\u{43a}\u{430}\u{443}\u{43d}\u{442}\u{44b} (\u{441}\u{447}\u{435}\u{442}\u{430}) \u{43f}\u{43e}\u{43b}\u{44c}\u{437}\u{43e}\u{432}\u{430}\u{442}\u{435}\u{43b}\u{44f}\", and the\n# total cap is counted per source address: \"\u{43e}\u{431}\u{449}\u{435}\u{435} \u{447}\u{438}\u{441}\u{43b}\u{43e} \u{437}\u{430}\u{43f}\u{440}\u{43e}\u{441}\u{43e}\u{432} \u{43f}\u{43e} \u{432}\u{441}\u{435}\u{43c} \u{441}\u{447}\u{435}\u{442}\u{430}\u{43c} \u{438} \u{442}\u{43e}\u{43a}\u{435}\u{43d}\u{430}\u{43c} \u{432} \u{441}\u{435}\u{43a}\u{443}\u{43d}\u{434}\u{443} \u{43d}\u{435}\n# \u{434}\u{43e}\u{43b}\u{436}\u{43d}\u{43e} \u{43f}\u{440}\u{435}\u{432}\u{44b}\u{448}\u{430}\u{442}\u{44c} 50\". Hence ONE BrokerLimiter for everything one user runs from one IP: every\n# UserDataConnector (any account_id) and every MarketDataConnector that uses the user\'s tokens share the\n# same Arc<BrokerLimiter>. (Accounts are isolated for portfolio/margin, not for request limits.)\n#\n# Limits are dynamic (\"\u{441}\u{438}\u{441}\u{442}\u{435}\u{43c}\u{430} \u{434}\u{438}\u{43d}\u{430}\u{43c}\u{438}\u{447}\u{435}\u{441}\u{43a}\u{43e}\u{433}\u{43e} \u{444}\u{43e}\u{440}\u{43c}\u{438}\u{440}\u{43e}\u{432}\u{430}\u{43d}\u{438}\u{44f} \u{43b}\u{438}\u{43c}\u{438}\u{442}\u{43e}\u{432}\"): the real per-user values are\n# returned by UsersService/GetUserTariff and in x-ratelimit-limit / -remaining / -reset response headers.\n# The values below are the documented defaults. Interpretation (not verified on the live API): a method\n# that has its own row in the docs table (PostOrder, CancelOrder, ReplaceOrder, GetOrders) is limited by\n# that row, the other methods of the service by the service row.\n#\n# Per-minute limits are token buckets refilled evenly over 60 s. `burst` is kept below the minute quota\n# so a script does not spend the whole minute in the first second.\n\n[tbank.buckets.global]\n# \"\u{440}\u{435}\u{43a}\u{43e}\u{43c}\u{435}\u{43d}\u{434}\u{443}\u{435}\u{43c} ... \u{43d}\u{435} \u{43f}\u{440}\u{435}\u{432}\u{44b}\u{448}\u{430}\u{43b}\u{43e} 50\" requests per second over all accounts and tokens\nrate = 50\nper = \"1s\"\nburst = 50\n\n[tbank.buckets.instruments]\n# Instruments service: 200/min\nrate = 200\nper = \"60s\"\nburst = 20\n\n[tbank.buckets.operations]\n# Operations service (GetPortfolio, GetPositions, GetOperationsByCursor): 200/min\nrate = 200\nper = \"60s\"\nburst = 20\n\n[tbank.buckets.accounts]\n# Accounts service (GetAccounts): 100/min\nrate = 100\nper = \"60s\"\nburst = 10\n\n[tbank.buckets.market_data]\n# Quotes service unary (GetOrderBook, GetLastTrades, GetCandles, GetTradingStatus): 600/min\nrate = 600\nper = \"60s\"\nburst = 50\n\n[tbank.buckets.market_data_subscribe]\n# \"\u{41c}\u{430}\u{43a}\u{441}\u{438}\u{43c}\u{430}\u{43b}\u{44c}\u{43d}\u{43e}\u{435} \u{43a}\u{43e}\u{43b}\u{438}\u{447}\u{435}\u{441}\u{442}\u{432}\u{43e} \u{437}\u{430}\u{43f}\u{440}\u{43e}\u{441}\u{43e}\u{432} \u{43f}\u{43e}\u{434}\u{43f}\u{438}\u{441}\u{43a}\u{438} \u{432} \u{43c}\u{438}\u{43d}\u{443}\u{442}\u{443} - 100\" (per stream)\nrate = 100\nper = \"60s\"\nburst = 20\n\n[tbank.buckets.orders_service]\n# Orders service total (GetOrderState and the rest): 100/min\nrate = 100\nper = \"60s\"\nburst = 20\n\n[tbank.buckets.order_post]\n# PostOrder: 15 per second (900/min)\nrate = 15\nper = \"1s\"\nburst = 15\n\n[tbank.buckets.order_cancel]\n# CancelOrder: 300/min. Separate bucket, so cancels are never starved by placements\nrate = 300\nper = \"60s\"\nburst = 30\n\n[tbank.buckets.order_replace]\n# ReplaceOrder: 300/min\nrate = 300\nper = \"60s\"\nburst = 30\n\n[tbank.buckets.orders_get]\n# GetOrders: 200/min\nrate = 200\nper = \"60s\"\nburst = 20\n\n[tbank.buckets.instruments_list]\n# Whole-kind listings (Shares, Bonds, Etfs, Futures, Options, Currencies): 15/min. One bucket for all\n# six: the docs give the limit for the group of methods, not per method (not verified on the live API).\nrate = 15\nper = \"60s\"\nburst = 3\n\n[tbank.buckets.stop_orders]\n# Stop orders service (PostStopOrder, CancelStopOrder): 50/min\nrate = 50\nper = \"60s\"\nburst = 10\n\n[tbank.buckets.stop_orders_get]\n# GetStopOrders has its own row in the docs table: 60/min\nrate = 60\nper = \"60s\"\nburst = 10\n\n[tbank.buckets.order_post_async]\n# PostOrderAsync: 600/min\nrate = 600\nper = \"60s\"\nburst = 30\n\n[tbank.buckets.operations_reports]\n# Reports in the operations service (GetBrokerReport, GetDividendsForeignIssuer): 5/min\nrate = 5\nper = \"60s\"\nburst = 1\n\n[tbank.buckets.sandbox]\n# Sandbox service, every method: 200/min\nrate = 200\nper = \"60s\"\nburst = 20\n\n[tbank.buckets.signals]\n# Signals service (GetStrategies, GetSignals): 100/min\nrate = 100\nper = \"60s\"\nburst = 10\n\n[tbank.buckets.default]\n# Anything without a route of its own (a method added to the API later, a stream opened through\n# raw()). 100/min is the number the docs table gives most services; the shared \"global\" bucket still\n# applies on top.\nrate = 100\nper = \"60s\"\nburst = 10\n\n[tbank.route]\n# \"*\" = methods with no route below. Used by raw(), so no call goes out without spending quota.\n\"*\" = [\"global\", \"default\"]\nPostOrder = [\"global\", \"order_post\"]\nCancelOrder = [\"global\", \"order_cancel\"]\nReplaceOrder = [\"global\", \"order_replace\"]\nGetOrders = [\"global\", \"orders_get\"]\nGetOrderState = [\"global\", \"orders_service\"]\nGetOrderBook = [\"global\", \"market_data\"]\nGetLastTrades = [\"global\", \"market_data\"]\nGetCandles = [\"global\", \"market_data\"]\nGetTradingStatus = [\"global\", \"market_data\"]\nSubscribeMarketData = [\"global\", \"market_data_subscribe\"]\nFindInstrument = [\"global\", \"instruments\"]\nGetInstrumentBy = [\"global\", \"instruments\"]\nTradingSchedules = [\"global\", \"instruments\"]\nShares = [\"global\", \"instruments_list\"]\nBonds = [\"global\", \"instruments_list\"]\nEtfs = [\"global\", \"instruments_list\"]\nFutures = [\"global\", \"instruments_list\"]\nOptions = [\"global\", \"instruments_list\"]\nCurrencies = [\"global\", \"instruments_list\"]\nGetPortfolio = [\"global\", \"operations\"]\nGetPositions = [\"global\", \"operations\"]\nGetOperationsByCursor = [\"global\", \"operations\"]\nGetAccounts = [\"global\", \"accounts\"]\n\n# Everything below: the rest of the API, reachable through raw() and the stop order trait.\n# Instruments service (200/min), the listed kinds are 15/min, see instruments_list.\nGetAssets = [\"global\", \"instruments_list\"]\nBondBy = [\"global\", \"instruments\"]\nGetBondCoupons = [\"global\", \"instruments\"]\nGetBondEvents = [\"global\", \"instruments\"]\nCurrencyBy = [\"global\", \"instruments\"]\nEtfBy = [\"global\", \"instruments\"]\nFutureBy = [\"global\", \"instruments\"]\nOptionBy = [\"global\", \"instruments\"]\nOptionsBy = [\"global\", \"instruments\"]\nShareBy = [\"global\", \"instruments\"]\nIndicatives = [\"global\", \"instruments\"]\nGetAccruedInterests = [\"global\", \"instruments\"]\nGetFuturesMargin = [\"global\", \"instruments\"]\nGetDividends = [\"global\", \"instruments\"]\nGetAssetBy = [\"global\", \"instruments\"]\nGetFavorites = [\"global\", \"instruments\"]\nEditFavorites = [\"global\", \"instruments\"]\nCreateFavoriteGroup = [\"global\", \"instruments\"]\nDeleteFavoriteGroup = [\"global\", \"instruments\"]\nGetFavoriteGroups = [\"global\", \"instruments\"]\nGetCountries = [\"global\", \"instruments\"]\nGetBrands = [\"global\", \"instruments\"]\nGetBrandBy = [\"global\", \"instruments\"]\nGetAssetFundamentals = [\"global\", \"instruments\"]\nGetAssetReports = [\"global\", \"instruments\"]\nGetConsensusForecasts = [\"global\", \"instruments\"]\nGetForecastBy = [\"global\", \"instruments\"]\nGetRiskRates = [\"global\", \"instruments\"]\nGetInsiderDeals = [\"global\", \"instruments\"]\nStructuredNoteBy = [\"global\", \"instruments\"]\nStructuredNotes = [\"global\", \"instruments\"]\n# Quotes service unary (600/min)\nGetLastPrices = [\"global\", \"market_data\"]\nGetTradingStatuses = [\"global\", \"market_data\"]\nGetClosePrices = [\"global\", \"market_data\"]\nGetTechAnalysis = [\"global\", \"market_data\"]\nGetMarketValues = [\"global\", \"market_data\"]\n# Operations service (200/min); reports 5/min\nGetOperations = [\"global\", \"operations\"]\nGetWithdrawLimits = [\"global\", \"operations\"]\nGetBrokerReport = [\"global\", \"operations_reports\"]\nGetDividendsForeignIssuer = [\"global\", \"operations_reports\"]\n# Orders service (100/min); PostOrderAsync has its own row\nPostOrderAsync = [\"global\", \"order_post_async\"]\nGetMaxLots = [\"global\", \"orders_service\"]\nGetOrderPrice = [\"global\", \"orders_service\"]\n# Stop orders service (50/min), GetStopOrders 60/min\nPostStopOrder = [\"global\", \"stop_orders\"]\nCancelStopOrder = [\"global\", \"stop_orders\"]\nGetStopOrders = [\"global\", \"stop_orders_get\"]\n# Users service (accounts, 100/min)\nGetMarginAttributes = [\"global\", \"accounts\"]\nGetUserTariff = [\"global\", \"accounts\"]\nGetInfo = [\"global\", \"accounts\"]\nGetBankAccounts = [\"global\", \"accounts\"]\nCurrencyTransfer = [\"global\", \"accounts\"]\n# Signals service (100/min)\nGetStrategies = [\"global\", \"signals\"]\nGetSignals = [\"global\", \"signals\"]\n# Sandbox service (200/min, one row for every method)\nOpenSandboxAccount = [\"global\", \"sandbox\"]\nGetSandboxAccounts = [\"global\", \"sandbox\"]\nCloseSandboxAccount = [\"global\", \"sandbox\"]\nPostSandboxOrder = [\"global\", \"sandbox\"]\nPostSandboxOrderAsync = [\"global\", \"sandbox\"]\nReplaceSandboxOrder = [\"global\", \"sandbox\"]\nGetSandboxOrders = [\"global\", \"sandbox\"]\nCancelSandboxOrder = [\"global\", \"sandbox\"]\nGetSandboxOrderState = [\"global\", \"sandbox\"]\nGetSandboxOrderPrice = [\"global\", \"sandbox\"]\nGetSandboxPositions = [\"global\", \"sandbox\"]\nGetSandboxOperations = [\"global\", \"sandbox\"]\nGetSandboxOperationsByCursor = [\"global\", \"sandbox\"]\nGetSandboxPortfolio = [\"global\", \"sandbox\"]\nSandboxPayIn = [\"global\", \"sandbox\"]\nGetSandboxWithdrawLimits = [\"global\", \"sandbox\"]\nGetSandboxMaxLots = [\"global\", \"sandbox\"]\nPostSandboxStopOrder = [\"global\", \"sandbox\"]\nGetSandboxStopOrders = [\"global\", \"sandbox\"]\nCancelSandboxStopOrder = [\"global\", \"sandbox\"]\n\n[tbank.conns]\n# Stream connections per user: market data 32; orders 16 per stream type; operations 11 per stream type\n# (max_conns below is the tightest of them).\n# 300 simultaneous subscriptions (candles + order books + trades together) inside one market-data stream.\n# The unary calls share one HTTP/2 channel, so there are no dedicated command connections.\nmax_conns = 11\nmax_subs_per_conn = 300\nsupports_multiplex = true\n";Expand description
The bundled default limits, as documented by T-Bank (the text of limits.toml).
Parse it with limits_from_toml_str, or call default_limits.