Skip to content

Tenyokj/alsoswap-core

Repository files navigation

AlsoSwap v1.0.0 License: GPL-3.0 Node.js >=22 TypeScript 5.8.0 Hardhat 3.0.15 Solidity ^0.8.20 Upgradeable: Transparent Proxy DEX Ethers 6.15.0 Tests: Unit passing Coverage >95%

AlsoSwap Banner

AlsoSwap Protocol

AlsoSwap Protocol is an upgradeable AMM DEX for DAO and community ERC20 tokens in Ethereum Sepolia.

It provides a full on-chain stack for token listing, liquidity provisioning, and token exchange with constant-product pricing. Projects can launch pools for governance tokens, LPs can provide liquidity and earn fees, and users can swap tokens through a router with slippage/deadline controls.

This repository contains the core protocol contracts, deployment scripts, upgrade scripts, verification scripts, and high-coverage test suites.

Why AlsoSwap

  1. Built for DAO token ecosystems: easy onboarding of project tokens into AMM pools.
  2. Real liquidity and market-driven pricing: pool reserves define executable spot price.
  3. Practical developer stack: routers, oracle, governance, and proxy-based upgrades.
  4. Testnet-first safety: strong engineering practices without mainnet-level economic assumptions.

What You Can Do

  1. Create pools for any ERC20 pair through PoolFactory.
  2. Add and remove liquidity with LP share accounting.
  3. Swap tokens via Router and optimized RouterV2 paths.
  4. Swap ETH paths through WETH wrappers.
  5. Use flash swap mechanics for advanced integrations.
  6. Query TWAP from PriceOracle for safer external pricing usage.
  7. Control protocol parameters with timelocked governance flows.

How It Works

  1. A DAO token project creates or reuses a pool for token pairs.
  2. Liquidity providers deposit both assets and receive LP shares.
  3. Traders swap through router endpoints.
  4. Pool output is calculated from constant-product math with fee logic.
  5. Protocol fee portion is sent to treasury.
  6. Oracle tracks cumulative prices for TWAP-based quoting.
  7. Governance can update fee and safety parameters via timelock.

Documentation Map

Main docs

  1. Getting Started
  2. Architecture
  3. Config
  4. Operations
  5. Security
  6. Upgrades
  7. FAQ
  8. Glossary

Contracts docs

  1. Contracts Navigation

DevOps docs

  1. Deploy Guide
  2. Deploy Scripts Index
  3. Testing Guide

Roadmap

  1. More advanced route search (multi-hop >2 and liquidity-aware ranking).
  2. Additional risk controls for flash swap and pool-level limits.
  3. Better analytics surface for fee and volume dashboards.
  4. Optional frontend and SDK integration package.

Disclaimer

This codebase is designed for developer usage and public testing on Sepolia. It follows strong Solidity engineering practices, but it is not positioned as audited mainnet production infrastructure by default. Always review the latest docs and run your own risk checks before integration.

License

2026 AlsoSwap Contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

If you did not receive a copy, see: https://www.gnu.org/licenses/