Borrow against idle BTC with fixed term loans - no interest rate changes and no liquidation risks.
$1 trillion in BTC sits idle. Some holders may have lost keys or died but a lot of them would want to borrow against their BTC. The problem is that participating in DeFi usually requires Bitcoin holders to go through a taxable event of selling. A protocol on Sui, named Hashi lets users transfer BTC to a specific address, keep it there and get hBTC tokens representing their BTC.
Nomad Finance builds on top of it by letting these hBTC holders accept fixed-term loan offers by lenders. Since the terms are pre-defined by lenders, the loans have zero risk of liquidation so BTC holders can safely borrow against their Bitcoin without ever having to worry about interest rates changing or price liquidations.
I had never wrote a move smart contract before, but I had created rust programs for solana before so I was able to pick this up easier than expected using Codex with Karpathy-guidelines skill & the Sui-pilot skill.
Basic concepts were standard there were events (similar to EVM), and I had to listen for specific events to ensure that my backend would be up to date, the main source of truth was still the smart contract but for lower latency I decided to use a database.
Since data was only being updated when users created loan offers or accept loans, and I don’t expect a large amount of txs rushing in, I thought using a webhook & event based architecture would work well. I used TypeScript AWS Lambdas connected to inodra.com web hooks (had to pay $49 for access to 5 webhooks) along with a server less database (DynamoDB). In a production environment I would probably create a long running rust service (to handle higher loads), potentially also use SQS for queueing, throttling and dead-letter queues. It was kind of hacked together quickly, but in production a PostgreSQL database would make more sense.
For the frontend, I used the standard React, TypeScript stack, served using AWS Cloudfront and S3.
To manage all the code and infra in one monorepo, I used AWS CDK with TypeScript so one GitHub pipeline would deploy it all (Landing page, app frontend, lambda code & infra changes).
For debugging, like issues with webhook handling, I gave codex access to my AWS CLI as well as the sui client CLI and it could query quickly and find out issues

