diff --git a/README.md b/README.md index 5253e17..ad5e293 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,30 @@ This repository contains version 3 and onward of the smart contracts for the Sun > Note: Version 1 consisted of the closed source Plutus v1 contracts written in 2021; Version 2 consisted of a short lived attempt to rewrite them in Plutus v2, before we decided to migrate to Aiken. It's also convenient, as we also released a "v2" of the UI, and so many were getting confused when we spoke of the "v2 contracts", not understanding the difference. Migration plan document: https://docs.google.com/document/d/1iGdx3LXb-5EJNpRe-6u6FTc0k75fg2BIQj8cG5DvQVo/edit#heading=h.2ifsxfxprbh8 + Link to formal V3 whitepaper: https://cdn.sundaeswap.finance/SundaeV3.pdf ## Layout The repository is organized as follows: - validators: The core validator logic for all contracts + - tests: Any tests for the overall validator logic, against a fully constructed script context - lib: - types: Any type definitions (such as datums and redeemers) used elsewhere in the code - calculation: The math-heavy calculations for each order type + - tests: Any tests, or sample data generators, related to individual components of the smart contracts - lucid: Some lucid skeleton work for testing and benchmarking the contracts end to end - - tests: - - examples: Tests which print out example serialized datums and redeemers - - unit: Small, purpose focused tests of an individual unit of the contracts - - integration: End to end tests that evaluate an entire script context + +## Validators + +A brief overview of the validators defined in this repo: + - order.ak: This is the current "order" contract, which lets users lock funds to signal their intent to interact with the sundaeswap protocol + - stake.ak: This is a stake withdrawal used by the order.ak for the "zero withdrawal" trick to save on execution units + - pool.ak: This is the core CPP-AMM Liquidity pool logic + - settings.ak: This governs global protocol settings + - pool_stake.ak: This is a staking validator that can be attached to liquidity pools by the treasury administrator; it pays any staking rewards to the Sundae Treasury according to the same logic as pool protocol fees + +Other orders and pool types added in the future might change the structure of these folders. ## Contract architecture @@ -36,3 +46,4 @@ Some notable differences from the v1 contracts: - The rewards earned by a pool can be withdrawn to the treasury as protocol fees - Scoopers are not issued tokens to authorize them; they are defined in a global settings datum - Scoopers define the order inputs are processed, rather than relying on what order they appear in the transaction + - And more, as defined in our whitepaper above \ No newline at end of file