How dbarnesmathworks/swap-pricer works
Main Components
• App / Frontend: The “App” folder contains the GUI built using MATLAB’s App Designer (SwapPricingSimple.mlapp) and helper functions (getSwapsMAT.m, getYieldCurveFRED.m) that likely fetch required market data.
• Model / Backend Logic: The “Model” folder hosts the core pricing logic (e.g., priceSwapDiscount.m) that implements the mathematical models for discounting and swap pricing.
• Development and Testing Environment: The “Development” folder (with Swap_Development.mlx) and the “Test” folder (with TestSwapPricerAccuracy.m) provide scripts for development experiments and testing the accuracy of the pricing model.
• Resources: The “resources” directory, with its nested “project” folders containing numerous XML files, appears to supply configuration data, metadata, or additional domain-specific definitions needed by the project.
Out the Relationships and Data Flows
• The Frontend (App) receives user inputs and possibly triggers data retrieval (via getSwapsMAT.m and getYieldCurveFRED.m) to obtain real-time or configured market data.
• Upon receiving input data, the App communicates with the Backend (Model), calling functions like priceSwapDiscount.m to execute the core financial calculations.
• The outputs from the Model are then fed back to the App to display pricing results.
• The Testing and Development components validate that the pricing calculations and overall accuracy align with expectations.
• The Resources component provides ancillary configuration and possibly data feeds that might enhance or influence the model’s behavior.
Architectural Patterns and Design Principles
• Separation of Concerns: There is a clear demarcation between the frontend (presentation layer in App) and the backend (financial modeling in Model), with testing and development scripts isolated in their respective folders.
• Modularization: Independent modules (for UI, pricing logic, and tests) ensure maintainability and extensibility.
• Data Flow Emphasis: The fetching of market data via distinct functions (getSwapsMAT.m and getYieldCurveFRED.m) indicates a design that isolates data acquisition from computational logic.
Relevant Technologies
• MATLAB and its App Designer framework.
• MathWorks Financial Instruments Toolbox which underpins the pricing logic.
• MATLAB project files (SwapPricer.prj) that bundle the project configuration and dependencies.
• XML-based resource files may be used for configuration or data inputs.