Commit graph

341 commits

Author SHA1 Message Date
openhands
6c1217f451 fix: address review — soften AI claim to autonomous system (#176) 2026-02-22 23:36:19 +00:00
openhands
4287dc2f1a fix: address review — soften claims, remove redundancy (#176) 2026-02-22 23:36:19 +00:00
openhands
45b997bef6 fix: address review — remove false admin key claims, soften floor language (#176) 2026-02-22 23:36:19 +00:00
openhands
9f1c255e13 feat: expand autonomous protocol narrative, adopt token-owned-liquidity language (#176) 2026-02-22 23:36:19 +00:00
johba
8a5a4f7e6d Merge pull request 'feat: add live indicator and freshness display to LiveStats (#172)' (#179) from fix/issue-172 into master 2026-02-23 00:36:04 +01:00
openhands
a8f62e2357 fix: start freshness ticker after first data load (#172) 2026-02-22 23:01:42 +00:00
johba
360b67d96c Merge pull request 'feat: add Code docs page with contract source + copy buttons (#174)' (#181) from fix/issue-174 into master 2026-02-22 23:31:30 +01:00
openhands
1b55ae8ac8 fix: address review — error state for live indicator (#172) 2026-02-22 22:12:38 +00:00
openhands
7d5d8cabb2 feat: add live indicator and freshness display to LiveStats (#172)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:42:31 +00:00
openhands
85cd5a8986 feat: add Code docs page with contract source + copy buttons (#174)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:41:43 +00:00
johba
3ea3053134 Merge pull request 'fix: show USD values in LiveStats, fix floor price truncation (#171)' (#178) from fix/issue-171 into master 2026-02-22 22:41:01 +01:00
openhands
ae44bddf7f fix: address review — floor price null guard, fetch timeout (#171) 2026-02-22 21:21:45 +00:00
openhands
c374e29817 fix: show USD values in LiveStats, fix floor price truncation (#171)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 20:53:24 +00:00
johba
6f7e07b4fc Merge pull request 'feat: replace tax with holders in ring buffer, add sparkline charts (#170)' (#177) from fix/issue-170 into master 2026-02-22 21:51:26 +01:00
openhands
23b63b4dd6 chore: retrigger CI 2026-02-22 20:11:09 +00:00
openhands
d72c2d14bf fix: remove console.warn to pass lint (#170) 2026-02-22 19:48:39 +00:00
openhands
bd5c661504 fix: address review — ring buffer validation, div-by-zero, sparkline alignment
- Add ringBuffer length validation in extractSeries and extractSupplySeries
- Fix division-by-zero when oldest holder count is 0
- Align supply series start with other series (consistent pre-launch skip)
- Center flat sparklines vertically instead of pinning to bottom
2026-02-22 19:47:28 +00:00
openhands
66930d7013 chore: remove broken review.yml — reviews run on host 2026-02-22 18:56:36 +00:00
openhands
0fb1ed4bf8 fix: address review — migration comment, link ring buffer constants (#170) 2026-02-22 18:56:36 +00:00
openhands
3fceb4145a feat: replace tax with holders in ring buffer, add sparkline charts (#170)
Ring buffer slot 3 now stores holderCount snapshots instead of tax deltas.
Tax tracking simplified to a totalTaxPaid counter on the stats record.
Removed unbounded ethReserveHistory and feeHistory tables; 7d ETH reserve
growth is now computed from the ring buffer. LiveStats renders inline SVG
sparklines for ETH reserve, supply, and holders with holder growth %.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:56:36 +00:00
johba
4206f3bc63 Merge pull request 'feat: make How It Works CTA prominent, add crypto-native tagline (#175)' (#182) from fix/issue-175 into master 2026-02-22 19:40:41 +01:00
openhands
8e93253b5c feat: make How It Works CTA prominent, add crypto-native tagline (#175) 2026-02-22 17:39:33 +00:00
johba
20a808a507 Merge pull request 'fix: replace Start Earning messaging with accurate staking positioning (#173)' (#180) from fix/issue-173 into master 2026-02-22 18:33:40 +01:00
openhands
ecbd167997 fix: address review — extract inline style, tighten disclaimer copy 2026-02-22 17:16:54 +00:00
openhands
533c5755b5 fix: remove staking references from landing page
Landing page sells the token, not staking. Staking is password-protected
for insiders — not advertised to casual visitors.

- 'Stake in 30 Seconds' → 'Get $KRK in 30 Seconds' (Mixed)
- 'Stake & Grow' → 'Get $KRK' (Offensive)
- Remove 'staker sentiment' from HomeView copy
- Add staking visibility rule to UX-DECISIONS.md
2026-02-22 16:49:02 +00:00
openhands
57deaaaf8f ci: fix clone auth with codeberg_token secret 2026-02-22 16:07:07 +00:00
openhands
6304cca556 fix: replace Start Earning messaging with accurate staking positioning (#173) 2026-02-22 11:34:48 +00:00
johba
1e0822eaa2 fix: clean URLs, contract addresses, gitmodule (#16, #58, #147) (#162) 2026-02-20 17:28:59 +01:00
johba
79c9c8571a fix: retry bootstrap swap with recenter (#134, #13, #12) (#166) 2026-02-20 09:19:13 +01:00
johba
d9b5131101 fix: Get KRK local swap, WalletCard on all variants (#146, #150) (#165) 2026-02-20 09:18:51 +01:00
johba
b3b7ab72f9 feat: wallet transaction history table (#155) (#164) 2026-02-20 09:18:10 +01:00
johba
396f2b5f90 docs: layered information architecture (#140) (#163) 2026-02-20 09:01:11 +01:00
johba
fe02ffd12d copy: remove AI claims, reframe as adaptive protocol (#160) 2026-02-20 09:00:34 +01:00
johba
9e69dcdcac fix: copy hoisted node_modules in CI Dockerfile (#161) 2026-02-20 02:36:00 +01:00
openhands
6893d4065f chore: remove unused assets (header-imageold.png, test artifacts) 2026-02-19 20:07:49 +00:00
johba
db3633425a feat: shared @harb/web3 package + landing wallet connect (#157) (#159) 2026-02-19 20:18:27 +01:00
johba
66106077ba feat: wallet P&L with average cost basis tracking (#156) (#158) 2026-02-19 16:22:23 +01:00
johba
76b2635e63 Replace UBI with ETH reserve in ring buffer, fix Dockerfile HEALTHCHECK, enhance LiveStats (#154) 2026-02-19 14:47:15 +01:00
johba
31063379a8 feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01:00
openhands
de3c8eef94 docs: consolidate and update all documentation for launch readiness
- Rewrite root README.md with proper project overview, tech stack, and repo structure
- Remove duplicate CLAUDE.md files (root, onchain, ponder) — AGENTS.md is the standard
- Update HARBERG.md to reflect Stage 1 completion and Stage 2 evolution
- Delete stale onchain/testing_todos.md (all high-priority items completed)
- Update VERSION_VALIDATION.md for VERSION=2
- Trim root AGENTS.md: replace Docker duplication with docs/docker.md reference
- Trim onchain/AGENTS.md (129→71 lines): reference TECHNICAL_APPENDIX for formulas
- Trim web-app/AGENTS.md (278→55 lines): remove internal API docs, keep architecture
- Rewrite onchain/README.md: add contract table, deployment addresses, analysis links
- Trim services/ponder/README.md: remove stale subgraph comparison
- Add otterscan to docs/docker.md service topology
- Update TECHNICAL_APPENDIX.md references

Net: -388 lines across documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:22:34 +00:00
openhands
b7260b2eaf chore: analysis tooling, research artifacts, and code quality
- Analysis: parameter sweep scripts, adversarial testing, 2D frontier maps
- Research: KRAIKEN_RESEARCH_REPORT, SECURITY_REVIEW, STORAGE_LAYOUT
- FuzzingBase: consolidated fuzzing helper, BackgroundLP simulation
- Sweep results: CSV data for full 4D sweep (1050 combos), bull-bear,
  AS sweep, VWAP fix validation
- Code quality: .gitignore for fuzz CSVs, gas snapshot, updated docs
- Remove dead analysis helpers (CSVHelper, CSVManager, ScenarioRecorder)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:22:03 +00:00
openhands
d64b63aff4 feat: deployment scripts, E2E tests, and documentation
- DeployBase: shared deployment logic with OptimizerV3 UUPS proxy
- DeployBaseMainnet: Base mainnet configuration (feeDest, WETH, factory)
- DeployLocal: local Anvil deployment with OptimizerV3
- UpgradeOptimizer: UUPS upgrade script for existing proxy
- DEPLOYMENT_RUNBOOK: step-by-step mainnet deployment guide
- E2E tests: recenter position verification, optimizer integration
- Landing page: updated docs for OptimizerV3 and protocol changes
- Remove dead DeployScript2.sol

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:21:49 +00:00
openhands
85350caf52 feat: OptimizerV3 with direct 2D staking-to-LP parameter mapping
Core protocol changes for launch readiness:

- OptimizerV3: binary bear/bull mapping from (staking%, avgTax) — avoids
  exploitable AW 30-90 kill zone. Bear: AS=30%, AW=100, CI=0, DD=0.3e18.
  Bull: AS=100%, AW=20, CI=0, DD=1e18. UUPS upgradeable with __gap[48].
- Directional VWAP: only records prices on ETH inflow (buys), preventing
  sell-side dilution of price memory
- Floor formula: unified max(scarcity, mirror, clamp) — VWAP mirror uses
  distance from adjusted VWAP as floor distance, no branching
- PriceOracle (M-1 fix): correct fallback TWAP divisor (60000s, not 300s)
- Access control (M-2 fix): deployer-only guard on one-time setters
- Recenter rate limit (M-3 fix): 60-second cooldown for open recenters
- Safe fallback params: recenter() optimizer-failure defaults changed from
  exploitable CI=50%/AW=50 to safe bear-mode CI=0/AW=100
- Recentered event for monitoring and indexing
- VERSION bump to 2, kraiken-lib COMPATIBLE_CONTRACT_VERSIONS updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:21:18 +00:00
openhands
21857ae8ca feat: protocol stats display + parameter sweep fuzzing infrastructure (#106)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:09:11 +00:00
openhands
37b1002dae feat: add Otterscan block explorer to dev environment (#109)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:55:07 +00:00
openhands
61b7ee435f chore: remove unused pt-v5-twab-controller submodule (54MB) 2026-02-13 14:37:20 +00:00
openhands
d581b8394b fix(onchain): resolve KRK token supply corruption during recenter (#98)
PROBLEM:
Recenter operations were burning ~137,866 KRK tokens instead of minting
them, causing severe deflation when inflation should occur. This was due
to the liquidity manager burning ALL collected tokens from old positions
and then minting tokens for new positions separately, causing asymmetric
supply adjustments to the staking pool.

ROOT CAUSE:
During recenter():
1. _scrapePositions() collected tokens from old positions and immediately
   burned them ALL (+ proportional staking pool adjustment)
2. _setPositions() minted tokens for new positions (+ proportional
   staking pool adjustment)
3. The burn and mint operations used DIFFERENT totalSupply values in
   their proportion calculations, causing imbalanced adjustments
4. When old positions had more tokens than new positions needed, the net
   result was deflation

WHY THIS HAPPENED:
When KRK price increases (users buying), the same liquidity depth
requires fewer KRK tokens. The old code would:
- Burn 120k KRK from old positions (+ 30k from staking pool)
- Mint 10k KRK for new positions (+ 2.5k to staking pool)
- Net: -137.5k KRK total supply (WRONG!)

FIX:
1. Modified uniswapV3MintCallback() to use existing KRK balance first
   before minting new tokens
2. Removed burn() from _scrapePositions() - keep collected tokens
3. Removed burn() from end of recenter() - don't burn "excess"
4. Tokens held by LiquidityManager are already excluded from
   outstandingSupply(), so they don't affect staking calculations

RESULT:
Now during recenter, only the NET difference is minted or used:
- Collect old positions into LiquidityManager balance
- Use that balance for new positions
- Only mint additional tokens if more are needed
- Keep any unused balance for future recenters
- No more asymmetric burn/mint causing supply corruption

VERIFICATION:
- All 107 existing tests pass
- Added 2 new regression tests in test/SupplyCorruption.t.sol
- testRecenterDoesNotCorruptSupply: verifies single recenter preserves supply
- testMultipleRecentersPreserveSupply: verifies no accumulation over time

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:20:57 +00:00
johba
e5e1308e72 refactor: consolidate CI and local dev orchestration (#108)
## Summary
- Extract shared bootstrap functions into `scripts/bootstrap-common.sh` (eliminates ~120 lines of duplicated forge/cast commands from e2e.yml)
- Create reusable `scripts/wait-for-service.sh` for health checks (replaces 60-line inline wait-for-stack)
- Merge dev and CI entrypoints into unified scripts branching on `CI` env var (delete `docker/ci-entrypoints/`)
- Replace 4 per-service CI Dockerfiles with parameterized `docker/Dockerfile.service-ci`
- Add `sync-tax-rates.mjs` to CI image builder stage
- Fix: CI now grants txnBot recenter access (was missing)
- Fix: txnBot funding parameterized (CI=10eth, local=1eth)
- Delete 5 obsolete migration docs and 4 DinD integration files

Net: -1540 lines removed

Closes #107

## Test plan
- [ ] E2E pipeline passes (bootstrap sources shared script, services use old images with commands override)
- [ ] build-ci-images pipeline builds all 4 services with unified Dockerfile
- [ ] Local dev stack boots via `./scripts/dev.sh start`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/108
2026-02-03 12:07:28 +01:00
johba
4277f19b68 feature/ci (#84)
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/84
2026-02-02 19:24:57 +01:00
traddoo
beefe22f90 fix(web-app): position ID, issuance earned (#96)
Bug #1: Position ID Transformation Issue (#95)

  Problem: Frontend applied incorrect byte conversion to position IDs, causing transactions to fail with "NoPermission"
  errors.

  Root Cause: formatId() function did little-endian byte conversion on already-correct numeric strings from GraphQL.

  Fix: Direct conversion BigInt(obj.id) instead of formatId(obj.id as Hex) in usePositions.ts.

  Result: Users can now successfully stake/unstake positions.

  ---
  Bug #2: Issuance Earned Calculation Error (#97)

  Problem: Frontend showed negative "Issuance Earned" values (e.g., -4,991 KRK) due to wrong mathematical formula.

  Root Cause: Formula calculated position.totalSupplyInit - currentTotalSupply (always negative when supply increases).

  Fix: Correct formula (currentTotalSupply - position.totalSupplyInit) × position.share in Vue components.

  Result: Shows realistic positive earnings and enables proper economic monitoring.

Co-authored-by: steve <steve@harberg.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/96
Co-authored-by: traddoo <traddoo@noreply.codeberg.org>
Co-committed-by: traddoo <traddoo@noreply.codeberg.org>
2025-11-20 19:44:10 +01:00