XFTInterestRateSwap

COUNTERPARTIES

XFTInterestRateSwap 0x3F2Dbe13CFA87150F4ae93406f8032767bdc59D9arrow-up-right

FUNCTIONS

  • initiateSwap(): Create swap with atomic deposits

  • updateFloatingRate(): Admin updates rate before maturity

  • settleSwap(): Admin settles with preimage verification

  • refundSwap(): Parties recover funds after expiry

  • calculatePayments(): Preview settlement amounts

  • getSwapDetails(): View swap parameters

Swap 1 user → IRS: notional USDXT 2 user2 → IRS: notional USDXT 3 admin updates floatingRate in IRS 4 time passes to maturity 5 admin calls settleSwap with preimage 6 IRS calculates fixedPayment and floatingPayment 7 IRS sends net interest USDXT to owed party 8 IRS returns notionals to user and user2

SEQUENCE

INITIATE SWAP
1 user calls initiateSwap(swapId,counterparty,notional,fixedRate,floatingRate,maturity,hashlock,dayCount)
2 contract pulls notional from fixedPayer and floatingPayer atomically
3 emits NotionalDeposited and SwapInitiated

RATE MANAGEMENT
4 admin calls updateFloatingRate(swapId,newRate) before maturity
5 emits FloatingRateUpdated

SETTLEMENT
6 after block.timestamp ≥ maturity, admin calls settleSwap(swapId,preimage)
7 contract verifies hashlock, calculates fixed vs floating using dayCount
8 returns notionals and net interest atomically
9 emits SwapSettled
10 deletes swap storage for gas reclaim

REFUND
11 if not settled and block.timestamp ≥ maturity, either party calls refundSwap(swapId)
12 returns both notionals atomically
13 emits SwapRefunded and deletes storage

CONTRACT ABI

Last updated