etf
Calculate Etf Purification
Calculate the purification amount for an ETF investment.
Given an investment amount and optional dividend income, computes how much money should be donated to purify returns based on each holding's purification rate. Returns both aggregate amounts and a per-holding breakdown.
curl example:
curl -X POST "http://localhost:8000/api/etf/VTI/purification" \
-H "Content-Type: application/json" \
-d '{"investment_amount": 50000, "dividend_income": 1200}'
Python requests example:
import requests
resp = requests.post(
"http://localhost:8000/api/etf/VTI/purification",
json={"investment_amount": 50000, "dividend_income": 1200},
)
data = resp.json()
print(f"Total to purify: ${data['total_purification_amount']:.2f}")
post/api/etf/{symbol}/purification
Request
- Base URL: https://api.halalterminal.com
- URL: https://api.halalterminal.com/api/etf/{symbol}/purification
- Auth: API key in header X-API-Key
Path parameters
symbolstring required
ETF ticker symbol.
Request body
Example request
{
"dividend_income": 1200,
"investment_amount": 50000
}Response
Purification amounts for the investment and optional dividend income.
Example response
{
"dividend_income": 1200,
"dividend_purification_amount": 38.4,
"etf_purification_rate": 3.2,
"holdings": [],
"investment_amount": 50000,
"investment_purification_amount": 1600,
"purification_basis": "whole_fund_conservative",
"symbol": "VTI",
"total_purification_amount": 1638.4
}Changes
No recorded changes to this operation across all 1 revision of this API.