whats cooking today you may ask? \
Todays task :
๐ณ Quick fixes (~30 min each):
1. deployedAmount auto-bump bug โ currently deposit_more / add_position / increase don't update strategies.deployedAmount after success. Available math drifts. Existing pattern
from supply_aave to copy. Clean little win.
I would realy want to rely on onchain data to be honest , our walet holdings should be a copy of a \
basescan.org/tokentxns?a=0xbโฆ
From there we should be able to calculate what truly we have deposit , what we have taken out , whats is the profit ,
1B. I am really not a fan of certain steps in our playbook , and maybe this will help , and we can get rid off "strategy allocations"
For entry playbook: Step 1 checks for funds , the grabs whatever is in a wallet: i would like to change that , when i hit step or run all , step one should show me what funds we have in a wallet , USDC, EURC or AREO , if tokens are present
lets say i have $100 USDC and 14.2344433 EURC , i should see 2 text boxes, amount, cint info and max button [____] $100 USDC (max) , if i pick $50 USDC , only $50 should get allocated to the strategy , if i pick EURC dust , same think
This should be integrated with Deposit playbook, additional step after step 1 "Pick target position", step 1b. Provide amount .
Let me know what you think ?
Phase 1 (today, ~2 hrs):
- New pick_amounts step type (engine + inline action + UI)
- Wire into entry playbook's step 1 (replace/precede check_available_funds)
- Wire into deposit_more playbook (insert step 1b after pick_position)
- Downstream resolver hook: read runParams.amounts.<TOKEN> for swap/create/increase steps
Phase 2 (next session):
- src/lib/defi/onchain-pnl.ts โ walks Transfer events, classifies, computes net committed + profit per strategy
- Wire into v2 dashboard P&L card
- Deprecate deployedAmount math (keep field as audit history)
Phase 3 (later):
- Migrate Available badge to source from wallet idle USD directly
- Possibly drop deployedAmount and initialAllocation columns once confident
2. Calendar cron click-to-edit โ project_calendar_cron_mgmt in memory. UI only, no on-chain risk. Test crons accumulate, no way to remove via UI.
๐ฅ Medium (~1 hour):
3. Test rerange playbook live โ uses our batched skills + useTargetRangeRatio. Move #68574158 to a slightly different range as a sanity check. Real money at stake but small
($105).
4. Refactor 6 playbook columns โ single playbooks JSON map โ the schema is getting silly. Pure cleanup, decent test coverage already exists.
๐ Bigger (multi-session):
5. ETH strategy planning โ borrowing platform TBD per project_borrow_platform_layer3. We're at the point where a real plan doc + strategy config would help.
6. Auto-resume cron for slippage-paused swaps โ project_slippage_auto_resume.