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

Add sentio compatibility #31

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 0 additions & 10 deletions abis/beefy/classic/ClassicStrategy.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,6 @@
"name": "SetUnirouter",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "harvester", "type": "address" },
{ "indexed": false, "internalType": "uint256", "name": "wantHarvested", "type": "uint256" },
{ "indexed": false, "internalType": "uint256", "name": "tvl", "type": "uint256" }
],
"name": "StratHarvest",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
Expand Down
12 changes: 12 additions & 0 deletions abis/beefy/classic/ClassicStrategyStratHarvest0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "harvester", "type": "address" },
{ "indexed": false, "internalType": "uint256", "name": "wantHarvested", "type": "uint256" },
{ "indexed": false, "internalType": "uint256", "name": "tvl", "type": "uint256" }
],
"name": "StratHarvest",
"type": "event"
}
]
12 changes: 12 additions & 0 deletions abis/beefy/classic/ClassicStrategyStratHarvest1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "harvester", "type": "address" },
{ "indexed": true, "internalType": "uint256", "name": "wantHarvested", "type": "uint256" },
{ "indexed": true, "internalType": "uint256", "name": "tvl", "type": "uint256" }
],
"name": "StratHarvest",
"type": "event"
}
]
2 changes: 1 addition & 1 deletion bin/delete-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

# config
valid_chains=($(ls config | sed 's/\.json//g'))
valid_providers=("goldsky" "0xgraph")
valid_providers=("goldsky" "0xgraph" "sentio")

