Package: algo-amm
Automated Prediction Market Maker on AlgorandNOTE: This code is not audited and should not be used in production environment.SummaryAlgo AMM is an automated prediction market maker on Algorand that allows users to trade on the outcomes of events, and follow the odds to garner accurate insights about the future.Our target market is traders, speculators and investors who are interested in taking advantage of the predictive power of markets. The user problem we are addressing is the difficulty in predicting outcomes of events accurately and reliably. Our solution is an automated prediction market maker that allows users to trade on the outcomes of events, and follow the odds to garner accurate insights about the future. We provide liquidity for users to buy or sell Voting Shares, which can be redeemed for 1 unit of the stable asset if the outcome is resolved as correct, and become worthless if it’s incorrect.The goal is, by harnessing the power of free markets to aggregate collective knowledge and provide the general public with an unbiased source of truth in regards to the likelihood of certain significant events happening in the future.Project Slides DeckWe wrote contract for Prediction Market Constant Function Automated Market Maker with the help ofPyTealandPy-algorand-sdk.The front end application is written with react and vite.The repository for the front-endAlgoAMM LiveFoundersPavel Fedotov:LinkedInTwitterGitHubGrigore Gabriel Trifan:LinkedInTwitterGitHubOverviewConstant Function Automated Market Maker (AMM) contract provides configuration options and creates a market for an event that has a binary outcome.Liquidity Pool provides a foundation for users to purchase and redeem spawned tokens once the event has been resolved. The Liquidity Pool supports a constant reserve ratio for stable price discovery and protection from liquidity drain. The liquidity provided allows to spawn two tokens in equal amount in 25%/25% proportion of the liquidity supplied.The purchase price for each token is determined by equation: x + y = k. Where x is the amount of A tokens in the AMM, y is the amount of B tokens in the AMM.Once the event has occurred the price for one token should resolve to 1, while 0 for another.Liquidity Shares and Voting Shares can only be released after the creator of the contract moderated the outcome.As a prediction market maker on Algorand, our primary role would be to provide liquidity to users who are looking to buy and sell prediction market tokens on the platform. This involves creating markets for events or outcomes, such as the winner of a political election or the outcome of a sports game, and setting prices for these tokens based on supply and demand.RequirementsVscodeor another IDEPython 3PIP Package ManagerPy-algorand-sdkPyTEALAlgorandPurestake node api keyPyTeal AMM Smart ContractPyTeal contracts are written in Python using any editor of your choice.compileProgrammethod produces the TEAL code which is then compiled into bytecode and deployed to the blockchain.The PyTeal smart contract consists of two programs. These are called the approval program and the clear programs. In PyTeal both of these programs are generally created in the same Python file.Theapproval_programis responsible for processing all application calls to the contract, with the exception of the clear call. The program is responsible for implementing most of the logic of an application.Theclear_programis used to handle accounts using the clear call to remove the smart contract from their balance record.Inamm.pywe keep the high-level logic of the contract,helpers.pycontains lower level methods andconfig.pykeeps track of global variable and key configuration variables.Useful ResourcesPyTEALTestnet DispensaryAlgorand DispenserPy-algorand-sdkAlgoExplorerAlgorand: Build with PythonAlgorand: Smart contract detailsAmm Demo contractCreating Stateful Algorand Smart Contracts in Python with PyTealHow to publish PIP packageAlgorand Ecosystem Algo AMM pageHow To Use unittest to Write a Test Case for a Function in PythonMore Information about DspytDspyt HomepageDspyt GitHub DAO Page