A minimal fixed-vs-floating interest rate swap settlement contract demonstrating oracle risk and settlement mechanics.
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Install dependencies
forge install
# Run tests
forge test -vsrc/MiniSwapSettlement.sol- Core swap settlement contractsrc/MockRateOracle.sol- Mock oracle for testingtest/MiniSwapSettlement.t.sol- Test suite covering normal cases and edge casesTECHNICAL_README.md- 300-word edge case analysis
- Fixed vs floating interest rate swap payoff calculation
- Oracle freshness checks (1-hour threshold)
- Settlement only at maturity
- Protection against stale oracle data
- Normal Settlement: Tests both floating-higher and floating-lower scenarios
- Stale Oracle Edge Case: Reverts if oracle data is >1 hour old
- Rate Spike Edge Case: Demonstrates manipulation vulnerability at settlement
This minimal implementation demonstrates understanding of:
- Fixed/floating swap mechanics
- Oracle dependency risks
- Settlement timing vulnerabilities
- Protocol-level risk mitigation