A simple scheduled script for restaking rewards on VALR.com.
When run, this script will use the VALR.com API to get the account balance for SOL and AVAX, and stake the full available amount.
VALR staking rewards are paid out immediately and not automatically restaked. To benefit from compound growth you have to restake your rewards. This script, when deployed to Netlify, automates that.
When deployed on Netlify, the script will execute at 5 minutes past every hour.
It is strongly recommended to use a dedicated sub-account for staking.
In your sub-account, create a new API key with "View" and "Trade" permissions. DO NOT grant withdrawal permissions. Note the API key and secret.
Use the above "Deploy to Netlify" button to deploy on Netlify. Provide the API key and secret in the API_KEY and API_SECRET environment variables, respectively.
If you want to deploy more than one instance of this script, perhaps targeting a different sub-account, you can do so in the Netlify App by clicking "Add new site" and picking "Import an existing project".
Connect to your git provider and pick your fork of this repo, created when you deployed the first instance.
Next, click "Advanced" and then add two variables, API_KEY
and API_SECRET
, with your API key and secret. Click "Deploy site". That's it!
You can run this script directly, without using Netlify:
API_KEY='your API key here' API_SECRET='your API secret here' node stake-all.js
Like this? Please show your gratitude by sending me a tip with VALR Pay.
VALR Pay me here: https://www.valr.com/payments/send?payId=DQ87EY5LUF94HA8YUBJZ