Skip to main content

A tool to analyze interest rate swaps

Project description

Interest Rate Swap Analyzer

A Python package for analyzing interest rate swaps, comparing advantages between parties, and visualizing swap outcomes.

Installation

pip install interest-rate-swap-analyzer

Features

  • Calculate comparative advantages in interest rate swaps
  • Analyze arbitrage opportunities
  • Visualize swap cash flows
  • Command-line interface for quick analysis
  • Detailed reporting capabilities

Quick Start

from interest_rate_swap_analyzer import Party, InterestRateSwap, InterestRateSwapAnalyzer
from datetime import date

# Create parties
party_a = Party("Company A", fixed_rate=0.05, floating_rate_delta=0.02, preference="fixed")
party_b = Party("Bank B", fixed_rate=0.06, floating_rate_delta=0.01, preference="floating")

# Create swap
swap = InterestRateSwap(
    fixed_rate=0.055,
    floating_rate_delta=0.015,
    notional=1000000,
    fixed_rate_payer=party_a,
    floating_rate_payer=party_b,
    start_date=date(2023, 1, 1),
    end_date=date(2024, 1, 1)
)

# Analyze swap
analyzer = InterestRateSwapAnalyzer(party_a, party_b, swap)
results = analyzer.analyze()

# Get formatted report
print(analyzer.format_analysis_report(results))

# Or get results as DataFrame
df = analyzer.to_dataframe(results)
print(df)

Development

Setup development environment:

pip install -e ".[dev]"
pytest

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interest_rate_swap_analyzer-1.0.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interest_rate_swap_analyzer-1.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file interest_rate_swap_analyzer-1.0.0.tar.gz.

File metadata

File hashes

Hashes for interest_rate_swap_analyzer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6d05d058808bd7cb67f3217b8ede2f20885062b492d83b6435f0bf205857b1aa
MD5 0c537c7eb7a740075cf8f870b5b5e5ff
BLAKE2b-256 561e8076820ed29d6c84101667d67e18ef75e2ad28bbc6944924c172bd9a3abf

See more details on using hashes here.

File details

Details for the file interest_rate_swap_analyzer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for interest_rate_swap_analyzer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f434e36c795f40e177bd692b89bf8a1128caf2db9f07169796339881fb3e39
MD5 af8c5a3733c31e5f64e5d33c3bd6164c
BLAKE2b-256 6947b68b0381fde96d285343363092b6e975466011887678688adb32b61b264b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page