Skip to content

AdamMomen/potential-disco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniSwapSettlement

A minimal fixed-vs-floating interest rate swap settlement contract demonstrating oracle risk and settlement mechanics.

Quick Start

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Install dependencies
forge install

# Run tests
forge test -v

Structure

  • src/MiniSwapSettlement.sol - Core swap settlement contract
  • src/MockRateOracle.sol - Mock oracle for testing
  • test/MiniSwapSettlement.t.sol - Test suite covering normal cases and edge cases
  • TECHNICAL_README.md - 300-word edge case analysis

Key Features

  • Fixed vs floating interest rate swap payoff calculation
  • Oracle freshness checks (1-hour threshold)
  • Settlement only at maturity
  • Protection against stale oracle data

Test Coverage

  1. Normal Settlement: Tests both floating-higher and floating-lower scenarios
  2. Stale Oracle Edge Case: Reverts if oracle data is >1 hour old
  3. Rate Spike Edge Case: Demonstrates manipulation vulnerability at settlement

Kairos Context

This minimal implementation demonstrates understanding of:

  • Fixed/floating swap mechanics
  • Oracle dependency risks
  • Settlement timing vulnerabilities
  • Protocol-level risk mitigation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors