packages/contracts: Foundry contractspackages/server: Hono + TypeScript backendapps/web: Next.js frontend
npm install
npm run demonpm run demo automatically:
- starts
anvil - deploys local contracts
- exports the local development environment variables
- starts the server
- starts the web app
Use this when you want the full local flow without manual setup.
npm run devThat command only runs:
npm run server:devnpm run web:dev
It does not start a local chain or deploy contracts.
anvil
export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export LIYIELD_RPC_URL=http://127.0.0.1:8545
npm run manage -- deploy --private-key $PRIVATE_KEY --rpc-url $LIYIELD_RPC_URL
export LIYIELD_KEEPER_DEPLOYMENT_FILE=packages/contracts/deployments/contracts.local.json
npm run server:dev
npm run web:devThe current code defaults to:
packages/contracts/deployments/contracts.base.jsonFor local anvil development, you will usually want:
export LIYIELD_KEEPER_DEPLOYMENT_FILE=packages/contracts/deployments/contracts.local.jsonkeeper:LIYIELD_KEEPER_PRIVATE_KEY->PRIVATE_KEYoracle:LIYIELD_ORACLE_PRIVATE_KEY->LIYIELD_KEEPER_PRIVATE_KEY->PRIVATE_KEYterm manager:LIYIELD_TERM_MANAGER_PRIVATE_KEY->LIYIELD_KEEPER_PRIVATE_KEY->PRIVATE_KEY
The simplest local setup is:
export PRIVATE_KEY=0xyour_private_keyWhen the server boots, it can start these schedulers:
- ETF snapshot and price refresh
- Earn snapshot persistence
- keeper scheduler
- oracle valuation scheduler
- market oracle scheduler
- term lifecycle scheduler
These are enabled by default unless the corresponding LIYIELD_*_ENABLED variable is explicitly set to false.
PRIVATE_KEYLIYIELD_KEEPER_PRIVATE_KEYLIYIELD_ORACLE_PRIVATE_KEYLIYIELD_TERM_MANAGER_PRIVATE_KEYLIYIELD_RPC_URLLIYIELD_RPC_URL_<chainId>LIYIELD_KEEPER_DEPLOYMENT_FILE
LIYIELD_AUTO_REFRESH_ENABLEDLIYIELD_EARN_SNAPSHOT_ENABLEDLIYIELD_KEEPER_SCHEDULER_ENABLEDLIYIELD_ORACLE_SCHEDULER_ENABLEDLIYIELD_MARKET_ORACLE_SCHEDULER_ENABLEDLIYIELD_TERM_SCHEDULER_ENABLED
LIYIELD_ORACLE_AUTO_PUBLISH_ENABLEDLIYIELD_MARKET_ORACLE_AUTO_PUBLISH_ENABLEDLIYIELD_TERM_AUTO_CONFIGURE_ONCHAIN_ENABLED
LIFI_API_KEYLIFI_API_BASE_URLLIFI_EARN_API_BASE_URL
The frontend calls relative /api/... paths by default.
If you set NEXT_PUBLIC_API_BASE, the browser will call that API origin directly:
NEXT_PUBLIC_API_BASE=https://api.example.comFor local override:
cd apps/web
echo 'NEXT_PUBLIC_API_BASE=http://127.0.0.1:8787' > .env.localIf NEXT_PUBLIC_API_BASE is not set, the frontend does not default to localhost.
In that case, /api must be handled by your external reverse proxy on the same origin.
The web dev server port is controlled by WEB_PORT and defaults to 3030.
This is intentionally separate from the backend PORT env var, so a deployment environment that sets PORT=8787 does not force Next.js onto the backend port.
cd apps/web
echo 'WEB_PORT=3030' >> .env.localIf you open the page on http://localhost:3030 without NEXT_PUBLIC_API_BASE, browser requests should appear as /api/... on the web origin.
If you set NEXT_PUBLIC_API_BASE=http://127.0.0.1:8787, browser requests will go directly to http://127.0.0.1:8787/api/....
- maintain ETF, strategy, and target registries
- build ETF snapshots and price history
- wrap LI.FI Earn data
- generate and execute keeper allocation and rebalance flows
- generate valuation, settlement, and market-state data
- manage term lifecycle
GET /api/etfsGET /api/indexGET /api/etfs/:etfId/priceGET /api/etfs/:etfId/price/history
GET /api/earn/targetsGET /api/earn/vaultsGET /api/earn/portfolio/:addressGET /api/earn/snapshots
POST /api/keeper/allocation-planPOST /api/keeper/execute-allocation-planPOST /api/keeper/execute-rebalancePOST /api/keeper/reconcile-runsGET /api/keeper/runs
POST /api/oracle/valuation-reportPOST /api/oracle/auto-valuationPOST /api/oracle/market-stateGET /api/oracle/market-statesGET /api/oracle/term-apy-curveGET /api/oracle/term-statusPOST /api/oracle/settlement-reportPOST /api/oracle/settlement-from-valuationsPOST /api/oracle/auto-settlement
POST /api/admin/refreshPOST /api/admin/earn-snapshot