Skip to content

Commit

Permalink
update matic comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kyzia551 committed Jan 17, 2024
1 parent 2ead8a2 commit a6691ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
17 changes: 7 additions & 10 deletions src/contracts/MaticPriceCapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,23 @@ import {IMaticRateProvider} from 'cl-synchronicity-price-adapter/interfaces/IMat

import {PriceCapAdapterBase, IPriceCapAdapter} from './PriceCapAdapterBase.sol';

// TODO: compare MaticX and stMATIC implementations, and take actions based on that

// TODO: should I use MaticX reference everywhere, or it's more generic?
// TODO: also title and contract name maybe MaticXPriceCapAdapter?
/**
* @title MaticPriceCapAdapter
* @author BGD Labs
* @notice Price capped adapter to calculate price of (MaticX / USD) pair by using
* @notice Chainlink data feed for (MATIC / USD) and (MaticX / MATIC) ratio.
* @notice Price capped adapter to calculate price of (lst Matic / USD) pair by using
* @notice Chainlink data feed for (MATIC / USD) and (lst Matic / MATIC) ratio.
* @notice can be used as it is for stMatic and MaticX on Polygon network
*/
contract MaticPriceCapAdapter is PriceCapAdapterBase {
/**
* @notice Ratio provider for (MaticX / MATIC) pair
* @notice Ratio provider for (lst Matic / MATIC) pair
*/
IMaticRateProvider public immutable RATIO_PROVIDER;

/**
* @param aclManager ACL manager contract
* @param maticToBaseAggregatorAddress the address of MaticX / USD feed
* @param ratioProviderAddress the address of the MaticX token
* @param maticToBaseAggregatorAddress the address of MATIC / USD feed
* @param ratioProviderAddress the address of the lst Matic token
* @param pairName name identifier
* @param snapshotRatio The latest exchange ratio
* @param snapshotTimestamp The timestamp of the latest exchange ratio
Expand All @@ -35,7 +32,7 @@ contract MaticPriceCapAdapter is PriceCapAdapterBase {
IACLManager aclManager,
address maticToBaseAggregatorAddress,
address ratioProviderAddress,
string memory pairName, // TODO: does it make any sense, or I can just hardcode it with MaticX/MATIC
string memory pairName,
uint104 snapshotRatio,
uint48 snapshotTimestamp,
uint16 maxYearlyRatioGrowthPercent
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/PriceCapAdapterBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ abstract contract PriceCapAdapterBase is IPriceCapAdapter {

/**
* @param aclManager ACL manager contract
* @param baseAggregatorAddress The address of BASE_CURRENCY / USD price feed
* @param pairDescription The capped asset to underlying pair description
* @param ratioDecimals The number of decimal places of the capped asset to underlying ratio
* @param baseAggregatorAddress The address of (underlyingAsset / USD) price feed
* @param pairDescription The capped (lstAsset / underlyingAsset) pair description
* @param ratioDecimals The number of decimal places of the (lstAsset / underlyingAsset) ratio feed
* @param snapshotRatio The latest exchange ratio
* @param snapshotTimestamp The timestamp of the latest exchange ratio
* @param maxYearlyRatioGrowthPercent Maximum growth of the underlying asset value per year, 100_00 is equal 100%
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IPriceCapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface IPriceCapAdapter is ICLSynchronicityPriceAdapter {
function DECIMALS() external view returns (uint8);

/**
* @notice Number of decimal places of the capped asset to underlying ratio
* @notice Number of decimals for (lst asset / underlying asset) ratio
*/
function RATIO_DECIMALS() external view returns (uint8);

Expand Down

0 comments on commit a6691ad

Please sign in to comment.