Skip to content

Commit

Permalink
Update ERC-7586: Move to Review
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
Edoumou authored Jul 9, 2024
1 parent c7d454b commit c2b712a
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions ERCS/erc-7586.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Interest Rate Swaps
description: Interest rate swaps derivative contracts
author: Samuel Gwlanold Edoumou (@Edoumou)
discussions-to: https://ethereum-magicians.org/t/interest-rate-swaps/17777
status: Draft
status: Review
type: Standards Track
category: ERC
created: 2023-12-31
Expand All @@ -29,7 +29,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S

![alt text](../assets/eip-7586/irs.jpeg "IRS diagram")

Every contract compliant with this ERC MUST implement the following interface. The contract MUST inherit from [`ERC20`](./eip-20) to tokenize the swap cash flows.
Every contract compliant with this ERC MUST implement the following interface. The contract MUST inherit from [ERC-20](./eip-20.md) to tokenize the swap cash flows.

```solidity
pragma solidity ^0.8.0;
Expand Down Expand Up @@ -57,12 +57,12 @@ interface IERC7586 /** is ERC20, ERC165 */ {
/**
* @notice Returns the IRS `payer` account address. The party who agreed to pay fixed interest
*/
function fixedInterestPayer() external view returns(address);
function fixedRatePayer() external view returns(address);
/**
* @notice Returns the IRS `receiver` account address. The party who agreed to pay floating interest
*/
function floatingInterestPayer() external view returns(address);
function floatingRatePayer() external view returns(address);
/**
* @notice Returns the number of decimals the swap rate and spread use - e.g. `4` means to divide the rates by `10000`
Expand All @@ -73,23 +73,34 @@ interface IERC7586 /** is ERC20, ERC165 */ {
function ratesDecimals() external view returns(uint8);
/**
* @notice Returns the fixed interest rate
* @notice Returns the fixed interest rate. All rates MUST be multiplied by 10^(ratesDecimals)
*/
function swapRate() external view returns(uint256);
/**
* @notice Returns the floating rate spread, i.e. the fixed part of the floating interest rate
*
* @notice Returns the floating rate spread, i.e. the fixed part of the floating interest rate. All rates MUST be multiplied by 10^(ratesDecimals)
* floatingRate = benchmark + spread
*/
function spread() external view returns(uint256);
/**
* @notice Returns the contract address of the asset to be transferred when swapping IRS. Depending on what the two parties agreed upon, this could be a currency, etc.
* Example: If the two parties agreed to swap interest rates in USDC, then this function should return the USDC contract address.
* This address SHOULD be used in the `swap` function to transfer the interest difference to either the `payer` or the `receiver`. Example: IERC(assetContract).transfer
* @notice Returns the day count basis
* For example, 0 can denote actual/actual, 1 can denote actual/360, and so on
*/
function dayCountBasis() external view returns(uint8);
/**
* @notice Returns the contract address of the currency for which the notional amount is denominated (Example: USDC contract address).
* Returns the zero address if the notional is expressed in FIAT currency like USD
*/
function notionalCurrency() external view returns(address);
/**
* @notice Returns an array of acceptable contract address of the assets to be transferred when swapping IRS
* The two counterparties may wish to get the payment in different currencies.
* Ex: if the payer wants to receive the payment in USDC and the receiver in DAI, then the function should return [USDC, DAI] or [DAI, USDC]
*/
function assetContract() external view returns(address);
function paymentAssets() external view returns(address[] memory);
/**
* @notice Returns the notional amount in unit of asset to be transferred when swapping IRS. This amount serves as the basis for calculating the interest payments, and may not be exchanged
Expand All @@ -98,17 +109,25 @@ interface IERC7586 /** is ERC20, ERC165 */ {
function notionalAmount() external view returns(uint256);
/**
* @notice Returns the interest payment frequency
* @notice Returns the number of times payments must be realized in 1 year
*/
function paymentFrequency() external view returns(uint256);
/**
* @notice Returns an array of specific dates on which the interest payments are exchanged. Each date MUST be a Unix timestamp like the one returned by block.timestamp
* @notice Returns an array of specific dates on which the fix interest payments are exchanged. Each date MUST be a Unix timestamp like the one returned by block.timestamp
* The length of the array returned by this function MUST equal the total number of swaps that should be realized
*
* OPTIONAL
*/
function fixPaymentDates() external view returns(uint256[] memory);
/**
* @notice Returns an array of specific dates on which the floating interest payments are exchanged. Each date MUST be a Unix timestamp like the one returned by block.timestamp
* The length of the array returned by this function MUST equal the total number of swaps that should be realized
*
* OPTIONAL
*/
function paymentDates() external view returns(uint256[] memory);
function floatingPaymentDates() external view returns(uint256[] memory);
/**
* @notice Returns the starting date of the swap contract. This is a Unix Timestamp like the one returned by block.timestamp
Expand All @@ -121,22 +140,23 @@ interface IERC7586 /** is ERC20, ERC165 */ {
function maturityDate() external view returns(uint256);
/**
* @notice Returns the benchmark in basis point unit
* @notice Returns the benchmark (the reference rate). All rates MUST be multiplied by 10^(ratesDecimals)
* Example: value of one the following rates: CF BIRC, EURIBOR, HIBOR, SHIBOR, SOFR, SONIA, TONAR, etc.
* Or set manually
*/
function benchmark() external view returns(uint256);
/**
* @notice Returns the oracle contract address for the benchmark rate, or the zero address when the two parties agreed to set the benchmark manually.
* @notice Returns the oracle contract address for acceptable reference rates (benchmark), or the zero address when the two parties agreed to set the benchmark manually.
* This contract SHOULD be used to fetch real time benchmark rate
* Example: Contract address for `CF BIRC`
*
* OPTIONAL. The two parties MAY agree to set the benchmark manually
*/
function oracleContractForBenchmark() external view returns(address);
function oracleContractsForBenchmark() external view returns(address);
/**
* @notice Makes swap calculation and transfers the interest difference to either the `payer` or the `receiver`
* @notice Makes swap calculation and transfers the payment to counterparties
*/
function swap() external returns(bool);
Expand Down

0 comments on commit c2b712a

Please sign in to comment.