function exit_help {
echo "Usage: $0 <version> <provider> <deploy_key>"
Expand Down
44 changes: 34 additions & 10 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# config
valid_chains=($(ls config | sed 's/\.json//g'))
valid_providers=("goldsky" "0xgraph")
valid_providers=("goldsky" "0xgraph" "sentio")

function exit_help {
echo "Usage: $0 <chain> <provider1> [<provider2>] ... [<providerN>]"
Expand All @@ -12,16 +12,15 @@ function exit_help {
exit 1
}

function prepare {
function publish_0xgraph {
CHAIN=$1
SUBGRAPH=$2

echo "preparing $CHAIN"
yarn prepare:$CHAIN
yarn codegen
yarn build
}

function publish_0xgraph {
SUBGRAPH=$1
echo "publishing $SUBGRAPH to 0xgraph"
yarn run graph remove $SUBGRAPH --node https://api.0xgraph.xyz/deploy
sleep 5
Expand All @@ -30,23 +29,49 @@ function publish_0xgraph {
yarn run graph deploy $SUBGRAPH --node https://api.0xgraph.xyz/deploy --ipfs https://api.0xgraph.xyz/ipfs --version-label=v0.0.1
}

function publish_goldsky {
SUBGRAPH=$1
function publish_goldsky { CHAIN=$1
CHAIN=$1
SUBGRAPH=$2

echo "preparing $CHAIN"
yarn prepare:$CHAIN
yarn codegen
yarn build

echo "publishing $SUBGRAPH to goldsky"
goldsky subgraph delete $SUBGRAPH/0.0.1
sleep 10
goldsky subgraph deploy $SUBGRAPH/0.0.1 --path .
}

function publish_sentio {
CHAIN=$1
SUBGRAPH=$2
if [ -z "$SENTIO_OWNER" ]; then
echo "SENTIO_OWNER is required"
exit 1
fi

echo "preparing $CHAIN"
yarn prepare:$CHAIN
yarn codegen

echo "publishing $SUBGRAPH to sentio"
npx @sentio/cli graph deploy --owner $SENTIO_OWNER --name $SUBGRAPH
}

function publish {
CHAIN=$1
PROVIDER=$2
case $PROVIDER in
"0xgraph")
publish_0xgraph beefyfinance/clm-$CHAIN
publish_0xgraph $CHAIN beefyfinance/clm-$CHAIN
;;
"goldsky")
publish_goldsky beefy-clm-$CHAIN-dev
publish_goldsky $CHAIN beefy-clm-$CHAIN-dev
;;
"sentio")
publish_sentio $CHAIN beefy-clm-$CHAIN
;;
esac
}
Expand Down Expand Up @@ -76,7 +101,6 @@ for provider in $providers; do
done


prepare $chain
for provider in $providers; do
publish $chain $provider
done
3 changes: 3 additions & 0 deletions bin/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ fi

set -e

echo "Generating subgraph.yaml $CHAIN"
yarn --silent run mustache config/$CHAIN.json subgraph.template.yaml > subgraph.yaml

echo "Generating src/config.ts $CHAIN"
yarn --silent run mustache config/$CHAIN.json src/config.template.ts > src/config.ts

RNG=$((1 + $RANDOM % 100000))
Expand Down
36 changes: 27 additions & 9 deletions bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

# config
valid_chains=($(ls config | sed 's/\.json//g'))
valid_providers=("goldsky" "0xgraph")
valid_providers=("goldsky" "0xgraph" "sentio")

function exit_help {
echo "Usage: $0 <version> <chain> <provider> <deploy_key>"
Expand All @@ -23,23 +23,38 @@ function prepare {
}

function publish_0xgraph {
SUBGRAPH=$1
VERSION=$2
DEPLOY_KEY=$3
CHAIN=$1
SUBGRAPH=$2
VERSION=$3
DEPLOY_KEY=$4
echo "publishing $SUBGRAPH to 0xgraph"
yarn run graph deploy $SUBGRAPH --node https://api.0xgraph.xyz/deploy --ipfs https://api.0xgraph.xyz/ipfs --version-label="v$VERSION" --deploy-key=$DEPLOY_KEY
}

function publish_goldsky {
SUBGRAPH=$1
VERSION=$2
DEPLOY_KEY=$3
CHAIN=$1
SUBGRAPH=$2
VERSION=$3
DEPLOY_KEY=$4
echo "publishing $SUBGRAPH to goldsky"
goldsky subgraph deploy $SUBGRAPH/$VERSION --path . --token $DEPLOY_KEY
sleep 5 # wait for the subgraph to propagate
goldsky subgraph tag create $SUBGRAPH/$VERSION --token $DEPLOY_KEY --tag next
}

function publish_sentio {
CHAIN=$1
SUBGRAPH=$2
VERSION=$3
if [ -z "$SENTIO_OWNER" ]; then
echo "SENTIO_OWNER is required"
exit 1
fi

echo "publishing $SUBGRAPH to sentio"
npx @sentio/cli graph deploy --owner $SENTIO_OWNER --name $SUBGRAPH
}

function publish {
VERSION=$1
CHAIN=$2
Expand All @@ -48,10 +63,13 @@ function publish {
SUBGRAPH=
case $PROVIDER in
"0xgraph")
publish_0xgraph beefyfinance/clm-$CHAIN $VERSION $DEPLOY_KEY
publish_0xgraph $CHAIN beefyfinance/clm-$CHAIN $VERSION $DEPLOY_KEY
;;
"goldsky")
publish_goldsky beefy-clm-$CHAIN $VERSION $DEPLOY_KEY
publish_goldsky $CHAIN beefy-clm-$CHAIN $VERSION $DEPLOY_KEY
;;
"sentio")
publish_sentio $CHAIN beefy-clm-$CHAIN $VERSION
;;
esac
}
Expand Down
7 changes: 6 additions & 1 deletion config/arbitrum-beta.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0xCee843CD04E3758dDC5BCFf08647DddB117151D0",
"beefyOracleAddress": "0x5C7c7Bb0c9251821cB5a1D9c08F21B0DAD5efe65"
"beefyOracleAddress": "0x5C7c7Bb0c9251821cB5a1D9c08F21B0DAD5efe65",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/arbitrum.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0xCee843CD04E3758dDC5BCFf08647DddB117151D0",
"beefyOracleAddress": "0x5C7c7Bb0c9251821cB5a1D9c08F21B0DAD5efe65"
"beefyOracleAddress": "0x5C7c7Bb0c9251821cB5a1D9c08F21B0DAD5efe65",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/avax.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x20a93Fc2Eb630B98c9C8ef276867C74cc6D5D7C9",
"beefyOracleAddress": "0xec27635CDD3F68cC6534b3bc381bb585a40bfeD3"
"beefyOracleAddress": "0xec27635CDD3F68cC6534b3bc381bb585a40bfeD3",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x9F8c6a094434C6E6f5F2792088Bb4d2D5971DdCc",
"beefyOracleAddress": "0x1BfA205114678c7d17b97DB7A71819D3E6718eb4"
"beefyOracleAddress": "0x1BfA205114678c7d17b97DB7A71819D3E6718eb4",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/bsc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x4362FE9aC48e7c5ea85a359418bBd7471979F5C2",
"beefyOracleAddress": "0x32468F9097dCa52225b86a7cA5203ad0012F327C"
"beefyOracleAddress": "0x32468F9097dCa52225b86a7cA5203ad0012F327C",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/linea.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x5aD159A8537fE39CAD81748726584C05b68b3c11",
"beefyOracleAddress": "0x3923704D9684ABb234743d65D96c43Bf26414481"
"beefyOracleAddress": "0x3923704D9684ABb234743d65D96c43Bf26414481",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/manta.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x07f1ad98b725Af45485646aC431b7757f50C598A",
"beefyOracleAddress": "0x2AfB174c22D9eE334895C4e300ab93154d800aA0"
"beefyOracleAddress": "0x2AfB174c22D9eE334895C4e300ab93154d800aA0",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/mantle.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x9C18deE5290925f596fbEfee2f6745b640f3A4C6",
"beefyOracleAddress": "0x61129dCBd8944aB2D1C6792428603b0845f60c5B"
"beefyOracleAddress": "0x61129dCBd8944aB2D1C6792428603b0845f60c5B",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/moonbeam.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x8F40C4Be6732241222293953475a9e69BFc607AA",
"beefyOracleAddress": "0x4d417C189AE9D1B128397026A124b531A535D741"
"beefyOracleAddress": "0x4d417C189AE9D1B128397026A124b531A535D741",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/optimism.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0xe115b50c52cB5624fD76232cDF498ADA6ECD1e69",
"beefyOracleAddress": "0x7066606233Cc8b5ede0925003F8910FF7B15219C"
"beefyOracleAddress": "0x7066606233Cc8b5ede0925003F8910FF7B15219C",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0xDd27227Dba7Ea8F5869466A10A8E36Bb2D709b35",
"beefyOracleAddress": "0xfcE4448C50A96c279afdB8CE7735295660653e19"
"beefyOracleAddress": "0xfcE4448C50A96c279afdB8CE7735295660653e19",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/rootstock.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x3C0b1765C379833b86A1704997019A7496Afdfae",
"beefyOracleAddress": "0x70127945067E4224d7B6ABfDc6f57e3ea45d5CA4"
"beefyOracleAddress": "0x70127945067E4224d7B6ABfDc6f57e3ea45d5CA4",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/scroll.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0xBC4a342B0c057501E081484A2d24e576E854F823",
"beefyOracleAddress": "0x448a3539a591dE3Fb9D5AAE407471D21d40cD315"
"beefyOracleAddress": "0x448a3539a591dE3Fb9D5AAE407471D21d40cD315",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
7 changes: 6 additions & 1 deletion config/sei.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"umbrellaRegistryPriceFeedDecimals": 8,

"beefySwapperAddress": "0x8e0B63846ebEFf857EE35eF3BD3A2df9EF7D6456",
"beefyOracleAddress": "0x9818dF1Bdce8D0E79B982e2C3a93ac821b3c17e0"
"beefyOracleAddress": "0x9818dF1Bdce8D0E79B982e2C3a93ac821b3c17e0",

"classicStratHarvest1ForAddresses": [],

"onlyKeepClmClassicVaults": true,
"positionSnapshotEnabled": false
}
Loading
Loading