How georgeqanfin-stack/stf-alpha-pricer works
STF-Alpha-Pricer is a Streamlit commodity trade-finance pricing engine. A user supplies deal terms; the app combines a macro credit-risk prediction, corridor-specific FX hedge cost, commodity volatility adjustment, tenor adjustment, and margin into an all-in rate and finance cost, then presents a rate waterfall and market context. The runtime implementation is concentrated in app/app.py; the separate pricing stages below are logical responsibilities within that file, not independently sampled modules. README capabilities are included; runtime data wiring is based on the sampled app source.
Main entry points: app.py Streamlit App · fred_master.csv Macro Series · xgboost_model.pkl XGBoost Model · fx_oracle_clean.csv FX Regimes
Components 15
Deal Interface
- Streamlit App
app/app.py - Deal Terms
app/app.py - Rate Waterfall
app/app.py - Market Context
app/app.py
Pricing Engine
- Macro Risk Pricing
app/app.py - FX Hedge Pricing
app/app.py - Commodity Adjustment
app/app.py - Tenor and Margin
app/app.py - Finance Cost
app/app.py
Local Inputs
- Macro Series
app/data/fred_master.csv - XGBoost Model
app/data/xgboost_model.pkl - FX Regimes
app/data/fx_oracle_clean.csv - Corridor Map
app/data/corridor_map.csv - Commodity Volatility
app/data/commodity_adj.csv
Other components
- Deal User
Connections 15
- Deal User → Deal Terms: enters terms
- Deal Terms → Streamlit App: submits deal
- Streamlit App → Macro Series: reads series
- Streamlit App → XGBoost Model: loads model
- Streamlit App → Macro Risk Pricing: predicts spread
- Streamlit App → Corridor Map: reads mapping
- Streamlit App → FX Regimes: selects regime
- Streamlit App → FX Hedge Pricing: gets hedge cost
- Streamlit App → Commodity Volatility: reads adjustment
- Streamlit App → Commodity Adjustment: gets adjustment
- Streamlit App → Tenor and Margin: calculates additions
- Streamlit App → Finance Cost: calculates cost
- Streamlit App → Rate Waterfall: renders breakdown
- Streamlit App → Market Context: renders context
- Streamlit App → Deal User: shows pricing