Skip to content

Commit

Permalink
Merge pull request #345 from alpaca-finance/deploy/20230420
Browse files Browse the repository at this point in the history
[main][deploy] money market
  • Loading branch information
spicysquid168 authored May 3, 2023
2 parents e8ad961 + c6b7092 commit 7dad3fe
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@
]
},
"moneyMarketReader": "0x1d3cb2f91207afDA9E9baB89caDE1a4c3222cf6a"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"exec:bsc_mainnet:minifl:config:set-pool": "forge script script/deployments/MiniFL/config/SetPool.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:minifl:config:set-alpaca-per-sec": "forge script script/deployments/MiniFL/config/SetAlpacaPerSecond.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:minifl:config:set-whitelist-callers": "forge script script/deployments/MiniFL/config/SetWhitelistedCallers.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:minifl:script:mass-update-pools": "forge script script/deployments/MiniFL/script/MassUpdatePools.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:ib-token:deploy": "forge script script/deployments/InterestBearingToken/deploy/InterestBearingTokenImplementation.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:debt-token:deploy": "forge script script/deployments/DebtToken/deploy/DebtTokenImplementation.s.sol --rpc-url bsc_mainnet --broadcast --slow",
"exec:bsc_mainnet:money-market:deploy": "forge script script/deployments/MoneyMarket/deploy/MoneyMarket.s.sol --rpc-url bsc_mainnet --broadcast --slow",
Expand Down
16 changes: 8 additions & 8 deletions script/deployments/AlpacaV2Oracle/config/SetPools.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ contract SetPoolsScript is BaseScript {
addPCSV3PoolAddress(eth, wbnb, 2500);

// 1 hop
// WBNB-BUSD fee 0.05
addPCSV3PoolAddress(wbnb, busd, 500);
// USDC-BUSD fee 0.01
addPCSV3PoolAddress(usdc, busd, 100);
// USDT-BUSD fee 0.01
addPCSV3PoolAddress(usdt, busd, 100);
// BTCB-BUSD fee 0.05
addPCSV3PoolAddress(btcb, busd, 500);
// WBNB-USDT fee 0.05
addPCSV3PoolAddress(wbnb, usdt, 500);
// USDC-USDT fee 0.01
addPCSV3PoolAddress(usdc, usdt, 100);
// BUSD-USDT fee 0.01
addPCSV3PoolAddress(busd, usdt, 100);
// BTCB-USDT fee 0.05
addPCSV3PoolAddress(btcb, usdt, 500);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
12 changes: 6 additions & 6 deletions script/deployments/AlpacaV2Oracle/config/SetTokenConfig.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,36 @@ contract SetTokenConfigScript is BaseScript {

// WBNB
alpacaGuardPath.push(wbnb);
alpacaGuardPath.push(busd);
alpacaGuardPath.push(usdt);
addSetTokenConfigList(
IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true })
);

// USDC
alpacaGuardPath.push(usdc);
alpacaGuardPath.push(busd);
alpacaGuardPath.push(usdt);
addSetTokenConfigList(
IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true })
);

// USDT
alpacaGuardPath.push(usdt);
// BUSD
alpacaGuardPath.push(busd);
alpacaGuardPath.push(usdt);
addSetTokenConfigList(
IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true })
);

// BTCB
alpacaGuardPath.push(btcb);
alpacaGuardPath.push(busd);
alpacaGuardPath.push(usdt);
addSetTokenConfigList(
IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true })
);

// ETH
alpacaGuardPath.push(eth);
alpacaGuardPath.push(wbnb);
alpacaGuardPath.push(busd);
alpacaGuardPath.push(usdt);
addSetTokenConfigList(
IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true })
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract DeployAlpacaV2OracleScript is BaseScript {
Check all variables below before execute the deployment script
*/
address oracle = oracleMedianizer;
address baseStable = busd;
address baseStable = usdt;
address usd = usdPlaceholder;

_startDeployerBroadcast();
Expand Down
2 changes: 1 addition & 1 deletion script/deployments/MiniFL/config/SetAlpacaPerSecond.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract SetAlpacaPerSecondScript is BaseScript {
Check all variables below before execute the deployment script
*/

uint256 _newAlpacaPerSecond = 50000000000000;
uint256 _newAlpacaPerSecond = 33068783068783070;
bool _withUpdate = true;

//---- execution ----//
Expand Down
22 changes: 11 additions & 11 deletions script/deployments/MiniFL/config/SetPool.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ contract SetPoolScript is BaseScript {
*/

// WBNB
setIbAllocPoint(wbnb, 125);
setDebtAllocPoint(wbnb, 50);
setIbAllocPoint(wbnb, 75);
setDebtAllocPoint(wbnb, 100);
// BTCB
setIbAllocPoint(btcb, 225);
setDebtAllocPoint(btcb, 50);
setIbAllocPoint(btcb, 100);
setDebtAllocPoint(btcb, 125);
// USDT
setIbAllocPoint(btcb, 175);
setDebtAllocPoint(btcb, 100);
setIbAllocPoint(usdt, 100);
setDebtAllocPoint(usdt, 175);
// ETH
setIbAllocPoint(eth, 100);
setDebtAllocPoint(eth, 25);
setIbAllocPoint(eth, 75);
setDebtAllocPoint(eth, 100);
// USDC
setIbAllocPoint(usdc, 75);
setDebtAllocPoint(usdc, 50);
setIbAllocPoint(usdc, 50);
setDebtAllocPoint(usdc, 75);
// BUSD
setIbAllocPoint(busd, 50);
setDebtAllocPoint(busd, 50);
setDebtAllocPoint(busd, 75);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
5 changes: 2 additions & 3 deletions script/deployments/MiniFL/config/SetWhitelistedCallers.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ contract SetWhitelistedCallersScript is BaseScript {
Check all variables below before execute the deployment script
*/

address[] memory _callers = new address[](2);
_callers[0] = address(moneyMarket);
_callers[1] = address(accountManager);
address[] memory _callers = new address[](1);
_callers[0] = address(accountManager);

//---- execution ----//
_startDeployerBroadcast();
Expand Down
24 changes: 24 additions & 0 deletions script/deployments/MiniFL/script/MassUpdatePools.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../../BaseScript.sol";

contract MassUpdatePools is BaseScript {
function run() public {
/*
░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░
░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░
░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░
░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗
░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝
░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░
Check all variables below before execute the deployment script
*/
//---- execution ----//
_startDeployerBroadcast();

miniFL.massUpdatePools();

_stopBroadcast();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract SetLiquidationTreasuryScript is BaseScript {
Check all variables below before execute the deployment script
*/

address _treasury = 0xC44f82b07Ab3E691F826951a6E335E1bC1bB0B51;
address _treasury = 0xFeCfcd99B496e044166086dd2F29E2FC2bb6Dd64;

//---- execution ----//
_startDeployerBroadcast();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ contract SetLiquidatorsOkScript is BaseScript {
*/
bool isOk = true;
address[] memory _callers = new address[](1);
// ALPACA Liquidation Bot 1
_callers[0] = 0xFef9d28767de30F4239B9b40Bc915919b0bcACe8;

_startDeployerBroadcast();
Expand Down
2 changes: 2 additions & 0 deletions solidity/contracts/miniFL/interfaces/IMiniFL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ interface IMiniFL {
function harvest(uint256 _pid) external;

function harvestMany(uint256[] calldata _pids) external;

function massUpdatePools() external;
}

0 comments on commit 7dad3fe

Please sign in to comment.