Skip to content

An experimental ERC20 token implementing adaptive tokenomics through an auto-adjusting transfer tax. The contract monitors recent transfer volume in a configurable time window and dynamically increases or decreases fees based on market activity. A clean, dependency-free demonstration of self-regulating, volume-responsive economic design.

License

Notifications You must be signed in to change notification settings

AmirhosseinHonardoust/Adaptive-Tax-Token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Adaptive Tax Token

A Self-Regulating ERC20 Token With Auto-Adjusting Fees Based on Real-Time Market Activity


Overview

The Adaptive Tax Token is an experimental ERC20 designed to demonstrate dynamic, self-adjusting tokenomics. Instead of using a static fee model (common in reflection/tax tokens), this contract uses transfer volume monitoring to automatically regulate the tax rate.

If recent transfer activity is:

  • LOW → tax increases slowly (up to a configured max)
  • HIGH → tax decreases slowly (down to a configured min)
  • MEDIUM → tax remains where it is

This creates a self-regulating system that adapts to market behavior, nudges users toward healthier price discovery, and illustrates how tokenomics can behave like an economic control loop instead of a static configuration.

This project is not a typical meme tax token, it’s a research-oriented demonstration of adaptive economic design, perfect for:

  • smart contract learners
  • tokenomics researchers
  • DeFi analysts
  • economic modelers
  • experimental developers

Core Concept: Adaptive Tokenomics

Traditional tokens rely on:

  • fixed fees
  • fixed reward curves
  • fixed emission schedules

These are fragile and become outdated the moment market conditions change.

Adaptive tokenomics takes a different approach:

The token continuously senses its own environment and adjusts parameters automatically.

This contract demonstrates exactly that by adapting one key parameter:

Transfer Tax (in basis points)

Which is:

  • increased when network usage is low
  • decreased when usage is high
  • stabilized when usage is healthy

This mimics feedback systems found in:

  • biological organisms
  • financial control loops
  • automated market makers
  • economic stabilizing policies

How It Works (Simple Explanation)

Every time a transfer happens:

  1. The contract checks if the measurement window expired

    • Example: every 24 hours (volumeWindow)
  2. It evaluates how much total volume occurred in that period

    • windowVolume
  3. It compares volume to 2 thresholds

    • lowVolumeThreshold
    • highVolumeThreshold
  4. Tax rate is adjusted accordingly

    • low volume → increase tax
    • high volume → decrease tax
    • else → keep tax steady
  5. The window resets for the next period

  6. A tax fee is applied on transfers

    • Sent to a treasury address
    • Unless the sender/receiver is exempt

This system behaves like a miniature “adaptive economy.”


Volume Window Logic Overview

The system monitors transfers in time windows:

windowVolume += amount

After each transfer, it checks if:

block.timestamp >= windowStart + volumeWindow

If yes:

if volume < lowVolumeThreshold:
    tax += adjustStep (but not above max)

else if volume > highVolumeThreshold:
    tax -= adjustStep (but not below min)

else:
    tax stays same

This creates smooth tax movements, never too sudden or extreme.


Key Configurable Parameters

These give you full control over how adaptive your token is.

Parameter Description
taxBps Current tax in basis points
minTaxBps Minimum allowed tax
maxTaxBps Maximum allowed tax
adjustStepBps How much the tax moves per window
volumeWindow Time window in seconds
windowVolume Tracked transfer volume
lowVolumeThreshold Below = low activity
highVolumeThreshold Above = high activity
treasury Address receiving fees
isTaxExempt Addresses immune to tax

This system is flexible and tunable like a real economic mechanism.


Project Structure

adaptive-tax-token/
│
├── contracts/
│   └── AdaptiveTaxToken.sol
│
└── README.md

This fits perfectly into:

  • Remix
  • Hardhat
  • Foundry
  • Truffle
  • Any EVM-compatible dev stack

Contract Features in Depth

Here’s a deeper look at everything inside the token.


1. ERC20 Implementation

The contract includes:

  • name, symbol, decimals
  • balance tracking
  • allowances
  • transfer / transferFrom / approve

No external libraries, pure Solidity.


2. Adaptive Fee Mechanism

A rolling time window (24h) tracks how much volume happened. Based on thresholds:

  • Too little activity → raise tax
  • Too much activity → lower tax
  • Moderate activity → leave tax unchanged

This encourages:

  • more trading when tax falls
  • treasury accumulation when trading quiets

It becomes a form of semi-autonomous monetary policy.


3. Treasury System

The collected fees flow to:

treasury

Admins can change the treasury address to:

  • DAO treasury
  • staking pool
  • liquidity incentives
  • development fund

4. Admin Controls

The owner can update:

  • tax bounds (min/max)
  • tax adjust speed
  • volume window
  • thresholds
  • treasury
  • tax-exempt addresses
  • ownership

This allows fine-tuning behavior as you test.


5. Clean, Auditable Logic

The entire contract:

  • is readable
  • avoids unnecessary complexity
  • follows proper ordering of checks
  • uses explicit error messages
  • includes clear events

Perfect for audits or educational demonstration.


Example Parameter Config

Here’s a great example config for simulation:

initialSupply       = 1,000,000 tokens
decimals            = 18

initialTaxBps       = 200 (2%)
minTaxBps           = 50  (0.5%)
maxTaxBps           = 500 (5%)

adjustStepBps       = 25 (0.25% change per window)

volumeWindow        = 86400 (24 hours)
lowVolumeThreshold  = 10,000 tokens/day
highVolumeThreshold = 100,000 tokens/day

Meaning:

  • If daily volume < 10k → raise tax
  • If daily volume > 100k → lower tax
  • Else → maintain current tax

This mirrors a simple macroeconomic stabilizer.


Example Scenario Simulations

Scenario 1: Quiet Day

Daily transfers = 3,000 tokens → below low threshold → tax increases by 25 bps

After 4 quiet windows: → tax increases from 2% → 3%


Scenario 2: Busy Day

Daily transfers = 200,000 tokens → above high threshold → tax decreases by 25 bps

Encourages more trading by reducing fee burden.


Scenario 3: Healthy Market

Daily transfers = 50,000 tokens → tax remains stable

The system stays balanced.


Security Considerations

While not designed for high-value deployments, this system is built with clean logic.

Important notes:

Owner power is significant

Owner can:

  • change bounds
  • change thresholds
  • change treasury

This is intentional for experimentation.

No reentrancy

Transfers update state safely before external calls.

No hidden mechanisms

  • no rebasing
  • no reflections
  • no minting
  • no burns unless manually coded

All changes transparent

Tax changes emit events.


Potential Upgrades (Future V2/V3)

If you want to extend this:

Add liquidity pool monitoring

Dynamic tax governed by:

  • pool size
  • volatility
  • price impact

Add multi-token adaptive logic

React to multiple market signals.

Add quadratic or exponential adjustments

Instead of linear adjustments.

Add user-specific dynamic tax

Based on holding time or user behavior.

Add off-chain analytics integration

AI-based parameter tuning.

Governance DAO controls

Community-driven economic policy.


License

MIT License

This project is free for:

  • educational use
  • modification
  • commercial use
  • research use
  • integration into demos

Contributions

Issues, improvements, and extensions are welcome. This project is intended as an economic playground, build on it freely.

About

An experimental ERC20 token implementing adaptive tokenomics through an auto-adjusting transfer tax. The contract monitors recent transfer volume in a configurable time window and dynamically increases or decreases fees based on market activity. A clean, dependency-free demonstration of self-regulating, volume-responsive economic design.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published