Skip to content

Instantly share code, notes, and snippets.

View rnbguy's full-sized avatar

Rano | Ranadeep rnbguy

View GitHub Profile
@rnbguy
rnbguy / spread_loss.sh
Created May 11, 2022 11:10
Computes current loss to burn UST for LUNA
#!/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
11 13 17 19
101 103 107 109
191 193 197 199
821 823 827 829
1481 1483 1487 1489
1871 1873 1877 1879
2081 2083 2087 2089
3251 3253 3257 3259
3461 3463 3467 3469
5651 5653 5657 5659