5

Hello is there any class or function where I can control the fees of stellar?

How much fee and where it goes ... etc

4 Answers 4

5

if you are using JS-Stellar-SDK, you may refer to this format: (for example, fee=478)

var StellarSdk = require('stellar-sdk');
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');

new StellarSdk.TransactionBuilder(sourceAccount, opts={fee:478})
.addOperation(StellarSdk.Operation.payment({ destination: destinationId, asset: StellarSdk.Asset.native(), amount: "1" })) .build()

The default fee is 100 stroops, and all the fee goes for inflation.

5
  • Is it possible to make that fee goes to a specific account instead of inflate? And what will happen if i set that fee to 0? Does it means when you do a transaction it will be without fee?
    – Ys3
    Commented Mar 29, 2018 at 10:15
  • No, because this is the system design of Stellar. If you modify the source code and compile it, there stands a chance it may be able to redirect the fee to the specific account. In that case, you are building your private network (in which I am doing) instead of joining the public one.
    – cesarm
    Commented Apr 3, 2018 at 1:13
  • A transaction always involves a small fee that goes to the inflation pool. It is like a service charge at a bank. You make an overseas transfer and they charge you maybe $5, and you won't know how the bank are exactly going to use these $5.
    – cesarm
    Commented Apr 3, 2018 at 1:19
  • What's the different between the stellar network and your private network? And from where do i have to start to build my private network? What i need for that?
    – Ys3
    Commented Apr 3, 2018 at 10:47
  • The public stellar network is used by thousands of people all over the world for live trading (e.g. with Bitcoin). The functions and settings are standardized (e.g. default fee=100, 5sec perledger)..............In contrast, if you want something other than the standard features, you may need to make some changes to the source code. The tailor-made modified code gives you something different from the standard version, and this would be your private network. The private network is in another world from the public live network, and so their records are in different pools invisible to each other.
    – cesarm
    Commented Apr 4, 2018 at 3:35
2

You can specify a custom fee, greater than default. It may give you a benefit in some rare cases. If the fee amount is less than default (0.00001 XLM per each operation included into transaction), the transaction will be rejected.

As @cesar mak mentioned above, fees are collected by the Inflation Poll and then distributed to inflation voting destinations.

Is it possible to make that fee goes to a specific account instead of inflate?

No, it's not possible. Fee mechanics is specifically designed to protect the network from spamming.

3
  • If you developed a board for stellar exchange . how you will earn by collecting fee? like my goal is to take 0.00001 xlm on each transaction instead of sending it to inflate . but since inflate is necessary . is there any way that i could take fees and send it to my wallet? without doing another operation where the user will loose 0.00001 xlm to send another 0.00001 xlm . Also take stronghold.co as an example . i send all my XLM to my stronghold.co account then i withdraw it again and in withdrawing i didn't pay 0.00001 xlm fee . so i was wounding how they did it???
    – Ys3
    Commented Mar 29, 2018 at 14:15
  • My goal is either to remove fee system where the users can trade on my board for free or to take fee of 0.00001xlm without making the user to do other operation to send me 0.00001 xlm and loose another 0.0000XLM
    – Ys3
    Commented Mar 29, 2018 at 14:15
  • Stronghold pays the fee on your behalf. I don't know what the "board" is, can only assume that it's an interface for the Stellar exchange. The only way for you to set up your own fees and do not pay Stellar fees for trades is to implement one shared wallet for all your user and create your own exchange (the same way as it was implemented by Binance, Kraken, Bittrex, and others)
    – Orbit Lens
    Commented Mar 30, 2018 at 12:15
0

Is it possible to make that fee goes to a specific account instead of inflating?

So what I understood (happy to be counter attacked) is you can set inflation destination using set_option operation. Which basically means that, you are voting this guy (inflation destination) to receive fee when inflation happens. I am not sure if it will work in case of public network or not since there will be multiple such voted accounts.

look at here :

Using the set options operation, every account selects another account as its inflation destination or nominee to receive new currency. The inflation destination will persist until changed with another set options operation.

The inflation funds are sent to an address chosen by the network to receive it each week.

0

Hey if you want to change fee in the stellar-core code base for the purpose of private stellar network, you can do it from LedgerManagerImpl.cpp file. It has method called, startNewLedger(). What you can do is, take a key (say MY_CUSTOM_FEE) in config file and set it in here something like this to start with new configuration.

void
LedgerManagerImpl::startNewLedger()
{
    auto ledger = genesisLedger();
    auto const& cfg = mApp.getConfig();
    if (cfg.USE_CONFIG_FOR_GENESIS)
    {
        ledger.ledgerVersion = cfg.LEDGER_PROTOCOL_VERSION;
        ledger.baseFee = cfg.TESTING_UPGRADE_DESIRED_FEE;
        ledger.baseReserve = cfg.TESTING_UPGRADE_RESERVE;
        ledger.maxTxSetSize = cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE;
    }

    if(cfg.CUSTOM_CONFIG)
    {
        CLOG(INFO, "Ledger") << "********************";
        CLOG(INFO, "Ledger") << "Custom config params are set";
        CLOG(INFO, "Ledger") << "********************";
        ledger.baseFee = cfg.MY_CUSTOM_FEE;
    }

    startNewLedger(ledger);
}

else you can directly go ahead and change the genesis parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.