-
Notifications
You must be signed in to change notification settings - Fork 2
docs: Mais Retorno Free quota limits in resolver cascade #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -92,16 +92,50 @@ Quando `confidence < ~0.9` ou status `candidate`, é gancho de revisão humana. | |||||||||
|
|
||||||||||
| 1. **openfindata** (primário, offline): seed curado + regras estruturais. Resolve | ||||||||||
| o test set sem rede. | ||||||||||
| 2. **Mais Retorno MCP** (dados BR de fundo/CNPJ/classe CVM). | ||||||||||
| 2. **Mais Retorno** (dados BR de fundo/CNPJ/classe CVM) — provider externo | ||||||||||
| opcional via API de dados / MCP; ver limites Free abaixo. | ||||||||||
| 3. **outro provider** (CVM dados abertos / B3). | ||||||||||
| 4. **web_search restrito** a `maisretorno.com`, `b3.com.br`, | ||||||||||
| `yahoofinance.com.br`, `debentures.com.br`. | ||||||||||
|
|
||||||||||
| Cada degrau preenche o que o anterior não trouxe e **baixa a confidence**; | ||||||||||
| `source` reflete a origem final; `cascade` loga o caminho. Os degraus 2 a 4 são | ||||||||||
| um ponto de extensão injetável (`AssetProvider`), consultado só quando o | ||||||||||
| resultado do núcleo está fraco. No estado atual deste PR, **só o degrau 1 está | ||||||||||
| ligado** (os externos são stubs a conectar no deploy). | ||||||||||
| resultado do núcleo está fraco. Hoje **só o degrau 1 está ligado** (os externos | ||||||||||
| são stubs a conectar no deploy). | ||||||||||
|
|
||||||||||
| ### Mais Retorno: plano Free e cotas | ||||||||||
|
|
||||||||||
| O openfindata **não embute** chave nem cota da Mais Retorno. Quem ligar o | ||||||||||
| degrau 2 no deploy usa a conta do operador. A API de dados tem dois canais | ||||||||||
| sobre o **mesmo saldo de créditos** | ||||||||||
| ([developers.maisretorno.com](https://developers.maisretorno.com), conferido em | ||||||||||
| 2026-08-12): | ||||||||||
|
|
||||||||||
| - **REST** (típico para um `AssetProvider` server-side): API key | ||||||||||
| (`X-Api-Key` / `Authorization: Bearer`) gerada em | ||||||||||
| [maisretorno.com/app/meu-perfil/api](https://maisretorno.com/app/meu-perfil/api). | ||||||||||
| - **MCP** (agente de IA): URL | ||||||||||
| `https://data.maisretorno.com/mr-data/v4/mcp`, autenticação **OAuth** (sem | ||||||||||
| api-key). Página de produto: | ||||||||||
| [maisretorno.com/mcp](https://maisretorno.com/mcp). | ||||||||||
|
|
||||||||||
| Limites relevantes do plano **Free** (permanente, sem cartão): | ||||||||||
|
|
||||||||||
| | Item | Free | | ||||||||||
| |---|---| | ||||||||||
| | Créditos | 500/mês no mesmo saldo REST+MCP | | ||||||||||
| | Custo por chamada | variável (ex.: search grátis; `asset-info`/quotes/`fund-class-subclass` = 1; stats/drawdown = 5; `wallet-detail` = 10; compare/backtest = 25) | | ||||||||||
| | Histórico | até 1 ano (planos pagos: histórico completo) | | ||||||||||
| | MCP | disponível no Free (mesmas classes/endpoints dos planos pagos) | | ||||||||||
| | Rate limit | 15 req/s em todos os planos | | ||||||||||
| | Cota esgotada | HTTP 429 até renovar o ciclo (aviso por email ~80%) | | ||||||||||
|
Comment on lines
+131
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: sed -n '90,145p' docs/RESOLVER.md
printf '\n--- external documentation ---\n'
curl -L --max-time 15 -sS https://developers.maisretorno.com/ | head -c 5000Repository: robertoecf/OpenFinData Length of output: 7888 🌐 Web query:
💡 Result: If you receive an HTTP 429 Too Many Requests error when using the Mais Retorno API, it indicates that your current credit balance for the billing cycle has been exhausted [1]. To resolve this issue, you have two options: 1. Automatic Renewal: Your credit balance will automatically reset upon the start of your next monthly billing cycle [1]. 2. Immediate Upgrade: You can regain access immediately by upgrading your current API plan [1]. To manage your consumption and avoid hitting these limits, the official documentation recommends respecting the Cache-Control headers returned by the API [1]. Each endpoint has a defined max-age for caching; by utilizing this, you can significantly reduce the number of unnecessary requests, thereby conserving your credit balance [1]. For instance, endpoints such as /quotes/{identifier} and /asset-info/{identifier} have a cache duration of 90 minutes [1]. Citations: Include the plan-upgrade path for exhausted quotas. Document that HTTP 429 ends when the cycle renews or the operator upgrades the plan. Proposed wording-| Cota esgotada | HTTP 429 até renovar o ciclo (aviso por email ~80%) |
+| Cota esgotada | HTTP 429 até renovar o ciclo ou fazer upgrade (aviso por email ~80%) |📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: MCP tools |
||||||||||
|
|
||||||||||
| Não trate 500 créditos como “500 resoluções”: um provider que chame stats ou | ||||||||||
| carteira consome bem mais por ativo. Fora do escopo dessa API/MCP (não usar | ||||||||||
| como fallback para esses ativos): CRI, CRA, FIDC, debêntures e ativos offshore. | ||||||||||
| Volume e profundidade de histórico sobem nos planos pagos; o rate limit por | ||||||||||
| segundo não. | ||||||||||
|
|
||||||||||
| ## Test set (passa 100%, offline) | ||||||||||
|
|
||||||||||
|
|
@@ -126,7 +160,9 @@ ligado** (os externos são stubs a conectar no deploy). | |||||||||
|
|
||||||||||
| ## Pendências antes de produção | ||||||||||
|
|
||||||||||
| - Conectar os providers externos reais (Mais Retorno MCP, web search restrito). | ||||||||||
| - Conectar os providers externos reais (Mais Retorno via REST/API key do | ||||||||||
| operador — Free = 500 créditos/mês no saldo compartilhado com o MCP —, e | ||||||||||
| web search restrito). | ||||||||||
| - Confirmação ISIN-level da incentivada (12.431) via ANBIMA/debentures.com.br no | ||||||||||
| degrau de cascata — hoje fica `candidate`. | ||||||||||
| - Ampliar o seed curado de ETFs conforme novos ETFs forem listados na B3. | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: robertoecf/OpenFinData
Length of output: 50378
🏁 Script executed:
Repository: robertoecf/OpenFinData
Length of output: 40636
Align the provider contract with the resolver behavior.
The resolver replaces the current
AssetClassificationwith the provider result. It does not merge missing fields or reduceconfidence; it only carries forward the returnedenriched.cascade. Update both descriptions to document provider-controlled overrides, confidence, and cascade entries, or implement the documented merge behavior.📍 Affects 2 files
docs/RESOLVER.md#L101-L102(this comment)src/findata/resolver/engine.py#L14-L15🤖 Prompt for AI Agents