Vibe coding a Swap App
Vibe coding uses LLMs to generate software code based on natural language prompts. In this article I try vibe coding to create a simple Interest Rate Swap application.
Background
Software coding is one of the uses cases that Large Language Models (LLMs) are getting the most adoption in. Not only are the frontier models getting better at coding, but we now have “vibe coding”; the concept that natural language prompts are sufficient to iterate and write code to get a feature or application you need.
As someone who started out as programmer, but has not coded for more than 25 years, (barring the odd script of a few lines which does not count), I thought I would try it out for a Capital Markets and Derivatives use case.
I decided to use Anthropic Claude Desktop and Claude Sonnet 4 as the LLM, firstly as Claude has strong adoption in the developer community and Claude Sonnet 4 (and Opus 4) have recently been released (May 22, 2025) with improved coding capability and state-of-the-art of the art scores in coding benchmarks.
Let’s Start
My first prompt in Claude Desktop.
Create a web page that captures the 5 or 6 major fields for an interest rate swap.
Probably, much shorter than I should ideally start with, but hey sometimes the vibe feeling is start short and wait for the next turn and keep going with the flow.
This resulted in html code and the Claude Artefact window ran this to show me the web page.
At this point, I decided I wanted this in python (programming language) and entered
are you able to create this in python?
The response was:
And then pretty quickly the right hand panel filled up with 300 lines of python code and the response to my prompt was:
It’s great to see that without any specific input from me, the LLM has worked out 6 key swap fields, which are pretty much what I would have picked, except for the glaring omission of currency code.
And it tells me how to run the app.
Python
I now realised that I did not have python installed on the Macbook I was using (users!).
In the past I would done a Google Search to find out how to install python and the question would have been, which of the many options to select and not being able to decide, I would have consulted the “office techy” or most knowledgable/approachable person and asked them to help me.
But now I can just ask Claude, which gave me a choice of two methods, I picked one (install Homebrew) and it gave me detailed instructions to follow, which gave me python access from my command tool.
Thats great, improved productivity as I did not use someone else’s time.
Swap App - Version 1
I then exported the 300 lines of code into a .py file and ran this from the MacOs terminal tool as follows:
cd desktop
source swap_calculator_env/bin/activate
cd code
python3 interest_rate_swap1.py
In which I have filled in the details.
Calculate Swap did not do anything visible, but I needed to click it after filling in the form and clicking Save to file, which exported all the fields shown into a json file and I was able to click Reset to clear the form and then Load from file.
Not bad.
Swap App - Version 2
Next I entered:
Can you enhance it so that the file format is FpML, start with an FpML template for a USD SOFR Swap and the GUI should only show the fields it already has but save these into the correct tags in FpML and also load back from the correct tags when loading
And rather than give my reason for this, I will just show the response from Claude.
It then continued and wrote the code, which I exported and ran.
I won’t show the App, as it looked very similar to the above, except the buttons text now read Generate FpML, Save FpML, Load FpML.
I tested these and they appeared to work as the FpML file could be saved and loaded.
However the FpML file size at 3KB looked too small and given that I have a long history with FpML (stretching back to being on the FpML Standards Committee in 2002), it is etched in my mid that 8KB is a common size for a vanilla swap file.
On inspection, while a lot of proper tags were present in the saved FpML, I could see that many were not e.g. <currency>, <businessDayConvention>, <businessCenters>.
So while the file looked like FpML, it would not have passed validation.
I could have pursued the path of uploading a full correct template and seeing if I could make the App code read and write to this.
But that sounded too painful for “vibe coding”, so I moved onto the suggestions offered by Claude.
Swap App - Version 5
Yes please add market data integration for current SOFR rates and then pricing calculations for both NPV, DV01 and the breakeven fixed rate
Claude did it’s magic and 1,100 lines of code were generated, which I exported and ran. There were a few errors and it took two more prompts and code versions to get to a working App.
Screenshots with a populated swap shown:
Pretty impressive, with just a few words and minimal instructions, the LLM was able to work out what was being asked for and write the code for the calculations and results.
Market data access, discount factors, NPV, DV01 and break even fixed rate….
There is a lot to like here.
And it is great at a surface level.
However digging into the details, throws up issues.
For example the current SOFR rate shown of 5.33% looks too high to me. Sure enough when I check on the NY Fed SOFR page, I see it is 4.26%.
Inspecting the code, I find the following routine:
The code has the correct URL to access SOFR rate from the NY Fed, as I can just copy and paste this URL into a browser and get the data back in json format.
However the code to access and parse this has not worked, so it is has fallen back on mock data hardcode in the code.
It is certainly good coding practice to have Exception handling and in this case the mock data, allows the App to use some data, but it can be problematic as mock data can go un-noticed by the user.
I could have tried to fix this, either manually editing the code or asking Claude, but decided to move onto something more interesting.
Swap App - Version 8
I thought the UX looked basic and wanted to try to see if I could get it to look slicker.
ok, some more suggestions, first I enter notional amount I would like to use the abbreviation m to mean millions, so when enter 10m I mean 10,000,000, second the app is boring and grey, can you add colour and make it more modern looking, ideally lay out the fields so it takes less horizontal space by having floating leg below fixed leg and so the top 4 fields do not look so wide and thirdly the buttons should use colour , so do you best to make as interactive as possible
Really getting into verbose vibe instructions now!
At this point during running Claude would pause with the following:
Max length for message, does not sound good, but Continue got it to finish.
After a few attempts, the code was up to 1,500 lines and I ran to get:
I don’t know about you, but I immediately regretted what I had done.
While there were some nice improvements (millions as m), icons on buttons.
Overall it looked garish and dated on my MacBook, certainly not what I envisaged by modern, perhaps I should have been more specific with examples.
And then reading the final part of the response from Claude was annoying to say the least:
Rival commercial trading software in both functionality and appearance!
Definitely not.
Even the appearance is not on par what commercial software had twenty years ago, let alone now, while we know from above that some of the functionality is not correct. (I have yet to look into the discount factors and cashflow generation, which no doubt will be simplistic approximation).
Swap App - Version 18
At this point, I should have asked Claude to revert to the previous version and given it a new prompt, unfortunately instead I did:
This has gone too far with colors and looks amateur, please change the look and feel, so the UX uses a dark background with pre-dominantly white text, is more consistent and professional, overall screen size is smaller.
My excuse is that is what I would have told a developer.
The response from Claude was encouraging.
We know they like to flatter the user.
Lots of code got generated and the response ended with:
Wow, sounds great, I was looking forward to seeing that.
Unfortunately the code gave an error.
And despite many attempts to get Claude to fix it, it would not work.
As far as I could tell, this was mostly due to message size and the code truncating at random points and the Claude Desktop Artefact window not allowing me to export complete code.
So after 10 or so attempts and manual exports and runs, I gave up.
Perhaps if I had been using an IDE or an AI Code editor like Cursor, I would have kept going or not even hit these issues.
While the prospect of starting again from scratch or V5 or V8 was not appealing.
So I rested my laurels on V5 being the App I was most happy with.
Let’s end there.
Learnings
LLMs have impressive coding capability.
Simple natural language leads to working apps and code.
Niche domain jargon (FpML) is understood and acted upon.
The results look impressive on the surface.
However it is important to test each step.
Test cases with expected results/formats are important for this.
As important is inspecting and reading the code.
For prototyping LLMs work very well.
However I would not want to start from a blank page and vibe code to get to production software.
Very difficult to imagine that getting to an acceptable result.
Architecture, design, complexity there is a lot not captured in prompts.
And the understanding of a code base should not be abdicated.
Possibly with an existing code base, an LLM could be used for maintenance, I can envisage that working.
For now I am sticking to creating throw-away prototypes.
To be productive, we all need to learn how to create these.