Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/update libs and config #328

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/lyra-utils
3 changes: 2 additions & 1 deletion scripts/config-mainnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ library Config {
uint64 public constant SETTLEMENT_HEARTBEAT = 3 minutes;
uint64 public constant PERP_HEARTBEAT = 15 minutes;
uint64 public constant IMPACT_PRICE_HEARTBEAT = 20 minutes;
uint64 public constant PERP_MAX_PERCENT_DIFF = 0.075e18;
uint64 public constant PERP_MAX_PERCENT_DIFF = 0.06e18;
uint64 public constant VOL_HEARTBEAT = 20 minutes;
uint64 public constant STABLE_HEARTBEAT = 60 minutes;
uint64 public constant FWD_MAX_EXPIRY = 400 days;
}
9 changes: 5 additions & 4 deletions scripts/deploy-market.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,18 @@ contract DeployMarket is Utils {

// init feeds
market.spotFeed.setHeartbeat(Config.SPOT_HEARTBEAT);

market.volFeed.setHeartbeat(Config.VOL_HEARTBEAT);
market.perpFeed.setHeartbeat(Config.PERP_HEARTBEAT);

market.iapFeed.setHeartbeat(Config.IMPACT_PRICE_HEARTBEAT);

market.ibpFeed.setHeartbeat(Config.IMPACT_PRICE_HEARTBEAT);

market.volFeed.setHeartbeat(Config.VOL_HEARTBEAT);
market.perpFeed.setSpotDiffCap(Config.PERP_MAX_PERCENT_DIFF);
market.iapFeed.setSpotDiffCap(Config.PERP_MAX_PERCENT_DIFF);
market.ibpFeed.setSpotDiffCap(Config.PERP_MAX_PERCENT_DIFF);

market.forwardFeed.setHeartbeat(Config.FORWARD_HEARTBEAT);
market.forwardFeed.setSettlementHeartbeat(Config.SETTLEMENT_HEARTBEAT);
market.forwardFeed.setMaxExpiry(Config.FWD_MAX_EXPIRY);
for (uint i=0; i<config.feedSigners.length; ++i) {
market.spotFeed.addSigner(config.feedSigners[i], true);
market.perpFeed.addSigner(config.feedSigners[i], true);
Expand Down
5 changes: 4 additions & 1 deletion scripts/deploy-mocks.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ contract DeployMocks is Utils {

MockERC20 weth = new MockERC20("WETH", "WETH");

address[] memory feedSigners = new address[](1);
feedSigners[0] = deployer;

// write to configs file: eg: input/31337/config.json
string memory objKey = "network-config";
vm.serializeAddress(objKey, "usdc", address(usdc));
vm.serializeAddress(objKey, "wbtc", address(wbtc));
vm.serializeAddress(objKey, "weth", address(weth));
vm.serializeAddress(objKey, "feedSigner", deployer);
vm.serializeAddress(objKey, "feedSigners", feedSigners);
string memory finalObj = vm.serializeBool(objKey, "useMockedFeed", false);

// build path
Expand Down