A13: DeFi Builder

Grading Rubric

Assessment Overview: This assignment evaluates students' ability to deploy and interact with DeFi smart contracts, understand AMM pricing mechanics, and communicate technical observations. It assesses both practical Solidity deployment skills and conceptual understanding of constant-product market making.

Point Distribution Summary

Component Points Percentage
Part 1: DEX Deployment & Operation (30 points)
Token Deployment (2 ERC-20 tokens) 8 13%
DEX Deployment & Liquidity 10 17%
Successful Swaps (3+ swaps) 12 20%
Part 2: Worksheet & Price Observations (15 points)
Data Recording (reserves, outputs) 6 10%
Price Calculations & k Verification 5 8%
Analysis Questions 4 7%
Part 3: Group Presentation (15 points)
Content & Technical Accuracy 8 13%
Clarity & Communication 4 7%
Time Management & Preparation 3 5%
TOTAL 60 100%
Bonus: Slippage Protection and/or Escrow (Optional) +10 -

Detailed Rubric

Part 1: DEX Deployment & Operation (30 points)

1A. Token Deployment (8 points)
7-8 points: Both ERC-20 tokens deployed successfully with custom names/symbols. Tokens have correct totalSupply, balanceOf works, approve and transferFrom functional.

5-6 points: Both tokens deployed and mostly functional. Minor issues (e.g. forgot custom name, used default values) but tokens work for DEX operations.

3-4 points: Only one token deployed successfully, or both deployed but with functional issues (e.g. approve not working properly).

1-2 points: Tokens deployed but cannot be used with the DEX (missing approve/transferFrom).

0 points: No tokens deployed or tokens do not compile.
1B. DEX Deployment & Liquidity (10 points)
9-10 points: SimpleDEX deployed with correct token addresses. Liquidity added successfully (both tokens transferred to DEX). Reserves show correct values. Student can explain each deployment step.

7-8 points: DEX deployed and liquidity added, but minor issues (e.g. uneven initial liquidity, needed multiple attempts).

5-6 points: DEX deployed but liquidity addition had problems (e.g. forgot to approve first, only partial liquidity added).

2-4 points: DEX deployed but could not add liquidity. Student understands the concept but has technical difficulties.

0-1 points: DEX not deployed or does not compile.
1C. Successful Swaps (12 points)
10-12 points: Completed 3+ swaps with varying sizes (small, medium, large). At least one reverse swap. All swaps execute without errors. Student can read transaction logs and explain output amounts.
  • 4 pts per swap type: small swap (1000), medium swap (10000), large swap (50000)
  • Bonus consideration for reverse swap and additional experiments
7-9 points: Completed 2-3 swaps successfully. May be missing the reverse swap or one size category.

4-6 points: Completed 1-2 swaps. May have had reverts or needed significant instructor help.

1-3 points: Attempted swaps but most reverted. Shows understanding of the process but cannot execute reliably.

0 points: No successful swaps.

Part 2: Worksheet & Price Observations (15 points)

2A. Data Recording (6 points)
5-6 points: All rows of the worksheet completed:
  • Initial reserves recorded correctly
  • After-swap reserves for each swap
  • Output amounts match transaction logs
  • Data is consistent and clearly organised
