Skip to content

Instantly share code, notes, and snippets.

@marianogappa
Created March 5, 2021 20:27
Show Gist options
  • Save marianogappa/f9bc9f043edd7e1bf3f943c792735d08 to your computer and use it in GitHub Desktop.
Save marianogappa/f9bc9f043edd7e1bf3f943c792735d08 to your computer and use it in GitHub Desktop.
Uniswap price alert
while sleep 60; do if [[ $(curl -s "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2" -d'{"query": "{tokenDayDatas(first: 1, orderBy: date, orderDirection: desc, where: { token: \"0xf7413489c474ca4399eee604716c72879eea3615\"}) { priceUSD } }"}' | jq -r '.data.tokenDayDatas[0].priceUSD' | tee /dev/tty | sed 's/$/ <= 1.2/' | bc) -eq "1" ]]; then say "buy APYS now"; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment