Questions about aux_fees. CLI examples? And what is its update_flags bitmask value?

Needing clearer instructions on how to set aux_fees when creating/updating an SPT. The existing help texts for assetnew and assetupdate do not provide an example for aux_fees in the form of a CLI command. Does anyone know of an existing SPT that uses it so I can getrawtransaction and have a look?

Also, I assume it is assigned some bitmask value in update_flags, but aux_fees is not mentioned in the update_flags description.

I’d like to document these aspects on syscoin.readme.io

Some clarification (or pointing me in the right direction) on these points would be appreciated.

1 Like

See Fee Structure:

assetinfo 341906151
{
“asset_guid”: 341906151,
“symbol”: “AGXS”,
“txid”: “cfb9e8756995934a8c43c74c48849e45934de93238c354a5aec5d5ec3b503cf9”,
“public_value”: “{“description”:“AGX-S”,“aux_fees”:{“address”:“sys1qwn82pzraszylhp2ht83dpg6ppjzs04z9jkce7f”,“fee_struct”:[[“0”,“0.01”],[“10”,“0.004”],[“250”,“0.002”],[“2500”,“0.0007”],[“25000”,“0.00007”],[“250000”,“0.000007”]]}}”,
“address”: “sys1q9wwse29p0m7rt46lvnquw3j77nq5q60zs0q2g5”,
“contract”: “”,
“balance”: 9774905.00000000,
“total_supply”: 10000006.00000000,
“max_supply”: 9999999999.00000000,
“update_flags”: 31,
“precision”: 8
}

You can update this with
assetupdate asset_guid “description” “contract” supply update_flags {“address”:“str”,“fee_struct”:["","",…]} “witness”

1 Like

Thanks! Got it working on TESTNET.

Seems the payout isn’t calculated precisely at the face values of the spec. Guessing some other kind of number is at work… Here is my spec based upon the AGX aux_fees example:

assetnew “tsys1qw8664cuus4wwefcsem7ecak2s2c5z8t8r8rgj9” “AUXF” “Aux_fees Test Token” “” 8 1000000 1000000 31 ‘{“address”: “tsys1qm9xqng9xnx5dax2uws7tumn8trx830nxmvv6ms”, “fee_struct”: [[“0”,“0.01”],[“10”,“0.004”],[“250”,“0.002”],[“2500”,“0.0007”],[“25000”,“0.00007”],[“250000”,“0.000007”]]}’ “”

If I send 251 tokens, the fee payout is 0.4231% (not 0.2% as specified)
If I send 1500 tokens, the fee payout is 0.2373% (not 0.2% as specified)

Digging deeper. To github I go. Looking at assetrpc.cpp

Update:
Figured it out!

The fee is calculated cumulatively across the applicable bounds.

e.g., if I send 251 tokens, the above fee spec would result in a fee calculation as follows:

(10 tokens * 0.01) + (240 tokens * 0.004) + (1 token * 0.002) = 1.062 token fee

As for update_flags, aux_fees is part of public_value and would fall within that bitmask.