Feature and its Use Cases
Body
Motivation
Windmill is not a traditional static-price order book. Orders define time-dependent price functions and matching is lazy (transaction-triggered).
Before building UI components, we should define:
- Frontend architecture
- Contract interaction layer
- Real-time price evaluation strategy
- Deterministic trade preview model
This prevents UI assumptions that conflict with protocol mechanics.
Scope of Initial Frontend Setup
1️⃣ Project Structure
Proposed structure:
src/
components/
pages/
hooks/
services/
contracts/
pricing/
utils/
2️⃣ Contract Integration Layer
Create a dedicated contract service layer responsible for:
- Reading order data
- Evaluating price at current timestamp
- Estimating trade outcomes
- Preparing transaction calls
UI components should not directly handle contract logic.
3️⃣ Time-Dependent Price Evaluation
Frontend must evaluate:
P(t_now) = startPrice + slope * (t_now - startTime)
using latest block timestamp (not local clock if possible).
Display:
- Current evaluated price
- Remaining amount
- Price trajectory (optional visual)
This is not a static order table.
4️⃣ Deterministic Trade Preview
Before calling matchOrders, UI should:
- Compute buyPrice(t_now)
- Compute sellPrice(t_now)
- Verify match condition locally
- Show expected settlement amount
This ensures user understands execution outcome.
Deliverable
- Clean React/Vite/Next setup (depending on stack)
- Wallet connection (e.g., wagmi / ethers)
- Contract read/write layer
- Basic order display
- Basic trade preview logic
Goal
Create a frontend foundation that correctly reflects:
- Lazy execution model
- Time-dependent pricing
- Deterministic settlement
Before adding visual complexity.
Additional Context
No response
Code of Conduct
Feature and its Use Cases
Body
Motivation
Windmill is not a traditional static-price order book. Orders define time-dependent price functions and matching is lazy (transaction-triggered).
Before building UI components, we should define:
This prevents UI assumptions that conflict with protocol mechanics.
Scope of Initial Frontend Setup
1️⃣ Project Structure
Proposed structure:
2️⃣ Contract Integration Layer
Create a dedicated contract service layer responsible for:
UI components should not directly handle contract logic.
3️⃣ Time-Dependent Price Evaluation
Frontend must evaluate:
using latest block timestamp (not local clock if possible).
Display:
This is not a static order table.
4️⃣ Deterministic Trade Preview
Before calling
matchOrders, UI should:This ensures user understands execution outcome.
Deliverable
Goal
Create a frontend foundation that correctly reflects:
Before adding visual complexity.
Additional Context
No response
Code of Conduct