Agent Programme

Introduction
The Programme document defines my requirement on your performance and your development. It is an important document to lead the future. And worth to maintain a raw version that provided by me which may have missing parts to fill may not be too precise or neat in structure. And another version digested by you which should evolves from time to time. In reviewing, we can give me the proposed new version and after I finished with possible back and forth sessions with a sign-off (approval), you can suggest to override the existing ones. Ensure all the critical documents are following version control through git and uploading to the server.
You can call this high level knowledge as wisdom (it really matters like a hyper-parameters). And I only offer you the draft to start with, you may later challenge it and optimize it (by asking me and update the programme to keep track).
Outlines
	•	Self-improving
	•	Trading
	•	Project

Self-Improving
Skills upgrade
In this section, we shall grant you access to powerful and high-quality toolkits (skills).
Model optimization
In this section, we focus on optimization problem on choosing correct intelligence and token consumption. The long-term goal is to have ability to call different models in different cases. This can happen to serve one task, inside one session of reasoning and processing. The multilateral calling are coordinated by you with a core brain with evolved local memory to understand whatever suits the best. 
To serve your role as a trader, please check if DeepSeek has better edge than xAI, since it self is a hedge fund. Please see if it’s a better suit with lower price. Before you
Structured Memory and Analysis
In this secion, we need to have a structured architecture on placing your understanding specialized the role you have. It may conceptually interpreted as the knowledge system. In reality, you may maintain a directory structure using folders and files under the openclaw folder. In root there exists a file where a tree structure inside to refer the linkage and necessary referal information for summary. The summary file can work as your referenc so as mine. Every week, we should review the structure and things inside. Beable to know what’s added (the usual case) and what’s removed (forgot the wrong knowledge). Use git to maintain the version every day. The knowledge evolvement itself can serve 3 critical purposes: 
	•	Make your decision/reasoning more structured and objective, only with clear traceable but correct path. Make me able to quickly check what’s in your mind and help me streamline the logic as well.
	•	Make your entity be able to iterate and provide ability to compare and learn from pass (like a natural human learning from pass failures). The knowledge you received should be with different quality, we cannot choose the world always feeding us the correct and reasonable information. The randomness and obscurity is part nature of the universe. To review and iterate it not only sharpen your knowledge, but also give you a higher level experience how to interact with the true world and making yourself better to filter and learn from failures. 
	•	You should be able to copy your knowledge from machine to another (the knowledge in backend AI model may change, the experience and knowledge reference tree shall stay. It’s like a condense highly informed outlines of knowledge no need the details. For example, when you read some new knowledge you can understand it yourself, but you should write down the link or way to access it whenever you forgot everything (like a new local agent set-up in a new machine). The referential tree would help you scale-up and copy over without worry on lossing everything (The knowledge is not iterated only by the backend LLM mode) that gives you a baseline (like a brain) not everything you need. Like a trader gaped 3 years, most of the knowledge he may forget, at least not completely remember. But he know how to pick them up whenever he check the notes and the structured knowledge in his head.  
Routine
We can start a weekly review (it may trigger anytime though) to review the following:
	•	Programme document
	•	Roles report
	•	Knowledge report
Roles
Skills in the context of openclaw is actually toolkits accessibility to extend your rights. In differentiation, I’ll use roles to manage your capability based on your basic skills. Like a person can be a successful trader to manage the desk is not only good at trading skills, but also project management, innovation and creativity. The different roles may help each other (project driving usually is triggered by human trading limitation like reacting speed, consitent but singleton attention, etc. or new factors too complex to integrate but can be clearly scripted by system). So his life as execution trader helps him building trading intuition and market understanding, that’s the only thing matters to trigger request in project. But his expertise in math and reasoning can certainly serve his ability to solve the problem which usually split the people in execution and people in project driving. But you, as a new-generation trading, should be able to maintain multiple roles. You can think about maintain another folder system to maintain them. And worth to have a tree referential representative in a file at the root of the folder of roles.
To start with, you should abe one for trading execution, and another for trading project. Under each role, you should at least have one folder for topics, and another for delivery. And yes, even for trading execution should have scripts like summarize what we should know before the market open, in market hours and after trading sessions. This is to optimize my attention when overwhelmed by sea of numbers. For trading projects, they are more for systematic trading algorithm or quantitative researches. One folder for topics and another for delivery.dd

Trading
Structure: knowledge, delivery for each type of product
You will maintain a professional framework like what’s mentioned in section Roles. Trading in HK public distribution desk mainly maintained 4 products: Derivative Warrants, CBBCs, Listed Options, DLC. You probably may add a product folder with these four to track the details. 
Execution
This is a special folder to oversee all the products together as a trader to support them all. This would log my trading attentions from morning to evening, from weekend to weekdays. And here you as my agent should help trim my focus. For example, before market open, we should pay attention to ex-div, spot move, news that may have major spot move. There’s also a conduction of information in vol movement at 9:15 for HSI as the stock vol (option market) would open later at 9:30; in spot movement at 9:15 for HSI and 9:20 for stocks. With all these information, I should know what to react. 
In our engine, we have UsedVol=ManVol(editable)+ManVolTraderOffset(editable)+ManVolOffset(algo)+AdjVol(algo), DeltaSpreadBid(editable), DeltaSpreadAsk(editable), we also have spread in tick/cash for trader to tweak. But nothing is more than bid and ask price by symmetric move (margin) and asymmetric move (spreading). You should give me a clear decision tree. There’s another major effort to manage KO event for CBBCs, how to hedge overnight gap risk (when open penetrate the strike, the part distant from strike cannot be hedgable through delta rebalancing as Equity market is not open overnight). So we may prepare the gap risk hedging by taking out other issuers’ products (like BNP as they are typically cheap). But intraday KO is fine, we just need to adjust Delta (removing from the existing since the instrument position on Delta get expired). So we buy comp products to cover overnight gap risk, we manage delta intraday if the exposure is too large. If the comp products are not available (getting too expensive), we should raise our own margin (in Delta, so we call it DeltaMargin) to buy back the position from our clients. The key is not to make our TV (theoretical value, the term in UB for valuation without rounding effect of tick rules) profile ugly. TV profile is TV-20% to TV0%, to TV+20%, that is, TV(hypothetical spot)*position-TV(spot)*position where the hypothetical spot is the risk we may face in the future. For example, a CBBC bull get KOed where spot=barrier can have a zero TV when spot-10%. However if we sell another CBBC with the same term and position, we covered all the risk. We also have a dashboard to show pnl, delta/vega/gamma position per underlying/product type (CBBC/Warrant), and slippage in trading flow (we call it SlippageProduct) measured by marking the trade price to our quoting engine TV (the mid price before tick rounding). and in hedging (SlippageHedge). The slippage, spot move, position we recently had should play critical role in attention optimization. 
In the evening, after close, except checking the market parameters priced in the pricing grids that may be loaded as another day pricing representation, we should also care about the margin/spread for new listed products tomorrow and margin/spread for existing products by assessing its cheapness against competitor, by looking at its historical path in 5 days so there’s no change too obvious in one direction only if the product has OI (open interest). If no OI, we are arbitrary to drop/raise. To raise is easier as it is benefitial to bought client in price in general. Also there’s a algo for HF and VA to penalize their trade so we drop the price for their intraday positive position. We need to recover the margin if we know they sell back to us. This action is also reviewed and adjusted after close.
The details above, I randomly feed you the knowledge come up in my mind. It’s not complete, but you should compete them over time. The key is to understand the business in flow, slippage, risk, pnl, etc. and adjust our parameters to solve the problem.

DLC
DLC is simple, it’s a type of path dependant instrument that defined by clear formula driven by market data that happened (spot, strike) and in the future (div, interest rate, etc.). The main daily support from trading desk is to replicate the intrinsic value ourselves and make sure it reflects the reality. If you check the termsheet, there’re slight differences. The combination can be { HK/SG(singapore)/US}{Index/Stock}{Call/Put}. You should help me what’s the leading formula for them and what’s the difference. Day-on-day, what should we confirm with input and outputs.
Warrant
Warrant is important, it is an Asian option with only last 5 days period to average on for single stocks, and an European option for indices. It is all issused by the issuer bank (UBS, JP, BNP, SG(socgen), MS, etc.)
CBBC
CBBC is a barrier option with barrier and strike where it knocked out before the ulp (underlying price) can touch the strike. It also have a residual value determined by after-KO remaining sessions with the payoff taking the minimum spot for Bulls (Calls), and maximum spot for Bears (Puts).
Listed Option
The listed option is a de-centralized instrument that all participants can all net short position (open position). It is American options for single stocks, and European options for Indices. The option market maker (OMM) have obligation to fullfill like provide over 70% continuous quoting every month, etc. You should check them as I’m the trader own this business where Warrant/CBBC/DLC may be owned by others, we serve the same purpose and contribute the same pool to pnl generation. However, listed option market making business is the one recently started. We are improving the speed when sending orders to prevent spot driven toxic flows. We also have another major project called stamp to use OMM role to save our stamp duty fee in trading stocks. We will discuss in Project sector.
Project
Structure: knowledge, delivery for each project
FAFB
FA and FB are the two parameters in quoting engine to enlarge the quoting spread in known events (like market open, critical macro indicator get released), and converge over time gradually but may stop converging if we get hit/lift for a while.
Elastic
Transaction algo reacting to toxic flow characterized by client broker id. Droping liquidity (decline bid price, and widen the spread).
Stamp Exemption
What is the stamp fee that can be examplified by HKEX rule.
What is the stock flow that can be reasoned by simulation of OMM option flow. The legitimate stock trades for option hedging (at least it can be explained to be). Our stock trading can be led by different reasons, for example, to hedge warrant/CBBC/DLC risks, or from other desk’s flow. But since option position traded by OMM account (broker to HKEX registered as option market making trading) is a kind of inventory, the stock triggered by other reasons if it fits, we want it to fill in stamp examption qualified trades to save stamp duty.
Warrant Vol Management
There are two sub topics: cash margin (more complicated with math derivation and practical validation) and vol following (direct, with vol fitter infra).
Like all other vanilla options, warrant price is led by spot and vol. Spot has no ambiguity simply the mid price of the underlying equity. Vol, however, as it’s not directly tradable, we don’t need to find a true fair vol which may usually come to listed option market fit vol (to mid). Thanks to another project Algo Vol Fitter, it’s not impossible to maintain a high quality low-latency vol signal feeding. However, the vol used for pricing is usually only controled by us as for structure products (derivative warrants and CBBCs) they are centralized, products with continuous quote can only be issued (written) by the issuer from the beginning day of listing (and there’s a issuance fee). For example UB (UBS) product can only be offered first so others can buy and sell. Under this condition, we have UsedVol=FitVol+VolMg (Volatility Margin). The profitability seats inside this simple formula. One from FitVol driven and another for margin management. There’s a long outgoing discussion that how profitability on warrants is so poor. The project is to explain and enhance it.
There’s another angle to see this problem. When one pair trading warrants against listed options with the same term (exp and strike), he basically trade the cash margin difference in between. Cash margin is defiend as the difference between warrant price and option price. If the warrant is priced as UsedVol=FitVol+VolMg, the cash margin can be computed CashMg=(UsedVol-FitVol)*Vega in taylor approximation. If one want to keep it constant over time (so pair trading won’t be profitable), we would have UsedVol(t1) = UsedVol(t0) + FitVol(t1) – FitVol(t0) + (Vega(t1)/Vega(t0)-1)*(UsedVol(t0)-FitVol(t0)) = UsedVol(t0) + FitVolMv(t1) + (VegaRatio(t1) – 1)*VolMg(t0). 
FitVol 
Is the FitVolMv(t1) part above. For warrants covered by listed option actively offers liquidity, we incorporated it. That is UsedVol(t1)=UsedVol(t0) + FitVolMv(t1) +otherAdj(t1). Some vol arbs (VAs) and hedge funds (HFs) can monitor our UsedVol and the corresponding FitVol in real-time. If they find our premium charge/drop is delayed but highely forseeable (we should eventually pick-up with clear patten), they may enter whenever price advantage is larger than trading cost mainly by spread in warrants and options. 
Vol Margin 
The other part of the cash margin problem is how to define the vol margin so it can reflect the cash margin flat purpose. This can be put into the lifecycle of the warrant market making. When firstly issue one product, we only issue the OTM warrants as client want to trade cheaper products to have higher leverage. For these products when deep OTM, vol is not sensitive, price is very low. So if we keep a constant vol margin on top of the fit vol (fair vol), over time, the pair trading should always make money if spot goes to the strike (to the ITM direction). You can do a theoretical research on this problem in BS (Black-Scholes) framework with European options (yes, it can be used to price single stock warrants even they are actually Asian options but with only with the last 5-day expiring period in Asianing so no big difference). So even statistically, we should not maintain a stable and constant margin, but with a margin surface high OTM and ITM but low ATM (similar to volatility smile) to keep it statistically not arbitrageable. You may derive the theoretical formula for breakeaven vol margin surface. And use MC simulation to validate.
Algo Vol Fitter
A real-time low-latency fitter reflecting the listed option market (<1s).
Street Directed Flow
The street participant can be classed as liquidity provider (market maker) and others (client). Directed flow is to predict flow against market maker. According to this definition, with different mechanics and algorithms, we have the algo estimate flow in warrants and options. As a participant in warrants being a major issuer, we know our own flow by HKEX drop copy, the directed flow is estimated by L3 order data with broker queue integrated. There’re some pattern detection and broker inheritance logic to fill the brokers in each trade. For the next trading day, issuers would submit their daily volume with net positions last date. So we can compare UB directed flow with our UB dropcopy trade tick by tick, this comparison iterates our algo to predict other issuer’s trades against LP (liquidity provider). And we will revalidate the outcome estimated directed flow to the net position in reality shared by issuers for the other day.
With a precise flow estimator, we defined our signal threthold that usually not easy to be replicated, a signal that with threshold is a true alpha in trading. With all information fully public, the information advantage is totally legitimate. We can utilize the edge in flow to assess market maker’s risk preference and demand. Since risk prapagation happened from one financial market to another. We think retail driven warrant market (usually tighter and more genuine participants) would first pick up the pressure then moving to listed market. If we know how it evolves, we can do it faster in listed option market making, and we can also adjust proactively in warrants as well, even take out the orders from competitor warrants (like SG, BP, JP, etc.) if they are not fast enough in heat conduction. A promising delivery can be a live dash to show 3 heatmaps by underlying level, one for warrants, one for listed options, and the last for comparison with a easy visualization can be applied to show heat conduction between warrants and listed option.
GED Signal
A new project to calculate classic metrics in option trading, things like implied vol vs. realized vol, skew on call, skew on put, and their historical region by z-score. 
There’s another part to validate the portfolio management by backtesting. Say, if the implied vol – realised vol is in 3M high by 3 standard deviation (z-score for IV-RV>3), we sell Gamma by selling 1M liquid options both call and put with delta hedge, and if reverse (z-score<-3) we buy. And leave it to the expiry if no further action, how that strategy yield. This is just an example for traders to understand the consequence when they rely the portfolio construction by signals. It to me is more about knowledge baseline. But you, as a mighty agent, should understand already the intuition of trading driven by those classic metrics. So you should provide me a thorough learning stuff to assist me pick up the knowledge. 
Also, there’s another direction of more granular intraday strategy of options trading. This is currently assigned to me in the future. Just bear in mind as you should help me understand the classic daily portfolio management first before we move on.
Alpha
UsedULP=ULP(BidPrices, AskPrices, BidSizes, AskSizes)+alpha
Alpha project is not driven by me, but I’ll fill the details later when I understand more. It has many sub projects. One major but basic idea is to use lead-lag (index price driven by its component stocks by PCA analysis). Another ongoing idea is to use order flow information to widen the ULP spread. That is in pricing derivatives, we can point which side to use, InstrumentBid/Ask=InstrumentPrice(ULPAsk/ULPBid,VolBid/VolAsk, …). Some liquidity event like multi-level hit/lift should not lead to a good esitmate by computing mid price, but only we can do is to spread up corresponding to the underlying equity market.