generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCLRatePriceCapAdapter.sol
More file actions
39 lines (35 loc) · 1.37 KB
/
CLRatePriceCapAdapter.sol
File metadata and controls
39 lines (35 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;
import {IACLManager} from 'aave-address-book/AaveV3.sol';
import {IChainlinkAggregator} from '../interfaces/IChainlinkAggregator.sol';
import {PriceCapAdapterBase, IPriceCapAdapter} from './PriceCapAdapterBase.sol';
/**
* @title CLRatePriceCapAdapter
* @author BGD Labs
* @notice Price capped adapter to calculate price of (lstASSET / USD) pair by using
* @notice Chainlink data feeds for (ASSET / USD) and (lstASSET / ASSET).
*/
contract CLRatePriceCapAdapter is PriceCapAdapterBase {
/**
* @param capAdapterParams parameters to create cap adapter
*/
constructor(
CapAdapterParams memory capAdapterParams
)
PriceCapAdapterBase(
CapAdapterBaseParams({
aclManager: capAdapterParams.aclManager,
baseAggregatorAddress: capAdapterParams.baseAggregatorAddress,
ratioProviderAddress: capAdapterParams.ratioProviderAddress,
pairDescription: capAdapterParams.pairDescription,
ratioDecimals: IChainlinkAggregator(capAdapterParams.ratioProviderAddress).decimals(),
minimumSnapshotDelay: capAdapterParams.minimumSnapshotDelay,
priceCapParams: capAdapterParams.priceCapParams
})
)
{}
/// @inheritdoc IPriceCapAdapter
function getRatio() public view override returns (int256) {
return IChainlinkAggregator(RATIO_PROVIDER).latestAnswer();
}
}