{"id":15454443,"url":"https://github.com/pfed-prog/algoswapper","last_synced_at":"2025-03-28T09:42:42.820Z","repository":{"id":103561284,"uuid":"457541440","full_name":"Pfed-prog/AlgoSwapper","owner":"Pfed-prog","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-21T00:28:59.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T10:29:00.744Z","etag":null,"topics":["algorand","algorand-assets","algorand-blockchain","algorand-js-sdk","algorand-smart-contract","algorand-standard-assets","algorand-teal","pyteal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pfed-prog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-09T21:55:32.000Z","updated_at":"2024-04-28T08:33:09.000Z","dependencies_parsed_at":"2023-03-16T05:00:29.123Z","dependency_job_id":null,"html_url":"https://github.com/Pfed-prog/AlgoSwapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FAlgoSwapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FAlgoSwapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FAlgoSwapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FAlgoSwapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pfed-prog","download_url":"https://codeload.github.com/Pfed-prog/AlgoSwapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246009029,"owners_count":20708880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorand","algorand-assets","algorand-blockchain","algorand-js-sdk","algorand-smart-contract","algorand-standard-assets","algorand-teal","pyteal"],"created_at":"2024-10-01T22:02:56.741Z","updated_at":"2025-03-28T09:42:42.815Z","avatar_url":"https://github.com/Pfed-prog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AlgorandDeFi\n\nOn Ubuntu 20.04\n\n```bash\npython3 -m virtualenv project\nsource project/bin/activate\npip3 install -r requirements.txt\n```\n\n### Example of Queries\n\nInclude API token in the headers:\n\n```\ncurl -X GET \"https://testnet-algorand.api.purestake.io/ps2/v2/applications/70171358\"\n\ncurl -X GET \"https://testnet-algorand.api.purestake.io/ps2/v2/applications/70171358?include-all=True\"\n\ncurl -X GET \"https://testnet-algorand.api.purestake.io/idx2/v2/accounts\"\n\ncurl -X GET \"https://testnet-algorand.api.purestake.io/idx2/v2/accounts?asset-id=43994923\"\n```\n\n### Liquidity Pools\n\nhttps://academy.binance.com/en/articles/what-are-liquidity-pools-in-defi\n\nLiquidity pools are the backbone of many decentralized exchanges (DEX), such as Uniswap. Users called liquidity providers (LP) add an equal value of two tokens in a pool to create a market. In exchange for providing their funds, they earn trading fees from the trades that happen in their pool, proportional to their share of the total liquidity.\nAs anyone can be a liquidity provider, AMMs have made market making more accessible.\n\n## Sandbox\nAll of the examples were developed on a local network with local addresses. To duplicate the results and run the examples on your own, you will first need to make sure that you have an Algorand node running and `goal` set up with at least three accounts. \n\nrepository structure:\n```\n|__Sandbox\n|__AlgoSwapper\n```\n\n```\ncd sandbox\n```\n\nto start an instance:\n```\n./sandbox up\n```\n\nto list accounts:\n```bash\n./sandbox goal account list\n```\n\n\nExample account: DJ24DOMQY6GWI4NY6CFSQFNWREIQYTN6ABQU7DTIBY5KTGGENF3F2RSMJU\n\nTo access the TEAL contracts in the node, we have to copy them into our sandbox.\n\n```\n./sandbox copyTo ../AlgoSwapper/counter/counter.teal\n./sandbox copyTo ../AlgoSwapper/counter/counter_clear.teal\n```\n### Deploy the Smart Contract\n\n```\n./sandbox goal app create --creator DJ24DOMQY6GWI4NY6CFSQFNWREIQYTN6ABQU7DTIBY5KTGGENF3F2RSMJU --global-byteslices 0 --global-ints 1 --local-byteslices 0 --local-ints 0 --approval-prog counter.teal --clear-prog counter_clear.teal\n```\n\nLogs:\n\n```\nAttempting to create app (approval size 49, hash P3JCINPYNWCX54B6OCN4HWXTLJ2ZUPORDFMBPHPJECVIZNHRS4VQ; clear size 4, hash BJATCHES5YJZJ7JITYMVLSSIQAVAWBQRVGPQUDT5AZ2QSLDSXWWA)\nIssued transaction from account DJ24DOMQY6GWI4NY6CFSQFNWREIQYTN6ABQU7DTIBY5KTGGENF3F2RSMJU, txid 5ADIFLSEAB5FOTHN47FIE5KZV6VLLYOIPK5SQA4B2DBNYQXTYCIA (fee 1000)\nTransaction 5ADIFLSEAB5FOTHN47FIE5KZV6VLLYOIPK5SQA4B2DBNYQXTYCIA still pending as of round 22225\nTransaction 5ADIFLSEAB5FOTHN47FIE5KZV6VLLYOIPK5SQA4B2DBNYQXTYCIA still pending as of round 22226\nTransaction 5ADIFLSEAB5FOTHN47FIE5KZV6VLLYOIPK5SQA4B2DBNYQXTYCIA committed in round 22227\nCreated app with app index 1\n```\n\n### Call the Smart Contract\n```\n./sandbox goal app call --from DJ24DOMQY6GWI4NY6CFSQFNWREIQYTN6ABQU7DTIBY5KTGGENF3F2RSMJU --app-id 1\n```\nLogs:\n```\nIssued transaction from account DJ24DOMQY6GWI4NY6CFSQFNWREIQYTN6ABQU7DTIBY5KTGGENF3F2RSMJU, txid 72JOG33S3DKMGQ3EOEXW26NQDRWJ7T4S2GRH2OC6Y3AH7UF5DLDA (fee 1000)\nTransaction 72JOG33S3DKMGQ3EOEXW26NQDRWJ7T4S2GRH2OC6Y3AH7UF5DLDA still pending as of round 22325\nTransaction 72JOG33S3DKMGQ3EOEXW26NQDRWJ7T4S2GRH2OC6Y3AH7UF5DLDA still pending as of round 22326\nTransaction 72JOG33S3DKMGQ3EOEXW26NQDRWJ7T4S2GRH2OC6Y3AH7UF5DLDA committed in round 22327\n```\n\n### Read Value\n\n```bash\n./sandbox goal app read --global --app-id 1\n```\n\n### Delete Application\n\n```bash\n./sandbox goal app delete --app-id 34 -f 'TQSYJU6BRS4ECUTREW6WAVMRK6MR2XAOC6TKQ46QSDQLVXQJE2O3TT63AU'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfed-prog%2Falgoswapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfed-prog%2Falgoswapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfed-prog%2Falgoswapper/lists"}