Skip to main content
Bankware Global Engineering

Distributed systems, ledger design, financial infrastructure, and protocol engineering.

View all authors

Recording Holding Periods Without a Hard Fork: A Design Review of SecurityToken.sol

· 10 min read
Bankware Global Engineering

Should someone who held a token all month receive the same income as someone who bought it just before settlement? In the previous article, we approached this question through ownership history and time-weighted rights. Recording only the points where balances change lets us reconstruct how much an address held and for how long.

After writing that article, we reopened the code from 2023. The implementation had existed before the formula was written down. SecurityToken.sol in nigo-protocol-v0 is a prototype that uses balance history to calculate income for a specified block range. We could express the idea in a smart contract without a hard fork of the underlying chain. A small calculation makes both its possibilities and its unfinished work easier to see.

Can Rights in Tokenized Securities Be Calculated by Holding Period?

· 13 min read
Bankware Global Engineering

Rent accrues over a month. During that month, the rights to the asset move from C to A, and part of the position moves again to B. When the income is paid, who should receive how much?

One method establishes entitled holders at a single point. Another considers the interests held throughout the period in which income accrues. The right choice depends on the product's terms. Making the asset tradable in smaller tokens does not answer this question by itself.

In 2023, we explored the second approach.

If we record the balance and time whenever a token moves, can we calculate rights from who held how much, and for how long?

Can We Return the MEV Left Behind by a Swap to the User?

· 10 min read
Bankware Global Engineering

In 2022, a DeFi swap could finish in seconds. Its economic effects did not.

A user makes a large swap through an automated market maker (AMM), a trading pool whose reserves determine its price. The reserve ratio moves, opening a price gap against another decentralized exchange (DEX). A searcher, a participant looking for profitable trading opportunities, follows the swap and earns a profit by narrowing that gap. This kind of following trade is called a backrun.

The user bears price impact and gas costs, while someone else receives the arbitrage left behind. At the end of 2022, we began with this question:

Could the arbitrage run inside the user's transaction and return what remains after costs to the user?