NH25_Flux_Atlas is a sophisticated economic simulation platform that models resource trading between countries using psychologically-informed bidding behaviors and cluster-based auction mechanisms.
- Dynamic resource trading simulation
- Cluster-based auction system
- Psychologically modeled bidding behavior
- Real-time API integration
- Interactive bidding interface
- Running a python based simulation model
The simulation uses a modified Laplace distribution to model bidding behavior based on supply-demand dynamics. Our bidding function combines market dynamics with psychological distance decay:
where:
The key components are:
w: Laplace decay factor (psychological willingness to deviate from ideal quantity)b: Scale parameter controlling bid sensitivitydistance: Absolute difference between offered quantity and demanded quantityk: Sensitivity multiplier for demand-based scalingmin_b: Minimum scale parameter to prevent division by zero
v_value = base_price * (1.0 + max_increase * w)
where:
- max_increase = max(0.0, min(1.0, (demand/supply) - 1.0))
- w = exp(-distance/b) # Laplace decay
- b = max(abs(demand) * k, min_b) # Sensitivity
- distance = |quantity - demand|After countries compute their bid values using the Laplace-based psychological model, the auction follows a Vickrey (second-price sealed-bid) mechanism:
- Each country submits their sealed bid
v_valuecomputed from the Laplace function - The highest bidder wins the auction
- The winner pays the second-highest bid price (or base price if single bidder)
This mechanism is chosen because:
- It incentivizes truthful bidding - countries' best strategy is to bid their true valuation
- Reduces strategic manipulation - winning price depends on others' bids
- Balances market efficiency with fair pricing
- Prevents winner's curse and aggressive overbidding
Mathematically: $$p_{final} = \begin{cases} v_{2nd\text{-}highest} & \text{if multiple bids} \ base_{price} & \text{if single bidder} \end{cases}$$
Where
Our simulation implements a sophisticated cluster-based distribution system that ensures fair market access across different economic tiers:
Initial Quantity: Q
Round 1: Q/2
Round 2: Q/4
Round 3: Q/8
Round 4: Q/8 (remainder)
This halving mechanism serves multiple purposes:
- Allows countries with smaller demands to participate in later rounds
- Prevents market monopolization by larger economies
- Creates multiple opportunities for price discovery
- Ensures efficient resource distribution across all economic clusters
Countries are grouped into economic clusters (e.g., Emerging Markets, Developing Nations, High-Income Nations). Each cluster:
- Receives a proportional allocation of the auctioned resource
- Participates in independent parallel auctions
- Competes within their economic peer group
- Has equal access to each batch round
Countries decide to sell based on several factors:
- Supply-Driven Probability: Higher resource supply increases likelihood of initiating auction
auction_probability = min(0.3, supply_amount / total_world_supply)
- Conservative Quantity Selection: Countries offer 10-30% of their supply
auction_quantity = supply * random.uniform(0.1, 0.3)
- Multi-Round Strategy: Resources not sold in one round cascade to next batch
The bidding strategy incorporates demand-matching and quantity optimization:
-
Demand Alignment:
$$bid_urgency = \frac{|quantity - demand|}{demand}$$ - Lower difference → Higher bid probability
- Perfect quantity match maximizes bid value
-
Supply-Demand Ratio Impact:
$$bid_modifier = \frac{demand}{available_supply}$$ - High demand/low supply → Aggressive bidding
- Low demand/high supply → Conservative bidding
-
Quantity Sensitivity:
- Large quantity mismatch reduces bid probability
- Small batches attract countries with precise demands
- Batch size reduction increases participation from smaller economies
This multi-faceted approach creates a dynamic market where:
- Resources are distributed efficiently across economic tiers
- Countries participate based on realistic economic behaviors
- Market access is democratized through the batch system
- Price discovery occurs at multiple levels
Future enhancement planned for incorporating additional economic indicators:
- GDP influence
- Political relations
- Transportation costs
- Python 3.12+
- Node.js 18+
- PostgreSQL 14+
# Clone repository
git clone https://github.com/your-repo/NH25_flux_Atlas.git
cd NH25_flux_Atlas
# Create virtual environment
python -m venv env
# Activate virtual environment
# Windows:
env\Scripts\activate
# Linux/Mac:
source env/bin/activate
# Install dependencies
pip install -r requirements.txt
# Setup environment
cp api/.env.example api/.env
# Edit .env with your database credentials
# Start API server
cd api
python3 run.pycd frontend
npm install
npm run devNH25_flux_Atlas/
├── api/ # FastAPI backend
│ ├── app/ # API implementation
│ └── run.py # API entry point
├── auction/ # Auction logic
│ ├── auction.py # Base auction classes
│ └── turn_based_simulation.py # Turn-based logic
├── frontend/ # React frontend
├── models/ # Data models
└── requirements.txt # Python dependencies
Once running, API documentation is available at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
python3 auction_manager.pyfrom auction.auction_manager import run_bidding_simulation
run_bidding_simulation(
bidder_country=japan,
seller_country=russia,
resource_name="PETROLEUM",
total_quantity=50.0,
base_price=0.5
)Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
- Aarush Bhat
- Cong Thinh Nguyen
- Sashreek Addanki
- Neamur
- Hamse
- Jacob
- Cherie
See the LICENSE file for details.
- NeurAlbertaTech Hackathon 2025