- TypeScript 38.7%
- Rust 37.4%
- Shell 19.5%
- Python 2.3%
- Makefile 0.7%
- Other 1.3%
|
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #1363 |
||
|---|---|---|
| .cursor | ||
| .githooks | ||
| .github | ||
| .gitlab/issue_templates | ||
| .tmp-brand-concepts | ||
| audits | ||
| cw20-codeid-audits | ||
| deployments | ||
| docker | ||
| docs | ||
| frontend-dapp | ||
| gaps | ||
| indexer | ||
| packages/localnet-trading-swarm | ||
| scripts | ||
| skills | ||
| smartcontracts | ||
| tokenlist | ||
| .env.example | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .gitleaks.toml | ||
| .nvmrc | ||
| .woodpecker.yaml | ||
| AGENTS.md | ||
| docker-compose.qa-shared-host.yml | ||
| docker-compose.yml | ||
| gch-agent-idle-wrap.py | ||
| gch-cloud-init-runner.sh | ||
| gch-cloud-init.sh | ||
| gch-cloud-setup.sh | ||
| gch-golden-image-finalize.md | ||
| LICENSE | ||
| Makefile | ||
| NATIVE_TOKEN_WRAPPING.md | ||
| QA_PASS_2026-03-13.md | ||
| QA_PASS_2026-06-25.md | ||
| QA_TEMPLATE.md | ||
| README.md | ||
| render.yaml | ||
| renovate.json | ||
| SECURITY.md | ||
CL8Y DEX - Terra Classic
A decentralized exchange (DEX) built on Terra Classic, featuring an AMM (Automated Market Maker) with customizable fee hooks, CW20 token support, multi-hop routing, and tiered fee discounts for CL8Y token holders.
Quick Start
# Start LocalTerra
make start
# Build optimized smart contracts
make build-optimized
# Deploy contracts to LocalTerra (uploads, instantiates, creates test pair)
make deploy-local
# Start frontend dev server
make dev
Project Structure
cl8y-dex-terraclassic/
├── smartcontracts/ # CosmWasm smart contracts (Rust)
│ ├── contracts/
│ │ ├── factory/ # Factory - creates and manages trading pairs
│ │ ├── pair/ # Pair - AMM pool for two tokens
│ │ ├── router/ # Router - multi-hop swap routing
│ │ ├── fee-discount/ # Fee Discount - tiered swap fee discounts for CL8Y holders
│ │ └── hooks/ # Fee hooks (burn, tax, LP burn)
│ ├── packages/
│ │ └── dex-common/ # Shared types and messages
│ ├── scripts/
│ │ ├── optimize.sh # Build optimized wasm via Docker
│ │ └── deploy.sh # Deployment instructions for testnet/mainnet
│ └── artifacts/ # Optimized wasm output (generated)
├── frontend-dapp/ # React frontend (Vite + TypeScript)
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── pages/ # Swap, Pool, CreatePair, Tiers pages
│ │ ├── services/ # Terra Classic wallet & contract services
│ │ └── utils/ # Constants and helpers
│ └── patches/ # Cosmes library patches
├── scripts/ # Deployment scripts
│ ├── deploy-dex-local.sh # Full local deployment
│ ├── deploy-dex-testnet.sh
│ └── deploy-dex-mainnet.sh
├── docker-compose.yml # LocalTerra infrastructure
├── Makefile # Build, test, deploy commands
└── docs/ # Documentation
Available Commands
| Command | Description |
|---|---|
make start |
Start LocalTerra via Docker |
make stop |
Stop LocalTerra |
make reset |
Stop LocalTerra and delete all data |
make logs-terra |
Follow LocalTerra logs |
make build-optimized |
Build optimized wasm contracts |
make deploy-local |
Deploy all contracts to LocalTerra |
make deploy-testnet |
Print testnet deployment instructions |
make deploy-mainnet |
Print mainnet deployment instructions |
make deploy-mainnet-soft-launch |
Soft-launch deploy (non-economic CW20, cl8ydeploy) — runbook |
make test-mainnet-soft-launch-defaults |
Soft-launch defaults + dry-run regression |
make dev |
Start frontend dev server |
make test |
Run all tests (contracts + frontend) |
make lint |
Run all linters |
Networks
| Network | Chain ID | LCD |
|---|---|---|
| Local | localterra |
http://localhost:1317 |
| Testnet | rebel-2 |
https://terra-classic-lcd.publicnode.com |
| Mainnet | columbus-5 |
https://terra-classic-lcd.publicnode.com |
How we test
This repo is on GitLab and does not run GitHub Actions or GitLab CI. Checks run on your machine or QA host via make and scripts/. The YAML under .github/workflows/ is a reference checklist only (job names map to Make targets). See docs/testing.md § CI and .github/workflows/README.md. Agent playbooks: skills/AGENTS_E2E_STRICT_CHAIN.md, skills/AGENTS_LOCAL_POSTGRES_DEV.md.
Documentation
Project docs (architecture, integrators, runbooks, testing) are indexed in docs/README.md. For local, testnet, and mainnet chain IDs, LCD defaults, and indexer expectations (RUN_MODE, LCD_URLS, etc.), see the environment matrix.
Security reports: see SECURITY.md for how to report suspicious trades, UI issues, or vulnerabilities (email, GitLab template, response window).
Development
Git
The default branch is main (the only long-lived integration branch). Merge requests should target main.
Prerequisites
- Docker
- Rust with
wasm32-unknown-unknowntarget - nvm + Node 24 (
nvm install/nvm use— see.nvmrc). Makefile andscripts/with-node.shactivate it automatically for local automation.
Smart Contracts
make test-contracts # Run contract unit tests
make lint-contracts # Check formatting and clippy
make build-optimized # Build production wasm
Indexer (Rust)
The indexer has library tests (cargo test --lib, no Postgres) and integration tests (cargo test --tests) that require PostgreSQL and migrations. See Testing — Indexer (Rust) and Shared Postgres and test parallelism for TEST_DATABASE_URL and how to avoid flaky runs when multiple tests share one database.
Frontend
From repo root (Node via nvm, see .nvmrc):
bash scripts/with-node.sh --cwd frontend-dapp -- npm ci
make dev # dev server
make test-frontend # unit tests
make lint-frontend
Or activate nvm once: nvm use, then cd frontend-dapp and run npm scripts as usual.