curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/class_return_distribution \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_classe_anbima": "<string>",
"p_month": null
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/class_return_distribution"
payload = {
"p_classe_anbima": "<string>",
"p_month": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({p_classe_anbima: '<string>', p_month: null})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/class_return_distribution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));[
{
"classe_anbima": "<string>",
"fundo_cotas": "<string>",
"window_months": 123,
"start_month": "2023-12-25",
"end_month": "2023-12-25",
"month_complete": true,
"n_universe": 123,
"n_funds": 123,
"n_excluded_no_quota": 123,
"n_excluded_subclass": 123,
"p25_pct": 123,
"median_pct": 123,
"p75_pct": 123,
"min_funds": 123,
"status": "<string>",
"reason": "<string>"
}
]{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}class_return_distribution
The NET quota return distribution of one ANBIMA class (catalog v66, #609): what an equivalent ETF’s return is set against. Two rows, window_months 12 and 6, ending at the close of end_month (p_month, any day of the month; NULL = the last complete FI month, latest_complete_period(‘fi’)). Funds: FI funds whose newest CVM Extrato files exactly p_classe_anbima (outer spaces trimmed, never a wider class) and FUNDO_COTAS p_fundo_cotas (S or N), and that are active as in portfolio_fee_peers (a quota in fact_fund_monthly in the three reference months ending in end_month): n_universe. Return = (closing quota of end_month / closing quota of start_month - 1) x 100, from fact_fund_monthly’s one stable quota subclass, the quota api.fund_nav serves; the Informe Diario quota is net of the fees the class accrues (research #610), so this is a net return. Excluded and counted: n_excluded_no_quota (no positive quota at either end) and n_excluded_subclass (the quota subclass changed between the ends). p25_pct, median_pct and p75_pct are plain percentiles over the n_funds returns, not winsorized. Fewer than min_funds (30) funds with a return, or an incomplete end_month (mv_period_completeness): status nao_avaliado, NULL statistics and a Portuguese reason, never a fallback. ETFs are not in the universe (SILO keeps them out of fact_fund_monthly). A statistic of a class, not a forecast or a recommendation. p_classe_anbima NULL or blank, or p_fundo_cotas other than S or N, RAISES 22023; the result is two rows, one page.
Row cap. A window producing more than 1000 rows raises SQLSTATE 22023 naming this function. Nothing is trimmed to fit — PostgREST would silently cut the response at 1000 and a cut-short series is indistinguishable from one that simply ends. This function does not page — narrow the window instead.
curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/class_return_distribution \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_classe_anbima": "<string>",
"p_month": null
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/class_return_distribution"
payload = {
"p_classe_anbima": "<string>",
"p_month": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({p_classe_anbima: '<string>', p_month: null})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/class_return_distribution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));[
{
"classe_anbima": "<string>",
"fundo_cotas": "<string>",
"window_months": 123,
"start_month": "2023-12-25",
"end_month": "2023-12-25",
"month_complete": true,
"n_universe": 123,
"n_funds": 123,
"n_excluded_no_quota": 123,
"n_excluded_subclass": 123,
"p25_pct": 123,
"median_pct": 123,
"p75_pct": 123,
"min_funds": 123,
"status": "<string>",
"reason": "<string>"
}
]{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}Authorizations
Body
Response
The result set, oldest first. An unknown id is an empty array, not a 404 and never a guessed value.
Was this page helpful?