Enhance Bank functionality with new game mechanics and API updates#162
Open
saiseahawks wants to merge 1 commit into
Open
Enhance Bank functionality with new game mechanics and API updates#162saiseahawks wants to merge 1 commit into
saiseahawks wants to merge 1 commit into
Conversation
- Added new fields for game state: experience points (xp), level, and quest progress. - Introduced methods for managing game state, including experience gain and quest initialization. - Updated balance management methods to support new game features. - Modified database mappings to use JSONB for certain fields, improving performance. - Refactored BankApiController to streamline dependencies and enhance API structure. - Adjusted security configuration to permit access to bank-related endpoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a quantitative trading / learning game on top of the Bank feature. Market data, indicators, ML, backtesting, news sentiment, and paper trading live in
mvc/quant/and are exposed through/bank/quant/*(and/api/bank/quant/*). The Bank entity gains RPG-style progression (XP, level, quests). Market data can come from Yahoo Finance, Alpha Vantage, or bundled CSV files.Why
The frontend needs one backend surface for the Bank quant game: prices, indicators, backtests, ML predictions, news/sentiment, and paper trades tied to Bank balance. Putting everything under
/bankkeeps cash balance as the single source of truth and avoids spreading logic across controllers.What changed
New package:
src/main/java/com/open/spring/mvc/quant/ALPHAVANTAGE_API_KEY), or local CSV. Config:market.provider=auto|yahoo|alphavantage. Caching to reduce rate limits.Bank.balance; positions in memory perpersonIdBar,Headline,SentimentSnapshot,PaperPortfolio,BacktestResult,MLTrainResponseNew static data:
src/main/resources/market-data/AAPL.csv,AMZN.csv,TSLA.csv— offline fallback when live providers fail or for local dev without API keysBankApiControllerrefactorSingle controller at
/bankand/api/bank:Core bank
GET /byPersonPOST /depositPOST /withdrawQuant
GET /quant/market/historyPOST /quant/indicators/calcGET /quant/news/sentimentPOST /quant/ml/trainPOST /quant/backtest/runPOST /quant/paper/orderGET /quant/paper/portfolioUses constructor injection instead of field
@Autowired.Breaking change: Removed old endpoints (leaderboard, loans, analytics, NPC progress, bulk import/export). Restore or migrate if other clients still use them.
Bankentityxp,level,questProgress(Run Backtest, Beat Buy&Hold, Sharpe >= 1.0, Train ML Model, Use News Boost)addXp()and simple levelingsetBalance(amount, source)records profit history by source (e.g.paper_trade_buy)jsonbfor MySQLlastRunStatsis@Transientto avoid SQLite schema errors on startupSecurity (
MvcSecurityConfig)permitAll()for/bank/**(game can call without session)/api/bank/**still requires JWT (ROLE_USER+)Minor
BankJpaRepository/BankService— cleanup onlyLocal dev