openhands
748557bc83
fix: lint: Ban waitForTimeout, setTimeout-as-delay, and fixed sleep patterns ( #442 )
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 20:58:01 +00:00
openhands
ed5db3b000
fix: use toHaveText to correctly await swap completion after testId migration
...
getByTestId('swap-buy-button').waitFor({ state: 'visible' }) resolved
immediately because the button is always rendered; only its text changes.
Replace with expect(...).toHaveText('Buy KRK', { timeout: 60_000 }) to
correctly gate on the button returning to its idle state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 23:47:53 +00:00
openhands
68601c255a
fix: getByRole('button', { name: 'Buy' }).last() fragility is duplicated across e2e/01 and this scenario ( #398 )
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 23:13:05 +00:00
openhands
7296852d0e
fix: migrate test 02 swap to get-krk page; add VITE_ENABLE_LOCAL_SWAP to CI
...
- Update 02-max-stake-all-tax-rates.spec.ts to buy KRK via /app/get-krk
instead of the removed cheats-page swap card
- Add VITE_ENABLE_LOCAL_SWAP=true to the webapp CI service so
LocalSwapWidget renders in the e2e pipeline
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 07:23:31 +00:00
johba
1e0822eaa2
fix: clean URLs, contract addresses, gitmodule ( #16 , #58 , #147 ) ( #162 )
2026-02-20 17:28:59 +01: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
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
johba
a555a2fdd1
refactor: migrate kraiken-lib to explicit subpath imports (BREAKING CHANGE) ( #89 )
...
Removes the barrel export pattern in favor of explicit subpath imports
for better tree-shaking and clearer dependencies.
## Breaking Changes
- Removed `src/helpers.ts` barrel export
- Removed `./helpers` from package.json exports
- Root `kraiken-lib` import now raises build errors
- Consumers MUST use explicit subpaths:
- `kraiken-lib/abis` - Contract ABIs
- `kraiken-lib/staking` - Staking helpers
- `kraiken-lib/snatch` - Snatch selection
- `kraiken-lib/ids` - Position ID utilities
- `kraiken-lib/subgraph` - Byte conversion utilities
- `kraiken-lib/taxRates` - Tax rate constants
- `kraiken-lib/version` - Version validation
## Changes
- kraiken-lib:
- Bumped version to 1.0.0 (breaking change)
- Updated src/index.ts to raise build errors
- Added backward-compatible ABI aliases (KraikenAbi, StakeAbi)
- Updated all test files to use .js extensions and new imports
- Updated documentation (README, AGENTS.md)
- Consumer updates:
- services/ponder: Updated ponder.config.ts to use kraiken-lib/abis
- web-app: Updated all imports to use subpaths
- composables/usePositions.ts: kraiken-lib/subgraph
- contracts/harb.ts: kraiken-lib/abis
- contracts/stake.ts: kraiken-lib/abis
## Migration Guide
```typescript
// OLD
import { getSnatchList } from 'kraiken-lib/helpers';
import { KraikenAbi } from 'kraiken-lib';
// NEW
import { getSnatchList } from 'kraiken-lib/snatch';
import { KraikenAbi } from 'kraiken-lib/abis';
```
Fixes #86
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/89
2025-11-20 18:54:53 +01:00
johba
aa1ddfcecd
fill stake e2e
2025-10-11 17:54:49 +00:00