Dexscreener script, arch-2 packages

This commit is contained in:
2024-06-12 10:41:17 -04:00
parent c41e14a302
commit 273d23abc0
8 changed files with 226 additions and 10 deletions

View File

@@ -1 +1,12 @@
curl -s https://api.dexscreener.com/latest/dex/pairs/$1/$2| jq -r '.pairs | .[] | .priceUsd'
# /bin/bash
# curl -s https://api.dexscreener.com/latest/dex/pairs/$1/$2| jq -r '.pairs | .[] | .priceUsd'
raw=$(curl -s "https://api.dexscreener.com/latest/dex/pairs/$1/$2")
price=$(echo "$raw" | jq -r ".pairs | .[] | .priceUsd")
# if (( $(echo "$price < .05" | bc -l) )); then
# printf "%0.4f\n" "$price" | cut -c 4-
# elif (( $(echo "$price < .1" | bc -l) )); then
# printf "%0.3f\n" "$price" | cut -c 4-
if (( $(echo "$price < .1" | bc -l) )); then
printf "%0.4f\n" "$price" | cut -c 4-
fi