Inspiration

I was inspired because I just left my job after working almost 6 years in loan servicing and I saw this hackathon was going on and there was a financial services track. I think there is a really big opportunity to leverage blockchain and move the traditional loan industry towards decentralized finance. To accomplish this we need to demonstrate concrete examples where it would be advantageous to the industry and individual entities to move to use the blockchain. I think a lot of this is going to come through specific entity buy in and companies willing to package this in a very accessible way for businesses to pick up and consumers to understand and interact with on a very high level.

What it does

This app is demonstrating the nuts to bolts origination of an Adjustable Rate Mortgage (ARM) and how that might be originated and serviced on the Ethereum blockchain.

A borrower will originate a loan off chain this asset will be logged by the originator on chain with core data features that need to be tracked on chain with a hash to link to sensitive off chain data (this data may be stored in IPFS or another secure location). Key features of an ARM loan are the starting interest rate, the margin rate, the lifetime cap on interest. Interest is calculated using the Datafeed for CPI data plus the margin to get the new interest. Interest can be set to change on any interval but I have been defaulting to a year on the loans I have been testing.

Most originators of loans do not service the loans themselves, so the rights to service a loan end up with a different servicing entity. This is known as the MSR or mortgage servicing rights, it is possible the MSR holder may even contract a subservicer to service a loan or there may be any sort of complicated splitting of interest and legal duty on a particular asset off chain. Not all of these complexities are accounted for in the application but the basic Originator, MSR holder and Servicer identities are defined.

A servicer will process a borrowers payments onto the blockchain, they will handle adjustments in the ARM rate, they can transfer the loan to another servicer and with a multisig of the originator adjust the rate of the service fee for servicing the loan.

How we built it

To start I built out the smart contract in solidity, I tried to encompass the functionality needed for a basic demonstration without getting to deep into the weeds with it. I deployed a test contract to access the CPI datafeed from the Sepolia test network. After everything was confirmed to be working as I expected I moved to working on the frontend.

I have been really wanting to try building with Svelte since my job was mostly C#, .NET and Blazor so I was excited to try something different and it was really fun to built out with Svelte. I kept the app pretty lightweight, I built out a basic API (in python, express and go) but decided ultimately for the sake of time and focusing on the core of the demo I would just use stores for now. This helped me to focus in on accomplishing what I wanted to with the time I had.

Challenges we ran into

I had some issues with deploying on hardhat so I opted to do most of my contract testing on remix. I was trying to overcomplicate the test data and ended up putting together something simple and straightforward for deploying a test contract for the datafeed.

Learning to work with Svelte and Web3 integration was a challenge but was not too difficult. I used a svelte-web3 library but had issues using that and connecting to the contract so then I opted to use the web3 library and it worked like a charm plus I was able to use resources available to better leverage that library in my development of components and their interactions with the data.

In developing the backend I got really hung up with deploying the API and was running into too many issues for time but this is an area I would like to work with more in the future. I again wanted to try technologies I was a little less familiar with like Go and Express. I ended up making one in python but had issues deploying that and opted to use stores to accomplish a featherweight version of what I envisioned.

Accomplishments that we're proud of

Building this app using an unfamiliar framework I always wanted to build with.

Learning more about chainlink datafeeds and how to develop and deploy my own test feed

Improving my understanding of writing smart contracts and how they work.

What we learned

Everything I have written about up to this line has been part of the learning experience. The culmination of learning more about smart contract building, where chainlink oracles fit in and how it ties into designing a desirable user experience has all made things very clear to me how possible it is to accomplish a web3 transformation in tradfi. And I have learned to better articulate the needs and solutions to industry problems through the lense of blockchain.

What's next for ArmServ

Depending on interest it might turn into a full fledged project. It is likely I may go through some other iterations working with different loan products and types, discussing with people in industry where they might see this fitting in and being useful. It may be good to try and find other people interested or who are already working on tradfi loans and the intersection with blockchain technology to see what I can learn from them and how I can maybe contribute more to any communities working on this.

Built With

Share this project:

Updates