Holiday season challenge: Add Constant Product AMM Implementation - #26
Open
FibrinLab wants to merge 2 commits into
Open
Holiday season challenge: Add Constant Product AMM Implementation#26FibrinLab wants to merge 2 commits into
FibrinLab wants to merge 2 commits into
Conversation
…tibility - Fix Aiken validator compilation errors in identity.ak - Correct validator arity (3-arg spend signature) - Fix type assertions and boolean comparisons - Update test calls to match new validator signature - Add workaround for Deno npm compatibility issue with libsodium-wrappers-sumo - Create fix-libsodium.sh script to copy missing libsodium-sumo.mjs file - Add .gitignore for wallet files - Update README with setup instructions including workaround All tests pass and validator builds successfully.
fabianbormann
requested changes
Jan 26, 2026
| } | ||
|
|
||
| validator identity { | ||
| spend( |
Collaborator
There was a problem hiding this comment.
The transaction needs a trusted initial state. You can achieve this by a minting validator and require the new token being locked in this contract next to the initial datum state. During the spending operations you'll need to make sure this token on the utxo is around to avoid someone from locking a malicious utxo with an arbitrary datum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a constant product automated market maker (AMM) on Cardano using the x * y = k formula.
On-chain (Aiken)
Parameterised validator supporting swaps, liquidity addition/removal
Constant product formula with configurable fees (basis points)
LP token minting/burning for liquidity providers
8 unit tests covering success and failure cases
Off-chain (Lucid Evolution)
TypeScript client for pool creation and token swaps
Deno configuration with npm compatibility workarounds
Basic CLI commands for AMM operations
Features