From 030ca34034166c58a2292d538a90bb41bd81523d Mon Sep 17 00:00:00 2001 From: OxMarco <> Date: Fri, 19 Jan 2024 12:56:25 +0100 Subject: [PATCH 1/2] add risk params setup --- deploy.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/deploy.sh b/deploy.sh index 359f7fb..4394115 100755 --- a/deploy.sh +++ b/deploy.sh @@ -186,6 +186,26 @@ for token in "${tokens[@]}"; do cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $MANAGER_ADDRESS "setCap(address,address,uint256,uint256)" $FIXEDYIELD_ADDRESS $token 1 0 done +# Set risk params +## Aave +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDC 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDT 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $DAI 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WBTC 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WETH 1 1 1 + +## GMX +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDC 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDT 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $DAI 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WBTC 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WETH 1 1 1 + +## Fraxlend +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $FRAXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 + # Print out address echo " " echo "---------------------------------------------------------------------------" From c9e5bc381e1435a59d4d6eaebc9c7b88d0592264 Mon Sep 17 00:00:00 2001 From: OxMarco <> Date: Fri, 19 Jan 2024 15:13:15 +0100 Subject: [PATCH 2/2] split scripts --- deploy.sh | 20 -------------------- setup_risk_params.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 setup_risk_params.sh diff --git a/deploy.sh b/deploy.sh index 4394115..359f7fb 100755 --- a/deploy.sh +++ b/deploy.sh @@ -186,26 +186,6 @@ for token in "${tokens[@]}"; do cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $MANAGER_ADDRESS "setCap(address,address,uint256,uint256)" $FIXEDYIELD_ADDRESS $token 1 0 done -# Set risk params -## Aave -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDC 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDT 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $DAI 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WBTC 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $AAVESERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WETH 1 1 1 - -## GMX -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDC 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDT 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $DAI 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WBTC 1 1 1 -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $GMXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WETH 1 1 1 - -## Fraxlend -cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $FRAXSERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 - # Print out address echo " " echo "---------------------------------------------------------------------------" diff --git a/setup_risk_params.sh b/setup_risk_params.sh new file mode 100644 index 0000000..5816b53 --- /dev/null +++ b/setup_risk_params.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ -z "$DEPLOYER_PRIVATE_KEY" ]; then + echo "Error: DEPLOYER_PRIVATE_KEY is not set." + exit 1 +fi + +if [ -z "$DEPLOYER_PUBLIC_KEY" ]; then + echo "Error: DEPLOYER_PUBLIC_KEY is not set." + exit 1 +fi + +# Config +RPC_URL="http://localhost:8545" # "https://arb-mainnet..." +SERVICE_ADDRESS="0x00000" + +# Tokens +USDC=0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8 +USDT=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9 +DAI=0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1 +FRAX=0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F +WETH=0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 +WBTC=0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f + +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $SERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDC 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $SERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $USDT 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $SERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $DAI 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $SERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $FRAX 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $SERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WBTC 1 1 1 +cast send --rpc-url=$RPC_URL --private-key=$DEPLOYER_PRIVATE_KEY $SERVICE_ADDRESS "setRiskParams(address,uint256,uint256,uint256)" $WETH 1 1 1