Skip to content

Instantly share code, notes, and snippets.

@spac3unit
Created December 26, 2022 20:04
Show Gist options
  • Save spac3unit/327a54f8a80262310fd2d6cb560a3d90 to your computer and use it in GitHub Desktop.
Save spac3unit/327a54f8a80262310fd2d6cb560a3d90 to your computer and use it in GitHub Desktop.
uptick autostake
#!/bin/bash
############ SET PROPERTIES #########
ADDRESS="walletadress"
VALIDATOR="valoperadress"
KEY_NAME="walletname"
PASS="walletpass"
CHAIN_ID="chainid"
GAS_VALUE="auto"
#FEE_VALUE=""
############ AUTO DELEGATION #########
# Withdraw
while :
do
uptickd tx distribution withdraw-rewards $(uptickd keys show $UPTICK_WALLET --bech val -a) --commission --from $UPTICK_WALLET --fees 0auptick -y
sleep 10s
AVAILABLE_COIN=$(uptickd query bank balances $(uptickd keys show $UPTICK_WALLET -a) --output json | jq -r '.balances | map(select(.denom == "ufetf")) | .[].amount' | tr -cd [:digit:])
KEEP_FOR_FEES=100000
AMOUNT=$(($AVAILABLE_COIN - $KEEP_FOR_FEES))
AMOUNT_FINAL=$AMOUNT"auptick"
echo "Available: ${AMOUNT_FINAL}"
# Delegate
#echo $PASS | defundd tx staking delegate "${VALIDATOR}" "${AMOUNT_FINAL}" --from "${KEY_NAME}" --chain-id=${CHAIN_ID} -y
uptickd tx staking delegate $(uptickd keys show $UPTICK_WALLET --bech val -a) "${AMOUNT_FINAL}" --from $UPTICK_WALLET --gas-prices 0.01auptick --gas-adjustment 1.5 --gas auto -y
date
sleep 60s
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment