Smart investments — modelling Lifetime ISAs with Ethereum smart contracts (part 1)

in #ethereum7 years ago

In the UK, retail investment products focused on retirement are complex. Partly due to the needs of the investor, but also due to years and years of successive governments using pensions as both the carrot and stick.

As one of the oldest and most complex financial markets in the world, the range of pension schemes and retirement vehicles is vast. With the introduction of greater pension freedoms in 2015, the lines between investment and retirement for many have blurred, a concept taken further with the launch of the Lifetime ISA in 2017.


Lifetime ISAs (LISAs) have a few interesting behaviours which lend themselves to being implemented in a smart contract:

  • You can contribute up to £4,000 each tax year
  • The Government tops up your contributions by 25%
  • You can withdraw the money to fund your first house purchase
  • You can withdraw the money after your 60th birthday to fund retirement
  • Any other withdrawal leads to a penalty being applied

Smart contracts offer a way of implementing many of these behaviours, automating them and providing full auditability as part of a distributed ledger.

What is a smart contract?

A blockchain is essentially the distributed ledger. A shared, auditable and reliable record of who owns what, cryptographically secured and validated.

Ethereum is an open source blockchain, which implements the idea of smart contracts within the distributed ledger. A contract is essentially some code, executed by the participants of the network. This effectively makes Ethereum one huge distributed computing platform. Smart contracts can hold tokens on the blockchain, and the code they execute can move the tokens around.

A smart ISA

To model the LISA as a smart contract, imagine that the contrat is deployed by the ISA Provider. To track contributions and each individuals investment, we can simply have a balance of tokens - these tokens can simply be though of as being tied to Sterling for a cash ISA, or units in some mutual fund or investment portfolio for Stocks and Shares.

The Ethereum website has a sample token contract, from which we can make some LISA specific tweaks.

Recording contributions by year

The default token code looks after each individuals balance, but we need to store their contributions by year, prior to any of the bonus being applied.

Contributing to the ISA

When we contribute, two things need to happen:

  • Are we contributing within our allowance (£4,000 per tax year)
  • Add in the Government bonus

A simple contract, applying a contribution limit might look like this:

Once the contract is deployed, we can call our transfer function to represent the investor making a contribution to their ISA:

If we try and contribute too much (over the ISA_LIMIT) then the contract gives us a warning that it will probably fail:

Checking the balance

Once our investor has contributed to their ISA, we can check the balance using the balanceOf call on the front page of the contract.

So what the smart contract provides us, is a simple, convenient and auditable way of inforcing the contract behaviours, on top of which you could build an investment platform or robo-adviser type proposition.

Asset management companies are quickly embracing blockchain and smart contracts as part of their trading and administration infrastructure. JP Morgan have released Quorum, a modified version of the Ethereum blockchain which is better suited for private networks. As the technology evolves, it will be fascinating to see how smart contracts can increase efficiency and transparency in the financial markets.

In part 2 of this series, we'll add a function to withdraw from our ISA, including applying any penalty that may be due.

This post was originally shared on Medium.com with the title Smart investments — modelling the Lifetime ISA with smart contracts (part 1)

Sort:  

Congratulations @jek! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @jek! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.028
BTC 59452.12
ETH 2603.11
USDT 1.00
SBD 2.39