No description
  • TypeScript 38.7%
  • Rust 37.4%
  • Shell 19.5%
  • Python 2.3%
  • Makefile 0.7%
  • Other 1.3%
Find a file
2026-09-27 13:20:39 +00:00
.cursor Merge origin/main into issue/1255 2026-09-21 14:31:35 +09:00
.githooks Merge origin/main into issue/1279-luncdash-ops-verify 2026-09-21 14:25:32 +09:00
.github Add GitLab CI supply-chain security stage (#380). 2026-06-13 10:12:50 +00:00
.gitlab/issue_templates feat(security): add user security contact and escalation path (#392) 2026-06-19 01:40:02 +00:00
.tmp-brand-concepts chore(design): add approved brand concept pack 2026-07-13 22:24:27 +09:00
audits audit: add 2026-09-23 internal security snapshot 2026-09-24 21:02:50 +09:00
cw20-codeid-audits merge origin/main into issue-627-cw20-codeid-3 2026-08-25 15:27:45 +09:00
deployments docs: record current columbus-5 governance split 2026-09-24 18:42:37 +09:00
docker feat(indexer): emit optional git_sha on GET /health 2026-09-20 19:48:32 +00:00
docs fix(swap): climb failed simulates by 200k before signing 2026-09-27 22:10:24 +09:00
frontend-dapp fix(swap): copy simulate tx bytes into a plain ArrayBuffer 2026-09-27 22:19:24 +09:00
gaps docs: align swap_events dedup key with (tx_hash, pair_id, swap_index) (#287) 2026-06-05 09:46:33 +00:00
indexer chore(deps): update rust crate axum to v0.8.9 2026-09-24 00:06:39 +00:00
packages/localnet-trading-swarm Add opt-in greedy book-first swap (#708). 2026-08-30 15:37:44 +09:00
scripts fix(swap): sign gas from one LCD simulate at 1.2× 2026-09-27 21:55:52 +09:00
skills fix(swap): climb failed simulates by 200k before signing 2026-09-27 22:10:24 +09:00
smartcontracts audit: add 2026-09-23 internal security snapshot 2026-09-24 21:02:50 +09:00
tokenlist feat: list Kenalinu (KENA) in tokenlist and dApp registry 2026-09-27 19:12:42 +09:00
.env.example fix(postgres): bootstrap cl8y_legal via superuser when missing (#245) 2026-05-31 23:21:07 +09:00
.gitignore fix(git): drop accidental frontend-dapp/node_modules symlink 2026-09-21 14:40:29 +09:00
.gitlab-ci.yml ci: add Phase-2a Postgres-backed indexer-integration test job (#421) 2026-06-30 03:32:46 +00:00
.gitleaks.toml feat(protocol): show FDUSD reference and Venus 1 vFDUSD Price 2026-08-20 11:25:43 +09:00
.nvmrc Initial commit 2026-03-09 14:34:35 +09:00
.woodpecker.yaml chore(deps): update alpine:3.22 docker digest to 5291449 2026-09-22 00:05:19 +00:00
AGENTS.md fix(swap): sign gas from one LCD simulate at 1.2× 2026-09-27 21:55:52 +09:00
docker-compose.qa-shared-host.yml Add QA server workflow: start-qa, stop-qa, status, tunnel help 2026-03-31 18:38:17 +09:00
docker-compose.yml fix(deps): keep local postgres on 16-alpine 16.15 2026-09-23 12:40:04 +09:00
gch-agent-idle-wrap.py chore: add agent idle watchdog for GCH runner hang 2026-06-11 23:17:24 +09:00
gch-cloud-init-runner.sh chore: add agent idle watchdog for GCH runner hang 2026-06-11 23:17:24 +09:00
gch-cloud-init.sh chore: fix Cursor CLI path to ~/.local/bin in GCH scripts 2026-06-11 15:52:39 +09:00
gch-cloud-setup.sh chore: add agent idle watchdog for GCH runner hang 2026-06-11 23:17:24 +09:00
gch-golden-image-finalize.md chore: add GCH golden-image finalize agent prompt 2026-06-11 16:16:00 +09:00
LICENSE Add license, readme 2026-03-09 14:01:45 +09:00
Makefile fix(swap): sign gas from one LCD simulate at 1.2× 2026-09-27 21:55:52 +09:00
NATIVE_TOKEN_WRAPPING.md fix(swap): gate USTC wrap gas on LUNC and keep the 2.71M envelope 2026-09-21 13:49:21 +09:00
QA_PASS_2026-03-13.md fix(frontend): default slippage protection to 5% (#497) 2026-07-25 13:21:28 +09:00
QA_PASS_2026-06-25.md Align design tokens across Tailwind, trade-bootstrap, and QA docs (#416). 2026-06-25 20:48:08 +00:00
QA_TEMPLATE.md docs: assign leftover device QA via cl8y-pm inbox 2026-09-21 16:19:58 +09:00
README.md feat: mainnet soft-launch deploy script and Coolify Dockerfiles 2026-07-11 11:22:07 +09:00
render.yaml Fix production CSP fallback hosts and Render header intersection. 2026-06-14 05:45:11 +00:00
renovate.json Add renovate.json 2026-09-20 23:47:09 +00:00
SECURITY.md Add SEC-G05 incident communications templates (#438) 2026-06-30 02:22:31 +00:00

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-unknown target
  • nvm + Node 24 (nvm install / nvm use — see .nvmrc). Makefile and scripts/with-node.sh activate 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.