4 points: Most rows filled in but minor gaps or inconsistencies (e.g. missing one swap's data).

2-3 points: Partial data recorded. Some key values missing or clearly incorrect (not matching actual transaction results).

0-1 points: Worksheet mostly empty or data is fabricated.
2B. Price Calculations & k Verification (5 points)
5 points: For each swap:
  • Effective price calculated correctly (amount out / amount in)
  • k = reserveA × reserveB computed and shown to be approximately constant
  • Price impact noted (deviation from initial 1:1 ratio)
4 points: Calculations mostly correct with minor arithmetic errors. k verification attempted but may have small discrepancies.

2-3 points: Some calculations attempted but with errors. k verification missing or incorrect.

0-1 points: No calculations or fundamentally wrong approach.
2C. Analysis Questions (4 points)
4 points: Thoughtful answers to all analysis questions demonstrating understanding of:
  • Why larger swaps have worse effective prices (price impact)
  • Why k stays approximately constant
  • Connection to real-world DEXes and slippage
3 points: Answers most questions correctly with reasonable depth.

2 points: Answers are superficial or partially incorrect.

0-1 points: Analysis questions unanswered or completely incorrect.

Part 3: Group Presentation (15 points)

3A. Content & Technical Accuracy (8 points)
7-8 points: Presentation demonstrates:
  • Correct explanation of AMM pricing mechanics
  • Accurate description of price impact from their swap data
  • Valid connection between their experiment and real DEXes
  • Answers questions correctly and confidently
5-6 points: Mostly accurate content with minor technical errors. Covers all required sections but some explanations lack depth.

3-4 points: Basic understanding shown but significant gaps (e.g. cannot explain why price changed, incorrect formula reference).

1-2 points: Major technical errors or fundamental misunderstanding of how the DEX works.

0 points: Did not present or completely incorrect.
3B. Clarity & Communication (4 points)
4 points:
  • Clear, well-organised presentation flow
  • Uses concrete numbers from their worksheet to illustrate points
  • All group members contribute
  • Screen shared effectively to show Remix results
3 points: Generally clear communication with minor organisation issues.

2 points: Somewhat unclear or disorganised. Uneven participation.

1 point: Difficult to follow or single member dominates.

0 points: Incomprehensible or unprofessional presentation.
3C. Time Management & Preparation (3 points)
3 points: Completes presentation within 3-minute window (+/- 15 seconds), well-rehearsed, smooth transitions.

2 points: Slightly over/under time (+/- 30 seconds) but shows preparation.

1 point: Significantly over/under time or appears under-prepared.

0 points: Grossly inappropriate time usage or clearly unprepared.

Bonus: Advanced Extensions (Optional +10 points)

Bonus A: Slippage Protection (+5 points)
5 points: Modified swap function includes _minOut parameter with working require(amountOut >= _minOut) check. Demonstrated a swap that succeeds when minOut is reasonable and one that reverts when minOut is set too high.

3-4 points: Slippage parameter added and mostly works but missing the demonstration of a reverted transaction.

1-2 points: Attempted modification but it does not compile or function correctly. Shows understanding of the concept.
Bonus B: Simple Escrow (+5 points)
5 points: Escrow contract from L11 deployed alongside DEX. Demonstrated a complete escrow flow: deposit, confirm delivery or dispute. Can explain how escrow complements DEX trading.

3-4 points: Escrow deployed and partially demonstrated. Some steps missing but concept understood.

1-2 points: Escrow deployed but could not complete the flow. Shows effort and conceptual understanding.

Grading Scale

Grade Points Percentage Description
A 54-60 90-100% Exceptional: all contracts working, complete worksheet with accurate calculations, excellent presentation
B 48-53 80-89% Good: DEX working with minor issues, mostly complete worksheet, competent presentation
C 42-47 70-79% Satisfactory: DEX partially working, worksheet gaps, basic presentation
D 36-41 60-69% Below expectations: significant deployment issues, incomplete worksheet, weak presentation
F 0-35 <60% Insufficient: DEX not working, worksheet mostly empty, did not present

Additional Grading Guidelines

Academic Integrity

  • Collaboration: Encouraged within groups. Each group must deploy their own contracts (not share addresses with another group).
  • Code: Using the provided contract code is expected. Modifications for bonus should be original work.
  • Worksheet: Data must come from actual contract interactions, not fabricated numbers.
  • AI Tools: May be used for debugging but students must understand every line of deployed code.

Late Submission Policy

  • Worksheet: Must be submitted by end of class period.
  • Remix Verification: Instructor checks contracts during or immediately after class.
  • Missed Presentation: Cannot be made up; group presents with remaining members or forfeits presentation points.

Special Considerations

  • Technical Difficulties: If Remix crashes mid-session, instructor may grant extra time. Document the issue.
  • Individual Grading: Instructors may adjust individual scores if one member clearly did not contribute.
  • Partial Credit: Credit given for correct process even if final deployment fails (e.g. correct approve calls, correct constructor args).
  • Bonus Attempt: Any attempt at bonus extensions receives at least 1 point if it shows understanding.
Instructor Notes:
  • Focus grading on process understanding, not just whether transactions succeeded
  • Students who can explain WHY a transaction reverted demonstrate deeper understanding than those who simply got lucky
  • The worksheet k-verification will have small rounding errors due to integer division -- this is expected and correct
  • Reward groups who experiment beyond the minimum (extra swaps, different amounts, creative token names)
  • The 75-minute session is tight -- be flexible if groups need a few extra minutes for deployment

© Joerg Osterrieder 2025-2026. All rights reserved.