Created
May 11, 2022 11:10
-
-
Save rnbguy/06ba3ec68b02f007d66bc6275e978953 to your computer and use it in GitHub Desktop.
Computes current loss to burn UST for LUNA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# prints current loss percentage due to burning UST for LUNA | |
# requires: curl, jq, bc | |
luna_rate_via_burn=`curl -s "https://fcd.terra.dev/terra/market/v1beta1/swap?ask_denom=uluna&offer_coin=100000000uusd" | jq -r ".return_coin.amount"` | |
luna_to_ust_exchange_rate=`curl -s "https://fcd.terra.dev/terra/oracle/v1beta1/denoms/uusd/exchange_rate" | jq -r ".exchange_rate"` | |
echo "(100 - ((${luna_rate_via_burn} * ${luna_to_ust_exchange_rate}) / 10^6))" | bc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment