Ir al contenido

How to change pool settings

Esta página aún no está disponible en tu idioma.

Pools are addresses that give us permissions to automatically sell energy for them, and as such there are settings to be configured that can be done both on the TEM website and with the API.

  1. Define authentication and pool information:
    const API_KEY = "YOUR_API_KEY";
    const ADDRESS = "YOUR_POOL_ADDRESS";
  2. Set the new parameter/s from the table:
    //In this case AWARD_AMOUNT
    const AWARD_AMOUNT = 0.85;
  3. Build params and send it:
    const params = {
    award_amount: AWARD_AMOUNT,
    address: ADDRESS,
    api_key: API_KEY
    };
    axios.post(API_URL, params)
const axios = require('axios');
const API_KEY = "YOUR_API_KEY";
const ADDRESS = "YOUR_POOL_ADDRESS";
const AWARD_AMOUNT = 0.85;
const API_URL = "https://api.tronenergy.market/pool/update";
async function changePoolSettings() {
// No need for signed_tx
const params = {
award_amount: AWARD_AMOUNT,
address: ADDRESS,
api_key: API_KEY
};
axios.post(API_URL, params)
.then((res) => {
console.log("update ok");
console.log(res.data);
})
.catch((error) => {
console.error("woops, something wrong happened!");
console.error(error.response?.data);
});
}
changePoolSettings();
Field Accepted values Default Description
award_amount [0 - 0.85] 0.85 Amount of rewards to award (% of the order delegated; the higher the %, the less priority in order filling)
award_address "" "" Address where rewards should be sent
payment_frequency [3600000, 86400000] 86400000 Payment frequency in milliseconds: 3600000 = hourly, 86400000 = daily
free_value 0 0 TRX (in SUN) you want to keep unstaked
undelegate_energy_value 0 0 Minimum energy you want to keep
undelegate_bandwidth_value 0 0 Minimum bandwidth you want to keep
min_energy_price -1 -1 Minimum price at which to sell energy (-1 = auto)
min_bandwidth_price -1 -1 Minimum price at which to sell bandwidth (-1 = auto)
min_delegate_energy_amount -1 -1 Minimum amount of energy to delegate per order (-1 = auto)
max_delegate_energy_amount -1 -1 Maximum amount of energy to delegate per order (-1 = auto)
min_delegate_bandwidth_amount -1 -1 Minimum amount of bandwidth to delegate per order (-1 = auto)
max_delegate_bandwidth_amount -1 -1 Maximum amount of bandwidth to delegate per order (-1 = auto)
min_delegate_duration -1 -1 Minimum delegation duration (-1 = auto)
max_delegate_duration 2592000 2592000 Maximum delegation duration
max_redelegate_span_duration -1 -1 Maximum redelegation span duration in seconds (-1 = auto)
vote_address "" "" SR address you vote for
frozen_address [] [] Addresses you delegate to but do not want to reclaim from
filter_address [-1, 0, 1] -1 -1 = disabled, 0 = blacklist, 1 = whitelist
filter_address_whitelist [] [] Addresses you want to sell energy/bandwidth to
filter_address_blacklist [] [] Addresses you do not want to sell energy/bandwidth to
undelegate_active false false Whether to undelegate current energy orders
freeze_active false false When enabled, lets the system stake on your behalf
vote_active true true Actively vote for an SR
vote_rewards_withdraw_active true true Collect voting rewards, by default once per day
private_active false false Whether the pool information should be hidden from the public list
active true true Whether the pool is active
exclusive_undelegate false false If true, only delegations created by TEM are reclaimed; if false, everything is reclaimed except delegations without an expiration time
flush_active false false If enabled, nothing is delegated and everything is reclaimed
freeze_for_energy_amount [0 - 1] 0 Percentage of staking allocated to energy; the remainder is allocated to bandwidth (API only, not in web UI)