# \[Discussion\] Dynamic burn tax: let the rate follow on-chain volume (code ready for review)

**URL:** <https://discourse.luncgoblins.com/t/discussion-dynamic-burn-tax-let-the-rate-follow-on-chain-volume-code-ready-for-review/627>\
**Category:** General\
**Created:** [December 2, 2026, 12:02pm UTC](https://discourse.luncgoblins.com/t/discussion-dynamic-burn-tax-let-the-rate-follow-on-chain-volume-code-ready-for-review/627 "2026-12-02T12:02:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteliyanPStoyanov](https://discourse.luncgoblins.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@SteliyanPStoyanov](https://discourse.luncgoblins.com/u/SteliyanPStoyanov)\
**Post date:** [December 2, 2026, 12:02pm UTC](https://discourse.luncgoblins.com/t/discussion-dynamic-burn-tax-let-the-rate-follow-on-chain-volume-code-ready-for-review/627/1 "2026-12-02T12:02:04Z")

</div>

Not an on-chain proposal yet. I’d like feedback on the idea and the code first, and I’ll keep this topic updated as things change.

The burn tax is a flat 1.5% no matter what the chain is doing. My idea is to let it follow activity. When there’s a lot of taxable volume the rate creeps up, when things are quiet it drifts back down, and governance sets the floor and the ceiling.

I went ahead and wrote it against core so there’s something concrete to look at:

> <https://github.com/classic-terra/core/pull/712>
>
> \*\*Draft for review and community discussion. Not ready to merge.\*\*
> 
> Forum discus…sion: \_link will be added once the topic is posted on discourse.luncgoblins.com\_
> 
> \## What
> 
> Optional dynamic burn tax in \`x/tax\`. When enabled by governance, the burn tax rate follows the taxable on-chain volume: higher volume raises the rate, lower volume lowers it, always within \`\[burn\_tax\_rate\_min, burn\_tax\_rate\_max\]\`.
> 
> The feature ships \*\*disabled\*\*. After the upgrade the static \`burn\_tax\_rate\` keeps applying until a separate \`MsgUpdateParams\` proposal enables it.
> 
> \## How
> 
> \- Taxable volume is recorded per block (non-uluna denoms valued via the oracle) and folded into an EMA in \`EndBlock\`.
> \- Every \`rate\_update\_interval\` blocks:
> \`rate' = clamp(rate \* (1 + clamp(speed \* (ema - target) / target, ±max\_change)), min, max)\`
> \- \*\*Grace window\*\* in the fee ante handler: if the fee does not cover the tax at the current rate but does at the previous interval's rate, the tx is charged at the previous rate. Without it, a rate increase between fee estimation and inclusion would trigger reverse charge, where the fee is kept and the full tax is also deducted from the sent amount.
> \- \`burn\_tax\_rate\` query and \`compute\_tax\` return the current rate. New query \`GET /terra/tax/v1beta1/dynamic\_burn\_tax\`.
> \- Volume bookkeeping uses an infinite gas meter, so gas costs of taxed txs don't change.
> 
> \## New params (\`x/tax\`)
> 
> | Param | Default |
> |---|---|
> | \`dynamic\_burn\_tax\_enabled\` | \`false\` |
> | \`burn\_tax\_rate\_min\` / \`burn\_tax\_rate\_max\` | \`0.005\` / \`0.03\` |
> | \`target\_block\_volume\` | \`700000000000\` uluna |
> | \`volume\_ema\_smoothing\` | \`0.001667\` (~600 blocks) |
> | \`rate\_adjustment\_speed\` | \`0.05\` |
> | \`max\_rate\_change\_per\_update\` | \`0.05\` |
> | \`rate\_update\_interval\` | \`100\` blocks |
> 
> \## Upgrade / migration
> 
> \- \`x/tax\` consensus version 2 -\> 3. The migration fills the new params with defaults and keeps the feature disabled.
> \- \`app/upgrades/v14\_7\` only runs migrations, no store changes. \*\*The name is provisional\*\*, since \`v14\_6\` is used by #711. Happy to rename or fold this into whatever release the team prefers.
> 
> \## Tests
> 
> \- Unit tests: rate math, param validation, migration from params stored without the new fields, genesis round trip, enable/disable via \`MsgUpdateParams\`, no gas consumed by the bookkeeping.
> \- Ante suite test replaying ante -\> bank msg server -\> post with a rate increase between estimate and inclusion (grace window, current rate, and reverse-charge fallback when outside the window).
> \- \`go test ./app/... ./custom/... ./x/... ./wasmbinding/...\` passes.
> \- Not yet run on localnet / rebel-2.
> 
> \## Not in this PR
> 
> The wasm \`TaxRate\` query (\`wasmbinding/query\_plugin.go\`) returns the treasury tax rate (0 on mainnet), not the burn tax rate. Left unchanged because fixing it changes contract behavior. Worth a separate issue.

It’s a draft PR. Nothing changes after the upgrade itself because the feature ships turned off, and the tax stays at 1.5% until a separate gov vote enables it and sets the numbers.

## How it works

Each block, the chain adds up the volume that actually paid burn tax. USTC and the other denoms get converted to LUNC through the oracle. That goes into a moving average over roughly an hour, so a single whale transfer or a few empty blocks don’t do much.

Every 100 blocks (about 10 minutes) the rate gets adjusted. If the average is above the target it goes up, if it’s below it goes down, and the further from target the bigger the step, up to a cap. In formula form:

```auto
change = clamp(speed × (avg_volume − target) / target, −max_change, +max_change)
new_rate = clamp(rate × (1 + change), rate_min, rate_max)

```

Between updates the rate doesn’t move, so whatever a wallet estimates is what the user gets charged.

## Starting numbers

All of these are `x/tax` params, so they can be changed with a normal param change proposal. They’re my first guess and I expect people to push back on them.

| Param | Value |
| --- | --- |
| `burn_tax_rate_min` / `burn_tax_rate_max` | 0.5% / 3% |
| `target_block_volume` | 700k LUNC per block |
| `volume_ema_smoothing` | 0.001667 (≈ 600 blocks, about an hour) |
| `rate_adjustment_speed` | 0.05 |
| `max_rate_change_per_update` | 5% of the current rate |
| `rate_update_interval` | 100 blocks |

The 700k target is a quick estimate. This epoch has collected about 982M LUNC in tax so far, which at 1.5% is about 65B LUNC of taxable volume across ~93k blocks. Someone should check it against a few months of data before this goes anywhere near an enable vote.

With these settings, going from 1.5% to 3% would take at least 2.5 hours of volume sitting at twice the target or more, and realistically longer because the average lags. Dropping to 0.5% takes 3.5+ hours of almost no volume. So it’s slow on purpose.

## Wallets, exchanges, contracts

This is where I spent most of the time, because I didn’t want anyone’s transfers going wrong.

The `burn_tax_rate` query and `compute_tax` both return the current rate, so anything that reads the rate from the chain keeps working. Contracts aren’t touched. Sending funds into a contract still isn’t taxed, and when a contract sends funds out the tax still comes off the amount like it does now. I also added a `dynamic_burn_tax` query that shows the current rate, the previous one and the volume average.

There’s one catch I found while testing. Say a wallet calculates the tax, the user signs, and the rate goes up before the tx lands. Right now, if the fee is short of the tax, the chain switches to reverse charge. It keeps the whole fee as gas and then also takes the full tax out of the amount being sent, so the user pays the tax twice. With a fixed rate that never happens, but with a moving rate it would.

So there’s a grace window. If the fee covers the tax at the previous interval’s rate, the tx just goes through at that rate. Combined with the 10 minute interval, you’d only hit the double charge if a tx sat unconfirmed for more than one full interval. There’s a test that runs exactly this case through the ante handler, the bank handler and the post handler.

The ones who would need to change something are integrations that have 1.5% hardcoded instead of asking the chain. If the rate goes above 1.5% and stays there, their users would run into the double charge. Exchanges and wallets should hear about this well before any enable vote.

## Testing

Unit tests cover the rate math, param validation, the migration and genesis export/import, plus the end-to-end ante test above. The existing app, custom, x and wasmbinding suites all pass. I haven’t run it on a localnet or rebel-2 yet. If someone with testnet nodes wants to help, I’d really like to see how the rate behaves with real traffic.

About the upgrade name: I used `v14_7` because `v14_6` is already taken by the open wasmvm PR. The core team can rename it or fold it into whatever release makes sense.

## What I’m not sure about

- The direction. I went with busy chain = higher tax = more burn. You could argue the opposite, cheaper when busy to pull in more volume. I think we should settle this first.
- Whether 0.5% to 3% is a sensible range, and how to pick the target properly.
- Whether 10 minutes and 5% per step is too slow or too fast.
- If anyone knows which exchanges hardcode 1.5%, that would help a lot.

Something unrelated I noticed while reading the code: the `TaxRate` query that contracts use (in `wasmbinding/query_plugin.go`) returns the old treasury rate, which is 0 on mainnet, not the burn tax. I didn’t touch it because fixing it changes how existing contracts behave, but it probably needs its own topic.

Comments welcome here or directly on the PR.
