Next Article in Journal
Choice of Solutions in the Design of Complex Energy Systems Based on the Analysis of Variants with Interval Weights
Next Article in Special Issue
Blockchain Transaction Fee Forecasting: A Comparison of Machine Learning Methods
Previous Article in Journal
Universities as an External Knowledge Source for Industry: Investigating the Antecedents’ Impact on the Importance Perception of Their Collaboration in Open Innovation Using an Ordinal Regression-Neural Network Approach
Previous Article in Special Issue
Secure Access Control to Data in Off-Chain Storage in Blockchain-Based Consent Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Invoice Discounting Using Kelly Criterion by Automated Market Makers-like Implementations

by
Peplluis R. Esteva
1,2,*,†,
Andrés El-Fakdi
3,†,‡ and
Alberto Ballesteros-Rodríguez
4,5,†
1
Byppay Global SL, 17007 Girona, Spain
2
Centre for Blockchain Technologies, University College London, London WC1E 6BT, UK
3
TECNIO Centre EASY, VICOROB Institute, University of Girona, 17003 Girona, Spain
4
Computer Science Department, University of Alcalá, 28805 Alcalá de Henares, Spain
5
Computing and Artificial Intelligence Laboratory (CAILab), Camilo José Cela University, 28692 Madrid, Spain
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Serra Húnter Fellow.
Mathematics 2023, 11(7), 1673; https://doi.org/10.3390/math11071673
Submission received: 18 February 2023 / Revised: 21 March 2023 / Accepted: 28 March 2023 / Published: 30 March 2023
(This article belongs to the Special Issue Advances in Blockchain Technology)

Abstract

:
Funding shortages are a persistent issue, particularly for small and medium-sized enterprises (SMEs), and the problem tends to worsen cyclically. The market for factoring and invoice discounting aims to address delays in payment for commercial invoices. These involves sellers present unpaid invoices to financial organizations, typically banks, who provide an advance payment. The implementations of the factoring services without intermediaries in blockchain of the state of the art are all based on the publication on-chain of all the invoices, use know your customer (KYC) mechanisms, and over-collateralize the invoices. This article proposes a new, decentralized approach to lending services that completely eliminates intermediaries and does not require strong KYC, yet it is reasonably resilient. The approach uses liquidity pools and associated heuristics to create a model of risk compensation. In this model, a formula measures the contributed collateral to an invoice and the risk of a late invoice or non-payment, using the Kelly criterion to calculate the optimal premium for funding said invoice in the liquidity pool. The algorithm’s performance is tested in many scenarios involving several invoice amounts, collaterals, payment delays, and non-payment rates. The study also examines premium distribution policies and hack scenarios involving bogus, non-payable invoices. The outcome is a decentralized market that uses the Kelly criterion and is reasonably resilient to a wide range of invoicing scenarios, including 5% non-payment rates and 10% bogus invoices, yet provides a sound profit to liquidity providers. The algorithm’s resilience is enhanced by several premium distribution policies over partially collateralized invoices from 50 to 70%, resulting in optimal premium withdrawal policies every 30 days, making it the first protocol for loanable funds that does not require over-collateralization to be profitable and resilient.

1. Introduction

It is important to study how to improve funding of companies, as [1] exposed a strong positive relationship between access to finance and job growth. Overall, firms with access to a loan exhibit employment growth between 1 to 3 percentage points larger than firms with no access to finance. In the case of SME (Small and Medium Enterprises), they are the top job creators, but they suffer from a lack of funding and late payments to their invoices. No wonder the global market of invoice discounting will grow at a steady rate over the next few years [2]. Invoice discounting represents 10% of banks’ provided credit, a major source of working capital finance globally [3]. It seems it will become even greater in the next crisis, due to their cyclical nature. In particular, invoice discounting is an effective way to help companies troubled by late payments (when invoices are paid in one to three months). Over the recent decades, in the European Union alone, the factoring market has surpassed loans and other forms of funding [3]. Moreover, invoice discounting has another benefit, in that the customer (debtor) is not informed that the supplier (creditor) is being financed. From the suppliers’ point of view, this confidentiality is good for easing negotiations, as they hide the weakness of using working capital finance.
According to [4], small companies in the financial market are not being adequately served, despite the recognition that this market has the potential to meet their liquidity needs. The difficulty lies in assessing the authenticity of the parties involved in the invoice marketplace and determining whether an invoice has already been factored. These challenges make it easy for fraudulent activities, such as double pledging or selling non-existent invoices, to take place. Such fraudulent practices can cause problems for buyers who may be contacted by fraudulent factors demanding payments for invoices that have already been factored by legitimate sellers. Moreover, even in the absence of fraud, paying the invoice to the wrong organization can lead to several problems.
A possible solution to this problem could be a centralized system where all invoices could be stored and verified by interested parties. However, despite the factoring market’s existence for centuries, no such entities have emerged due to the need for confidentiality. Buyers, factors, and sellers are reluctant to share information about past invoices, as disclosing them can work against you for a number of reasons. The study presented in [4] proposes a third-party solution to address the shortcomings of centralized systems. As mentioned in [5], preventing an invoice from being factored twice is a crucial feature of a factoring system. Blockchain technology has the potential to revolutionize various financial processes such as inter-company transactions, procure-to-pay, order-to-cash, rebates, warranties, and financing (including trade finance, letters of credit, and invoice factoring). Recent surveys such as [6,7,8,9,10] suggest that wherever paper-based systems are prevalent, blockchain can offer a promising alternative.

1.1. Invoice Discounting and Factoring

Invoice discounting provides the advantage of accelerating cash flow from customers to suppliers, as suppliers receive advance payments from the bank rather than waiting for customer payment. This allows businesses to invest in growth and expansion. However, faster invoice discounting services need to be provided while preventing double spending and minimizing risk. Blockchain frameworks have the potential to address these issues and transform the invoice discounting process by providing increased transparency and reducing risk for all parties involved, including suppliers, customers, and financial institutions.
Factoring is a financial transaction where a business sells its accounts receivable (i.e., invoices) to a third party at a discount to meet its immediate cash needs. Factoring faces issues related to inter-mediation and trade finance and supply chain, where decentralized finances offer potential solutions. Several studies [11,12,13,14,15] have explored promising approaches to tackle these challenges.
This paper aims to delve into novel alternative approaches to invoice discounting or factoring by radically decentralizing how invoices are utilized. Instead of storing all invoices on a ledger, we plan to develop solutions that leverage algorithms implemented as dApps or smart contracts to score companies, decentralize crowd funding, and introduce byppay, a new solution to invoice compensation with debt-soothing effects. Our approach will only declare invoices related to the clients and suppliers of an actor on a ledger, using a full mechanism of Proof of Existence (PoE). The inherent benefits of such a decentralized approach to invoice compensation are bolstered, as discussed in [12,16].

1.2. State of the Art of Blockchain for Funding

Discounters can benefit from decentralization and the adoption of blockchain in several ways [17,18,19]. Firstly, there is an immutable and time-stamped record of every invoice emitted by a company, including the debtor’s receipt and verification against which a discounter would fund. As a result, the overall invoice discounting process is streamlined. Secondly, the trust and security mechanisms of blockchain enable the elimination of on-site audits of receivables, debtors, notification, and month-end reconciliation processes. Additionally, blockchain facilitates fast and cost-effective value transfer, particularly for cross-border payments [20].
Furthermore, the debtor’s verification of invoice validity and receipt of goods and services significantly reduces the risk of dispute and non-payment. The debtor also has an incentive to acknowledge and confirm invoices promptly, since their confirmation record is visible to their suppliers on the blockchain, which can influence payment terms and contract prices. Moreover, blockchain technology’s immutable nature helps to prevent invoice fraud by eliminating the consensus for double invoicing transactions. Finally, time stamping an invoice has legal value, protecting the first assignee from subsequent assignees who try to assign the same invoice more than once without notice, thereby safeguarding the assignee’s value.

1.3. Proof of Existence

The paper cited in [2] presented evidence suggesting that the adoption of distributed ledger-based approaches could enhance the invoice discounting service. However, in our view, the current approaches, using blockchain, remain centralized in nature, relying on a full declaration of invoices made available online for graph analysis. We propose a different approach: a bottom-up, agent-based implementation that is more suitable for decentralized implementation and which fits pretty well with Blockchain/Distributed Ledger Technologies (DLTs).
Distributed intelligence algorithms and multi-agent paradigms require a proper framework that the computing and ledger possibilities of DLT platforms such as Ethereum or Polygon, Polkadot, BitcoinSV, and Binance Smart Chain, among others, are ideal for developing such intelligence. Many distributed bottom-up behaviors and strategies are open for research, including coalition formation techniques and distributed autonomous organizations that require the proper platforms and environments to develop fully. Actors such as [21] that use the BitcoinSV platform or [22] that use blockchain to enhance the PoE.

1.4. On Collateral

Our solution requires no third parties and no collateral (but invoices are the basic asset) and is anti-cyclical, similarly to the complementary currencies such as WIR Bank (https://www.wir.ch, accessed on 15 September 2022) [23]. In fact, currencies are the oldest information system of humanity, and today we have the means to create a new information systems using new forms of payment that will complete the strength of the currencies.
However, using collateral and liquidity pools will indeed boost the invoice discounting, factoring or byppay adoption. Thus, this project covers the areas of distributing intelligence with a DLT, and adopts new DeFi (Decentralized Finances) to cover risks or enhance liquidity of the invoices as assets, real-world assets, which are tokenized on a ledger. Instead of transacting with a counterparty, following the logic of conventional financial operations, DeFi users interact with software programs that pool the resources of other DeFi users [24].
The DeFi implementation is backed by the ideas of value in the Internet of Value (IoV), where tokenized invoices back the value and their rights are traded among peers (invoices as a type of real assets as considered in [8]). With the proposed implementation of collateral, some of the IoV systemic risks are solved, remarkably the over-collateralization will not be necessary, as stated in our contributions to the recent reports of [9,25].

1.5. Liquidity Pools

Regarding liquidity pools for crowd funding of factoring, there are decentralized Protocols for Loanable Funds (PLF) that enable users to borrow or lend digital assets [26,27,28]. Automated smart contracts act as intermediaries by locking the assets deposited by the lender and providing borrowers with liquidity in exchange for collateral. These smart contracts are also known as Lending Pools [29]. In the state of the art, Lending Pools lock a pair of tokens, a loanable token, and a collateral token. Lenders earn interest rates based on the supply and demand of the provided liquidity. However, as there is no guarantee of repayment, borrowers must over-collateralize their position. Additionally, when returning the borrowed amount, the borrowers must pay an interest rate, which is proportionally divided among the lenders and the governance token. Furthermore, borrowers will be charged an extra fee when they are liquidated [26].
Figure 1 shows a graphic schematic of the process. Starting from the left, Lenders deposit their crypto-assets, such as Ethereum, to earn additional profits. They receive a wrapped token or IOU from the PLF as proof of their deposit. The smart contract acts as a middleman and manages the deposited assets, loans, and liquidations. Borrowers are required to deposit collateral before obtaining a loan. At the end of the loan term, the borrower is obligated to return the borrowed amount plus an interest rate. This interest rate is split pro rata among all lenders, while the remaining interest generated is revenue for the PLF.
Table 1 presents a comparison between DLF and other DeFi protocols such as Decentralized Exchanges and and Yield Aggregators.

1.6. From Over-Collateralization to Risk Appraisal

The current initiatives involve liquidity pools and related DeFi implementations, where any tokenized asset (i.e., insurances, factoring, lending, guaranties of service, and more) is backed by collateral in the search of collateralizing the risk, by means of any of the new digital assets or virtual currencies [25]. Their drawback lies in the over-collateralization, and the volatility caused by new forms of inter-dependency at an unprecedented level is a systemic risk in the future internet of value.
In our opinion, the over-collateralization does not fit properly with invoices risk management, as they are assets with value already appraised in a currency and their risk is related to their liquidity. The euros that will be paid through an invoice are a sort of a stable coin—invoice-euro, for example—so the conversion invoice-euro is pegged to the euro at a discount; say 0.5, 1, or 2 percent or more according to the mora or invoice non-payment rates. It is not a monetary risk, nor a crazy market valuation, but pure risk management that is well known in financial markets which use sophisticated tools.
Unlike the solutions of liquidity pools in the state of the art that use crowd source and oracle approaches to rate risk, we look for alternative formulas that appraise the risk in a fully automated way.
In this reality, there is room to study partly collateralized invoices novel mechanisms using risk management tools that are worthy of exploration and creation in a decentralized implementation that should avoid over-collateralization. These techniques, including the Black–Scholes or the Kelly Criterion [30], are currently studied for their implementation in risk appraisal and management. The work proposed here is interested in the Kelly Criterion for calculating the optimal diversification of investments for creating a portfolio, given a volume of money available for investment, and given some known risk, as it forecasts the optimal benefit achievable.
In the case of decentralized markets with liquidity pools for invoices, provided that we know the volume of money in advance, because it is the liquidity pool’s amount of money, we chose to reformulate the Kelly Criterion so that one might decide whether a given invoice that is partly collateralized can be accepted to be fully collateralized by the liquidity pool, and at what benefit to collect from to compensate the risk. This benefit will be the premium required as a fee for every invoice accepted in the liquidity pool. As this is a new usage of the Kelly Criterion, we named it the Reverse Kelly Criterion as a new formula that calculates the premium to be granted given an invoice with some collateral, as we will see in the following section containing all the details. So this is the goal of our paper: to invent a resilient PLF mechanism that does not require over-collateralization. Let us see how we can do it.

2. Reverse Kelly AMM (rkAMM) Design

Electronic markets use algorithms that decide the price and the amount of liquidity supplied in markets. However, this automation is not complete, as algorithms are managed by humans who intervene to improve their design, or turn them off entirely if conditions become unfavorable, leading to liquidity withdrawals that can exacerbate market volatility. Instead, an Automated Market Maker (AMM) is a type of market that employs a single algorithm to facilitate trades. It is a straightforward, fixed, and predictable approach [31]. AMMs use a constant product rule to swap assets: the product of the reserves of the two assets must remain the same before and after any currency exchange or swap occurs. This concept of holding the value of a function, such as the product of asset reserves during exchanges, evolved into the concept of constant function market making. The fundamental design of constant function market makers was established in [32]. Then, a simple formula, x · y = k , set prices and quantities for thousands of different assets using few hundreds lines of code. The AMM today [31] executes upwards of USD 50bn per month in digital assets. The most popular AMM, Uniswap, uses a year of data acquired directly from the public Ethereum blockchain containing over 39 million transactions.
In an AMM, anyone can become a Liquidity Provider (LP) by transferring their digital assets to pools. Fund liquidity can be increased, thus increasing the pool size or creating new ones. In exchange, they receive revenue from a fixed fee on trades (called swaps) by those who demand liquidity from the AMM. Fee revenue is shared equally among LPs in proportion to their investment—so LP returns vary based on the amount of liquidity in a pool (or the pool’s volume or size). LPs can only add or remove liquidity, and prices are set by the AMM algorithm, unlike traditional market makers that can also vary in terms of prices [31].
An algorithm has been conceived following the main guidelines of an AMM for the full collateralization of invoices. As previously stated, AMM were designed to trade two assets by their balance x and y in a liquidity pool to keep up a constant k, as x · y = k , so that incoming x means withdrawing y to keep the x · y constant at k. There are several variants of the same scheme [33] to add resilience and utility to the AMM implementation, which must follow their axioms.
In our implementation, we also have liquidity providers that contribute and withdraw their funds at a fee, so that the liquidity pool has some volume V to grant the remaining collateral demanded by the invoices to become fully funded, and premium is required in exchange to compensate the risk aiming at some benefit. From this point of view, it works as a standard community fund for securing risk of participants, but with liquidity providers instead and securing particular assets, such as invoices, that are backed by some collateral. Thus, collateral c 1 is added to the pool along with the premium p and, in exchange, the remaining collateral c 2 exits, V · p = k ( V ) , meaning that the constant k is recalculated by the Kelly criterion. Thus, k changes with the new liquidity volume V, and thus with the premium collected.
As briefly introduced, we use the Kelly criterion to calculate the premium contribution to the liquidity pool for missing collateral for a 100% backing invoice, after acknowledging that it is partially backed by some collateral. It is named rkAMM: Reverse Kelly AMM. Performance curves for the rkAMM have been simulated with streams of hundreds of invoices and subsequently analyzed. In its implementation, we have considered the minting of NFTs with the inclusion of terms such as “backing %” of the invoices, risk, and elaboration, which are useful for applying the Kelly Criterion investment formula, among other considerations.
We assumed that for an invoice of amount X, the collateral q is a percentage of X, and the remaining non-collateralized amount is p = 1 q . We will show how these assumptions have been worked out in the rkAMM.
The Kelly criterion, sometimes referred to as the Kelly strategy or Kelly bet, is a mathematical formula that determines the optimal size for a bet when the expected returns are known. It involves maximizing the expected value of the logarithm of wealth or expected geometric growth rate, as described in [30]. Due to its ability to produce higher wealth compared to any other strategy in the long run (when the number of bets can be infinite), the criterion is also known as the scientific gambling method. The formula has been practically demonstrated in gambling and used to explain diversification in investment management. Rediscovered for its usage in multiple portfolios [34], in the case of digital assets, it was proposed to be used today for risk assessment of derivative products [35]. Here, we saw the opportunity to use the Kelly criterion for “assessing” the liquidity pools for invoice funding.
We use the Kelly criterion to calculate how much premium should be required to contribute to a liquidity pool of size V for an invoice amount of X with a collateral of p, thus demanding the remaining q = 1 p collateral out of the rkAMM, as depicted in Figure 2.
We plan to use the rkAMM connected to Byppay [36] because byppay is a system that curates invoices in the sense that groups of three companies acknowledge each other’s rights (invoices) and swap the rights among players to compensate said invoices. Whenever a Byppay among three companies A, B, and C is created, where C invoiced B and B invoiced A so that the chain of payments happened to be from A to B and B to C, schematically A > B > C. In a byppay A > C, that means that A pays directly to C and compensates the A > B and B > C payments. The Proof of Existence (PoE) of the invoices involved in the Byppay considers the mutual knowledge among A and C through B, the common acquaintance of A and C. This PoE and A rating must be sufficient for most of the Byppay cases that require no early payments. This Byppay flow is shown in Figure 3.
If the Byppay is open to third parties other than A, B, and C, then some collateral might be required to B to enhance the PoE and stake of the AB invoice, and the collateralization flow might let the door open to third parties that trust B, or trust A, or trust both, to add collateral to that invoice, privately or openly as a marketplace.
Everyone contributing with collateral will receive some fees; say, a 2% fee out of his piece of contribution to the collateral of the invoices being byppaid. Invoices will be paid some time later, usually in one to three months on average; therefore, the contributed collateral pays off an annual percentage yield (APY) average of 8% to 24%. Contributors of collateral will have advance knowledge of the due date of the invoices to calculate their benefits. Additionally, the greater the connection and knowledge of A and B, the more oracles they would need to rate/score companies, which might fit well on this stage of the byppay flow.
The byppayable invoices with strong collateralization (say, from 50% collateral) are eligible for the rkAMM, and the C will secure the remaining collateral by means of premium to be contributed to said liquidity pool, and then C will receive the full AB amount in advance, while the full amount of the AB invoice will be paid by A to the liquidity pool on the due date.
Whenever A pays, all collateral from the marketplace is returned to the liquidity providers with an additional 2%, and the rkAMM liquidity pool retrieves the collateral provided again with an additional 2%, while B obtains the collateral he might have contributed at the 2% extra, deductible from the fees and bonuses that could have released for the entire Byppay process.

2.1. rkAMM Definition

As introduced, a model inspired by an AMM is proposed to automatically comply with invoice compensation. It is an underlying protocol to conduct exchanges in a decentralized manner through an autonomous trading mechanism. This allows users to exchange their assets without involving centralized financial authorities. Kelly’s formula risk assessment criteria will be used.
The following two assets will be considered:
  • The reserve for collateral allocated in the AMM as a liquidity pool, known as Q.
  • The reserve of premium collected in the AMM, known as P r e m i u m .
The collateral serves as a liquidity asset used to complete the compensation of invoices to pay while, in general terms, the premium serves as a protection mechanism of the AMM against the loss of lent collateral and, hopefully, some benefit. Thus, the premium is considered the amount to be paid based on the risk the AMM assumes when lending collateral.
These assets (Q and P r e m i u m ) are exchanged among agents by interacting with the AMM. Agents withdraw liquidity Q at a premium P to compensate the non-collateralized amount of their invoices. This premium contributed by agents is used to compensate the losses the AMM may experience during its operation. The steady remaining premium will be the benefit attributed to the intrinsic performance of the AMM. Additionally, the liquidity providers are enabled to deposit liquidity into the AMM, which allows them to receive a proportional profit out of the accumulated premium based on their shares on the AMM liquidity pool Q according to proposals of [37]. Different premium withdrawal policies and periods are discussed in later sections.
P r o f i t P r e m i u m = C o l l e c t e d P r e m i u m C o l l a t e r a l U n p a i d I n v o i c e s
In case there is no liquidity available to collateralize an invoice, the AMM will cover the collateralization of the invoice with the premium collected. Once invoices are fully paid, the remaining premium as profit is expected to be withdrawn in different percentages and periods that will be decided in this paper after several simulations to seek the best withdrawal policy.

2.2. rkAMM Formula

Let us explain the formula of collateral and premium exchanges. To do this, we start with Kelly’s investment formula (Equation (1)):
f = p a q b
The following assumptions are made:
  • f is the ratio between the amount of collateral requested and the total volume of the rkAMM. The total volume of the rkAMM is computed as the sum of the available collateral Q and, eventually, the accumulated premium at the time.
  • p is the collateralized percentage of an invoice. We chose that p is the probability of the invoice to be paid.
  • q is the non-collateralized percentage of an invoice amount. We assumed that q is the probability of the invoice to be unpaid.
  • a = q given that q is the lack of collateral of an invoice to be fully collateralized by the rkAMM, we interpreted it as the amount of money that could be lost; that is, a, which is known as the partial loss in Kelly’s investment formula.
  • From the above: p = 1 q
  • b in Kelly’s investment formula is defined as the partial win. We interpreted this value as the ratio between potential profit and potential loss.
Simplifying the Equation (1) using the assumptions above:
f = 1 q q q b
For our purpose, the variable to clear is b, which is the ratio of potential profit and potential loss. Thus, solving b from Equation (2):
b = q 2 1 q ( f + 1 )
The good news is that, in an invoice, the ratio f and probabilities p and q are always known.
f = N o n C o l l a t e r a l i z e d A m o u n t V o l u m e r k A M M = q · I n v o i c e T o t a l A m o u n t V o l u m e r k A M M
The potential loss is known, since it is the amount of collateral that the rkAMM lends to the user, which is equal to the non-collateralized amount. Then, the potential profit is what we have called the p r e m i u m . So far, all the variables are known, except for the p r e m i u m .
The variable to clear is the potential profit, which is the premium, since it is the amount the rkAMM can earn if the user repays the collateral and the invoice in full. That is why it is a potential profit, because the rkAMM is assuming a risk based on an amount, which is compensated by a premium, which will not be repaid but kept for the collateral and liquidity providers who assumed the risk.
So, we can formulate the following equation of b, whose value is known from solving Equation (3):
b = P o t e n t i a l P r o f i t P o t e n t i a l L o s s = P r e m i u m q · I n v o i c e T o t a l A m o u n t
Clearing the p r e m i u m variable:
P r e m i u m = b · q · I n v o i c e T o t a l A m o u n t
In summary, we have the following values on Equation (6):
  • p r e m i u m : variable to calculate.
  • b: calculated from Equation (3) since f and q are known.
  • q: known since it is the amount to be collateralized.
  • I n v o i c e T o t a l A m o u n t : known as an invoice parameter.

2.3. Illustrative Example

Firs, the rkAMM initial condition is presented in Table 2.
Then, an invoice that has a p collateral and is demanding q over the total amount is applying for the rkAMM service. This scenario is contemplated in Table 3.
Using Equation (4), the value of f is:
f = N o n C o l l a t e r a l i z e d A m o u n t V o l u m e r k A M M = 800 1800 = 0.444 . . .
Since q · I n v o i c e T o t a l A m o u n t = N o n C o l l a t e r a l i z e d A m o u n t .
Then, from Equation (3), the value of b is:
b = q 2 1 q ( f + 1 ) = 0 . 4 2 1 0.4 ( 0.444 + 1 ) = 0.3789 37.89 %
Recall that q · I n v o i c e T o t a l A m o u n t is proportional but essentially different from q because with p, q, and b and a, we are working with probabilities and ratios.
From Equation (5), we have:
b = P o t e n t i a l P r o f i t P o t e n t i a l L o s s = P r e m i u m q · I n v o i c e T o t a l A m o u n t = P r e m i u m 800 = 0.3789
Clearing premium from the previous equation as in Equation (6):
P r e m i u m = 800 · 0.3789 = 303.16 ( euro )
Finally, the rkAMM goes on as follows and the intermediate situation can be seen in Table 4.
At this point, collateral is withdrawn from the pool and p r e m i u m has been deposited. What will happen if the payer does not repay the invoice will be matter of study with several scenarios that will be covered in the next section.
So, following this example, at some point, the user or his client will repay the collateral, which is EUR 800. Finally, the rkAMM situation is shown in Table 5:
The rkAMM has made a profit because it has assumed the risk by supporting the non-collateralized amount of the invoice for some time in between the collateral provided by the rkAMM; the collateral is later repaid at the invoice due date, sooner or later.

3. Simulations Setup

A set of simulations have been developed based on five scenarios to study typical situations that may occur. Invoices used in the scenarios have the structure shown in Table 6:
Key attributes such as invoice amounts or the percentages of collateral or nonpayment are modified at each scenario to analyze the behavior of the rkAMM. The complete set of attributes used to simulate the scenarios is shown in Table 7.
In this research, neither predictive nor classification models are used, since the rkAMM does not need to predict future behavior of invoice sets and does not need to classify them. Simulations only intend to study the final outcome of the rkAMM based on sets of invoices generated randomly through uniform distribution.
At every scenario, many sets (from 100 sets) of invoices are generated to obtain solid statistical ground.

3.1. Scenarios

The five scenarios for the simulations are:
Scenario 1—Here, we experiment with the growing contribution of collateral by liquidity providers (LP) on a growing rate of the volume of collateral (Q) in the rkAMM, in the pool. As the Probability of Contribution is fixed at 50% every day, the Range of Liquidity contribution is being experimented in three conditions: 1% of initial Q at every contribution for scenario 1.1 (Very Low), 5% of initial Q for case 1.2 (Low), 10% of initial Q for case 1.3 (Medium), and 25% of initial Q for case 1.4 (Max).
Scenario 2—Here, we experiment with sets of non-payments back to the rkAMM. The attribute changed in this scenario is the non-payment probability, in three cases: 2% of invoices for case 2.1 (Low), 5% for case 2.2 (Medium), and 20% for case 2.3 (Max).
Scenario 3—Here, we experiment with Increasing Delay in invoice payments. The payment period ranges from what is considered short to long. Payment period ranges are: 30–60 days for case 3.1 (Short), 60–90 days for case 3.2 (Medium), and 90–120 days for case 3.3 (Long).
Scenario 4—Here, we experiment with the A m o u n t to be collateralized, which will depend on a variable percentage of the initial volume of collateral ( Q 0 ) in the rkAMM. The Demanded collateral to the pool is in three cases: 1% of initial Q 0 for case 4.1 (Low), 10% of initial Q 0 for case 4.2 (Medium), and 25% of initial Q 0 for case 4.3 (Max).
Scenario 5—Different % to be collateralized. This is slightly different from scenario 4, as here, we work with the percentage only and not with the amount to be collateralized. Although they are, of course, directly related, the sensitivity of the pool to the amount of collateral comes out with different outputs. The range of % collateral p of invoices is set to three cases. Range of % collateral p: 55% for case 5.1 (Low), 75% for case 5.2 (Medium), and 90% for case 5.3 (Max).
In addition to the scenarios proposed above, there is an additional set consisting of those situations in which there are malicious actors trying to take advantage of the rkAMM operation. These scenarios foresee a hack of the rkAMM; that is, there is a high number of false, bogus invoices. A false invoice is considered one for which the collateral given away by the rkAMM will never be paid back. The purpose of this hack from the attacker’s point of view is to drain the rkAMM liquidity.
Hack scenario—To hack the rkAMM, the following attributes from the default scenario are modified to produce a set of hacking cases:
  • Range of % from invoices to collateralize: 49% (Max), 30% (Medium), and 10% (Low)
  • Non-payment probability: 10% (Low), 50% (Medium), and 100% (Max) crossed with all the ranges of % from invoices to collateralize.

3.2. Technical Description of the Simulator

The simulator has been developed in Python. For the analysis and presentation of the experiment metrics, common analysis and data visualization libraries have been used.
The invoices have been structured in a list of dictionaries to execute the simulations. Each invoice is defined by a dictionary of seven keys and values, and this dictionary in turn occupies a position in a list of invoices.
Regarding the functions of the simulation, those that allow modification of the volumes of liquidity, collateral, and premium have been defined. In addition, a function has been developed to calculate the premium based on the requested collateral, as explained in Section 2.2 of this document.
To implement the simulation, there is a main function that randomly generates a set of invoices based on the previously defined parameters in Table 6. The flow of invoices is steady at one invoice per day of any random amount and collateral within the range of parameters described for the simulations in Table 7. When they are accepted in the liquidity pool, then premium is contributed, and collateral is withdrawn on the same day. Otherwise, when they are not accepted, they are simply discarded, and the next day comes for the next invoice.
The simulation also performs daily synchronization of the liquidity contributions of random amounts in the range established by the parameters. The invoices that are repaid achieve this with a random day within a minimum number of days (often 30 days are chosen) and a maximum of 120 days. On the other hand, invoices that are not repaid are programmed for a delay large enough for a due date well after the simulation, with a maximum delay of 100,000, since Python 3 int does not have a maximum size and using math.inf may impact the efficiency of our code.
Then, the number of days for each simulation is the number of the stream of invoices (one invoice per day), plus the maximum delay of 120 days and an additional number of few extra days. For instance, for a stream of 500 invoices, a maximum delay of 120 days, and 30 extra days, the limit is 500 + 120 + 30 = 650 days per simulation.
Every scenario is defined by the parameters mentioned in Table 7. A batch of 100 simulations per scenario are run; thus, the metrics are calculated as an average per batch.
To simulate several scenarios of unpaid invoices, a random number of invoices will be chosen not to be repaid, so that they pay the premium to be accepted in the rkAMM and obtain collateral that is, however, never returned to the rkAMM. The rkAMM will try to compensate the losses by means of the premium, and we will see how resilient it is at the end of the run of all simulations.
The rkAMM also contemplates the possibility of withdrawing the premium collected: the withdrawal period and the premium percentage to be withdrawn can be set up.
Last, but not least, the hack of the system, consisting of extenuating the rkAMM by a flow of bogus invoices, is intentionally left unpaid. This is achieved by increasing the hack probability that is directly proportional to the non-payment probability of invoices.

3.3. Repository of the rkAMM

There is a GitHub repository (https://github.com/ballesterosbr/rkAMM, last access on 7 February 2023) of the rkAMM for running and testing the simulations.

4. Results

Several batches of simulations of the behavior of the rkAMM based on the scenarios defined in Section 3.1 of this document were performed. Each batch is a case in a scenario, and performances will be analyzed. The plots of the liquidity and the premium will be presented for the most relevant scenarios.

4.1. Limitations

As stated, in the event that the rkAMM does not have liquidity nor premium to collateralize an invoice, this invoice is discarded, a day passes through, and the next invoice will be evaluated. When the rkAMM regains the collateral granted to a former collateralized invoice or the amount to be collateralized for a new invoice is less than the available liquidity in the rkAMM, the invoice might be granted for collateralization.
In the simulations, the profit percentage shows the result of the rkAMM. This benefit will be distributed among those LPs that have deposited liquidity into the rkAMM, so it is expected that this will have an impact on the rkAMM profit.
After inspecting the scenarios, our proposal of the rkAMM implies that the invoice percentage to collateralize is advised to never be greater than 49% or lower than 5%.

4.2. Metrics

A set of metrics is defined to describe the behavior of the rkAMM and analyse the results of the simulations: plots of the volume of the rkAMM, the premium collected, the premium withdrawn, and the resulting liquidity as an addition of the volume and the remaining premium. To better understand the metrics, Table 8 shows an example. At the end of a batch of 100 simulations of the three cases of scenario 5, we have the averaged measures.
The set of Table 9, Table 10, Table 11, Table 12, Table 13 and Table 14 show results for all scenarios, which will be discussed in the next section. The result plots are also presented for a better understanding of the results. To avoid overloading this section and to facilitate reading, only the plots from scenario 5 with a Premium withdrawal period of 30 days are presented, since it is considered the most relevant and frequent scenario to occur in the rkAMM deployment. The plots for the other scenarios are summarized in the Appendix A section. The results on mean average over a 100 runs batch per every case and scenario are less than 0.7% standard error on the rkAMM profit measure. We think this is reasonably sound for backing the conclusions over the discussion of the results.
In addition to the scenarios results of the tables presented above and the curves from scenario 5 shown in Figure 4, in the following Figure 5 and Figure 6, there is a comparative analysis of the rkAMM profit of all the scenarios. Figure 5 shows a comparison between the rkAMM profit when there is no premium withdrawal, and when there is premium withdrawn but, depending on the frequency, the premium is withdrawn. Figure 6 shows the rkAMM percentage of profit difference between scenarios in which the premium is withdrawn and where it is not. Premium withdrawal intervals are 1, 30 and 90 days.
One can see that the rkAMM profit is not affected by the premium withdrawal in the majority of the scenarios. It can even be concluded that the frequency with which the premium is withdrawn does not have a significant impact either, except for the scenarios in which the premium is withdrawn every day.
Surprisingly, only the daily premium withdrawal causes the rkAMM profit to be only a few points lower than the rkAMM profit when there is no premium withdrawal, while in the other scenarios with lower frequency (of +30 days), even the performance is boosted in some cases.
Figure 7 shows the overall profit of rkAMM taking into account all possible scenarios and premium withdrawal periods.
As in the other scenarios, besides the hack scenarios tables, Figure 8 illustrates the curves of that simulation. Figure 9 shows that practically one-third of the scenarios is affected to a greater extent by the premium withdrawal, and therefore the rkAMM profit is altered. Further, this impact turns out to be positive and the performance of the AMM for this set of scenarios is better when premium is withdrawn periodically, especially with invoices collateralized at 51%. The best cases are those in which the invoices are collateralized at 51%, although the rkAMM profit decreases as the hack probability increases.
As for the percentage difference with respect to withdrawing premium or not shown in Figure 10, the scenarios in which premium is withdrawn every 30 days with 51% collateralized invoices present an improvement of 5%, 89% and 249% with hacking probabilities of 10%, 50%, and 100%, respectively. Regarding daily withdrawals, the only favorable case is found when invoices are collateralized at 51% with a hacking probability of 10%. Finally, for premium withdrawals every 90 days, the most remarkable case is that in which invoices are collateralized at 51%, with a hack probability of 50%. The rest of the scenarios have presented a worse performance when there is a periodic premium withdrawal.
All of the above is summarized in Figure 11 where it can be seen the overall profit of rkAMM taking into account all possible scenarios and premium withdrawal periods.

5. Withdrawn Premium Analysis

In this section, a detailed analysis of the results of the previous section is carried out.
First, it must be taken into account that the rkAMM also grants collateral of invoices from the premium if it does not have sufficient liquidity. This happens for all scenarios and positively affects both the final premium values and the total volume of the rkAMM.
Considering the results, the more adverse the scenario, the lower the premium withdrawn from the rkAMM will be. The same happens with the remaining premium in the rkAMM: the worse the scenario, the lower the amount available. This is because the rkAMM will try to collateralize with the premium due to lack of liquidity, which is expected behavior in adverse scenarios. However, this general rule has some exceptions.
Scenario 1: The greater the increase in liquidity shows nearly a 100% match of the results when no premium is withdrawn.
As liquidity increases, the difference rises from an approximate −50% to a −1% difference on accepted/paid invoices increases. In all cases, all collateralized invoices are paid.
When there is a greater liquidity contribution, the total covered is increased. However, in the worst case of liquidity contribution (scenario 1.1), there is a 60% difference in terms of the total collateral covered. This difference is drastically reduced in the 1.4 case, where it is only 1%.
Concerning the premium managed by the rkAMM in these cases, it is increasing as more liquidity is provided, which was to be expected, given that a larger number of invoices are collateralized.
Regarding the benefit of the rkAMM, the greater the contribution of liquidity, the greater the profit rkAMM. However, the withdrawal of premium does not affect the benefit of the premium by itself, since there are scenarios in which premium is withdrawn and a larger benefit is obtained (even if only 1%) than those in which there is no withdrawal of premium. This is because in cases where there is no premium withdrawal, less premium is collected than in the cases where premium is withdrawn.
Scenario 2: Facing an increase in unpaid invoices, the scenarios with premium withdrawal and those without have the same shape, although the absolute values are affected and the results are worse in the cases of the highest numbers of unpaid invoices.
The number of collateralized invoices decreases. The same happens for the amount of collateral covered and the rkAMM profit.
Regarding the losses resulting from unpaid invoices, the relationship between scenarios is maintained despite the increase in the number of these invoices.
Scenario 3: The larger the delay in the payment of the invoices, the lower the premium that can be withdrawn and the lower the remaining premium in the case where the premium is not withdrawn. The shorter the payment term, the better the liquidity of the rkAMM.
The number of collateralized invoices will be lower, but the relationship between the scenarios with premium withdrawal and those without is variable, and it worsens in the scenarios where there are greater delays in the invoice payments. The same happens for the amount of collateral covered.
The rkAMM profit is lower, along with a growing delay in the payment of invoices.
Scenario 4: The greater the amount to be collateralized, the better the results of the rkAMM are in terms of its performance, since more liquidity is collateralized. Therefore, a higher premium is obtained and the larger the benefit of the rkAMM. In summary, better results are achieved the higher the risk assumed by rkAMM.
The number of collateralized invoices decreases, but the relationship between the scenarios with premium withdrawal and those without is variable, and it worsens in scenarios in which there are increasingly large invoices (of larger amounts). Despite the fact that the collateral is covered and the rkAMM profit increases, the two scenarios have the same behavior.
Scenario 5: Same pattern as scenario 4. The higher the percentage to be collateralized, the worse the results of the rkAMM. It can also be determined that the higher the percentage of collateralization of the invoices, the more similar the results between scenarios where premium is withdrawn and where it is not.
The number of collateralized invoices decreases; however, the relationship between the scenarios in which premium is withdrawn and those in which it is not decreases until it is almost equal to the scenario in which the invoices are almost completely collateralized. The same happens for the amount of collateral covered and profit rkAMM as the amount to be collateralized increases.
Hack Scenario: The larger the hack probability and the amount to collateralise, the worse the results of the AMM in terms of its performance. However, in some cases, premium withdrawal performs better in terms of AMM profit for withdrawal periods of 30 and 90 days.
Losses due to unpaid invoices, as expected, increase as the probability of hacking increases. On the contrary, the amount of collateral covered decreases as the probability of hacking and the amount to be collateralized increases. The same happens for the profit rkAMM.
Finally, as a conclusion to this section:
  • Withdrawing the premium can give better results in scenarios with larger liquidity (those with less payment terms or more liquidity contribution) and with higher risk (fewer guarantees or larger defaulting).
  • Thus, we find ourselves with an “aseptic” measure, withdrawing the benefits to improve the performance of rkAMM. The policy of premium withdrawal affects the design and performance of the rkAMM, and the following could be recommended:
    1.
    Not sharing profits (i.e., not having any premium withdrawal) is not an adequate policy for the operation of the rkAMM.
    2.
    Make a withdrawal variable policy based on liquidity, defaulting, and payment terms.
  • Additionally, distributing benefits early is expected to have a bandwagon effect on the demand for rkAMM products with more and more liquidity providers.
  • DeFi and rkAMM aim to automate as much as possible through smart contracts, but this approach has introduced or increased risks, as noted in [38]. However, rkAMM premium collection/withdrawal solutions offer a solution that provides additional trust without the need for any rating or scoring, thanks to the involvement of byppay.

6. Discussion

The following comments and considerations relate to the six scenarios analyzed in terms of parameters other than benefits: the impact on accepted invoices, unpaid invoices, average losses, collateral covered, and remaining and withdrawn premium. The comments apply to both premium withdrawal and non-withdrawal cases.
The rkAMM can accept more invoices if the liquidity stream flows into the LP with constant contribution probability (scenario 1). Otherwise, if there is no liquidity stream, the rkAMM liquidity gradually depletes, and it collateralizes invoices using the remaining premium until liquidity is replenished with premium or invoices are repaid. The best results for the number of accepted invoices are seen in scenarios in which there are small invoices or there are invoices with a high percentage to be collateralized.
Only scenario 2 shows positive results regardless of unpaid invoices, as unpaid invoices are intentionally included to be processed by the rkAMM. Hack scenarios result in losses, and these losses increase significantly when the invoice amount to be collateralized is greater.
The highest values of collateral covered are achieved in scenarios in which the LPs provide liquidity contributions, allowing the rkAMM more resources to cover collateral. However, the values of collateral covered obtained do not generally reach the values described in scenario 1. Similar collateral coverage values are achieved for cases 3.1 and 5.1 when there is no premium withdrawal.
Scenarios with greater collateral coverage result in a greater amount of premium withdrawn. The fact of making premium withdrawals in increasingly longer periods means that the premium withdrawn is lower. When there is no premium withdrawal, the remaining premium is in constant circulation and is used for collateralizing invoices.
All scenarios, except for some hacking ones, achieve a positive profit. The scenarios with the best performance in average (more profit, more invoices funded) are the ones where premium is withdrawn every 30 days.
In the case of hack scenarios, the rkAMM is resilient and can withstand an attack in scenarios with a small hack probability and a low percentage of invoice collateralization, specifically from 49% to a maximum of 30%. The scenarios in which the premium is withdrawn every 30 or 90 days with a 100% probability of hacking when the invoices are 51% collateralized are also resilient.
The optimal attack is to send bogus invoices with the highest percentage to collateralize, which is 90% in our experiments. It is worth noting that mechanisms such as checking invoices, enhancing KYC, and retaining collateral in custody could resist the hack by imposing a penalty of collateral loss. Further research is needed to investigate these mechanisms.
As future work, withdrawing profit from the rkAMM without harming its operation and long-term sustainability needs to be explored further in future research as well as calculate more exhaustively the optimal ranges of collateral and withdrawal policies, develop self tuning algorithms for demanded collateral and withdrawal policy for restoring resilience against hacks, and research into z-discrete formulations of the dynamics of the liquidity pool to stabilize the risk and volume of the rkAMM with our without using newly developed stable-coins for invoice discounting and the highest resilience of the state of the art.

Comparison with the State of the Art

Comparing our solution to the state of the art, we have the following benefits:
1.
Undercollateralization: The premium in cases in which the invoice has collateral of 49% is lower than the remaining 51% of the invoice amount, very different from the common overcollateralization required in the state of the art [26,27,28,29]. This is because the other Lending Pools lock a pair of tokens, a loanable token, and a collateral token. Lenders earn interest rates based on the supply and demand of the provided liquidity. However, as there is no guarantee of repayment, borrowers of those pools must over-collateralize their position.
2.
Risk measure: This is the only liquidity pool in state of the art that uses the Kelly criterion, which measures and mitigates the risk.
3.
Resiliency: This is the first exhaustive study of resiliency in the state of the art, with several cases in the hack scenarios of bogus invoices and many cases in the scenarios of non payment or growing delay in due time.
4.
Less demanding KYC: There is less need for KYC when a pool is accepting invoices from a byppay, as the byppay collects the collateral from the three parties that know each other in a byppay agreement. It is a great advantage to the Liquidity pools of the state of the art.
5.
Yet more decentralized: As a ancillary benefit, our solution does not require all invoices to be uploaded on the chain for their PoE, as [22] that use blockchain to enhance the PoE, but only those involved in a byppay.

7. Conclusions

Our work is significant because we have developed liquidity pools or PLF that do not require over-collateralized assets. In our approach, invoices are only partly collateralized, with a portion consisting of pure collateral and a premium calculated using the reverse Kelly formula. Thus, this collateral and premium do not cover the full value of the invoice. Despite this, our unique approach, which uses the optimal return calculated by the Kelly criterion, does not result in losses, even when there is a 20% chance of non-payment.
To ensure proper operation of our rkAMM, we conducted experiments to fine-tune it. Our findings suggest that the optimal operation mode of our rkAMM involves invoices of collateral p over 50–70%, which provides strong resilience even in scenarios of up to 10% bogus invoices, 30–120 days of due time delay, and 5% non-payment. In addition, we recommend an approach with periodic withdrawals of 30 days in the event of a premium withdrawal policy. This approach benefits the acceptance and viability of the rkAMM by allowing LP to receive partial returns in advance, despite the risks and liquidity needs of the rkAMM.
Under these conditions, it may be possible to incorporate mechanisms of PoE to verify bogus invoices or double factor invoicing on the blockchain to work alongside our rkAMM, such as crowd collateralization, verifiable credentials, on-chain scoring, or own byppay referral among groups of three actors. It is true that, despite the resilience of the rkAMM, it should not be left on its own without proper protection, as it only buys time to detect any attack or hack, and a fraction of collateral is still necessary as the stake that hackers will lose when detected.
Furthermore, the rkAMM was originally designed to operate with invoices from byppay.com, as it is a negotiation system for invoice compensation, where trust among players who invoice each other is sound for the needs of the rkAMM, which lowers hacking possibilities. Other hack-hostile systems that the rkAMM might work with are other debt compensation systems, including Netting or Barter clubs such as RES.be, Wir.ch, or Sardex.it, as they all curate invoices properly with partial payments in their complementary currencies that might work similarly to collateral.
Based on our experiences with several hack scenarios, we recommend that the percentage of invoice collateralization with our rkAMM should never exceed 49% or be lower than 5%.

Author Contributions

All authors contributed equally to this work. Conceptualization, P.R.E. and A.B.-R.; methodology, P.R.E.; software, A.B.-R.; validation, P.R.E., A.E.-F. and A.B.-R.; formal analysis, A.E.-F.; investigation, P.R.E. and A.B.-R.; resources, P.R.E. and A.E.-F.; writing—original draft preparation, P.R.E. and A.B.-R.; writing—review and editing, P.R.E., A.E.-F. and A.B.-R.; visualization, A.B.-R.; supervision, A.E.-F.; project administration, P.R.E.; funding acquisition, P.R.E. and A.E.-F. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the grant of University College London UCL—CBT 3rd Call for Research Proposals 2022 on Distributed Ledger Technologies to the project New Decentralized Compensations of Invoices—Byppay and presented in the Awards Showcase in London on 13 February 2023.

Data Availability Statement

Not applicable.

Acknowledgments

This work has been tested thanks to the insights and comments of the Centre de Blockchain de Catalunya CBCat.io and the TECNIO Centre EASY research group of the University of Girona. Andrés El-Fakdi is a Serra Húnter Fellow.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AMMAutomated Market Maker.
APYAnnual Percentage Yield.
DeFiDecentralized Finance.
DEXDecentralized Exchange.
DLTDistributed Ledger Technology.
ERPEnterprise Resource Planning.
IOUI Owe You.
IoVInternet of Value.
KYCKnow Your Customer.
LPLiquidity Pool.
PLFProtocols for Loanable Funds.
PoEProof of Existence.
rkAMMReverse Kelly Automated Market Maker.
SMESmall and Medium-sized Enterprise.

Appendix A. Result Curves from 1, 2, 3, 4, 5, and Hack Scenarios

In this appendix all the curves for the results of all the simulated scenarios can be found. Each subsection corresponds to a certain scenario and its corresponding premium withdrawal period.

Appendix A.1. Scenario 1—1, 30 and 90 Days Premium Withdrawn

Figure A1. rkAMM Curves from simulation of scenario 1 and 1 day of withdrawal period.
Figure A1. rkAMM Curves from simulation of scenario 1 and 1 day of withdrawal period.
Mathematics 11 01673 g0a1
Figure A2. rkAMM Curves from simulation of scenario 1 and 30 days of withdrawal period.
Figure A2. rkAMM Curves from simulation of scenario 1 and 30 days of withdrawal period.
Mathematics 11 01673 g0a2
Figure A3. rkAMM Curves from simulation of scenario 1 and 90 days of withdrawal period.
Figure A3. rkAMM Curves from simulation of scenario 1 and 90 days of withdrawal period.
Mathematics 11 01673 g0a3

Appendix A.2. Scenario 2—1, 30 and 90 Days Premium Withdrawn

Figure A4. rkAMM Curves from simulation of scenario 2 and 1 day of withdrawal period.
Figure A4. rkAMM Curves from simulation of scenario 2 and 1 day of withdrawal period.
Mathematics 11 01673 g0a4
Figure A5. rkAMM Curves from simulation of scenario 2 and 30 days of withdrawal period.
Figure A5. rkAMM Curves from simulation of scenario 2 and 30 days of withdrawal period.
Mathematics 11 01673 g0a5
Figure A6. rkAMM Curves from simulation of scenario 2 and 90 days of withdrawal period.
Figure A6. rkAMM Curves from simulation of scenario 2 and 90 days of withdrawal period.
Mathematics 11 01673 g0a6

Appendix A.3. Scenario 3—1, 30 and 90 Days Premium Withdrawn

Figure A7. rkAMM Curves from simulation of scenario 3 and 1 day of withdrawal period.
Figure A7. rkAMM Curves from simulation of scenario 3 and 1 day of withdrawal period.
Mathematics 11 01673 g0a7
Figure A8. rkAMM Curves from simulation of scenario 3 and 30 days of withdrawal period.
Figure A8. rkAMM Curves from simulation of scenario 3 and 30 days of withdrawal period.
Mathematics 11 01673 g0a8
Figure A9. rkAMM Curves from simulation of scenario 3 and 90 days of withdrawal period.
Figure A9. rkAMM Curves from simulation of scenario 3 and 90 days of withdrawal period.
Mathematics 11 01673 g0a9

Appendix A.4. Scenario 4—1, 30 and 90 Days Premium Withdrawn

Figure A10. rkAMM Curves from simulation of scenario 4 and 1 day of withdrawal period.
Figure A10. rkAMM Curves from simulation of scenario 4 and 1 day of withdrawal period.
Mathematics 11 01673 g0a10
Figure A11. rkAMM Curves from simulation of scenario 4 and 30 days of withdrawal period.
Figure A11. rkAMM Curves from simulation of scenario 4 and 30 days of withdrawal period.
Mathematics 11 01673 g0a11
Figure A12. rkAMM Curves from simulation of scenario 4 and 90 days of withdrawal period.
Figure A12. rkAMM Curves from simulation of scenario 4 and 90 days of withdrawal period.
Mathematics 11 01673 g0a12

Appendix A.5. Scenario 5—1 and 90 Days Premium Withdrawn

Figure A13. rkAMM Curves from simulation of scenario 5 and 1 day of withdrawal period.
Figure A13. rkAMM Curves from simulation of scenario 5 and 1 day of withdrawal period.
Mathematics 11 01673 g0a13
Figure A14. rkAMM Curves from simulation of scenario 5 and 90 days of withdrawal period.
Figure A14. rkAMM Curves from simulation of scenario 5 and 90 days of withdrawal period.
Mathematics 11 01673 g0a14

Appendix A.6. Hack Scenario—1 and 90 Days Premium Withdrawn

Figure A15. rkAMM Curves from simulation of hack scenario and 1 day of withdrawal period.
Figure A15. rkAMM Curves from simulation of hack scenario and 1 day of withdrawal period.
Mathematics 11 01673 g0a15
Figure A16. rkAMM Curves from simulation of hack scenario and 90 days of withdrawal period.
Figure A16. rkAMM Curves from simulation of hack scenario and 90 days of withdrawal period.
Mathematics 11 01673 g0a16

References

  1. Ayyagari, M.; Juarros, P.; Martinez Peria, M.S.; Singh, S. Access to finance and job growth: Firm-level evidence across developing countries. Rev. Financ. 2021, 25, 1473–1496. [Google Scholar] [CrossRef]
  2. Fabrizio, N.; Rossi, E.; Martini, A.; Anastasovski, D.; Cappello, P.; Candeago, L.; Lepri, B. Invoice discounting: A blockchain-based approach. Front. Blockchain 2019, 2, 13. [Google Scholar] [CrossRef] [Green Version]
  3. Wehinger, G. SMEs and the credit crunch: Current financing difficulties, policy measures and a review of literature. OECD J. Financ. Mark. Trends 2014, 2013, 115–148. [Google Scholar] [CrossRef] [Green Version]
  4. Battaiola, E.; Massacci, F.; Ngo, C.; Sterlini, P. Blockchain-based invoice factoring: From business requirements to commitments. DLT 2019, 2334, 17–31. [Google Scholar]
  5. Mohammadzadeh, N.; Nogoorani, S.D.; Muñoz-Tapia, J.L. Invoice Factoring Registration Based on a Public Blockchain. IEEE Access 2021, 9, 24221–24233. [Google Scholar] [CrossRef]
  6. Javaid, M.; Haleem, A.; Singh, R.P.; Suman, R.; Khan, S. A review of Blockchain Technology applications for financial services. Benchcouncil Trans. Benchmarks, Stand. Eval. 2022, 2, 100073. [Google Scholar] [CrossRef]
  7. Krichen, M.; Ammi, M.; Mihoub, A.; Almutiq, M. Blockchain for Modern Applications: A Survey. Sensors 2022, 22, 5274. [Google Scholar] [CrossRef] [PubMed]
  8. OECD Blockchain Policy Centre and the OECD Going Digital Project. The Tokenisation of Assets and Potential Implications for Financial Markets. Available online: https://www.oecd.org/finance/The-Tokenisation-of-Assets-and-Potential-Implications-for-Financial-Markets.htm (accessed on 15 February 2023).
  9. Xu, J.; Vadgama, N. From Banks to DeFi: The Evolution of the Lending Market. In Enabling the Internet of Value: How Blockchain Connects Global Businesses; Springer: Berlin, Germany, 2022; pp. 53–66. [Google Scholar]
  10. Tetiana, Z.; Volodymyr, S.; Oleksandr, D.; Vasyl, B.; Tetiana, D. Investment models on centralized and decentralized cryptocurrency markets. Nauk. Visnyk Natsionalnoho Hirnychoho Univ. 2022, 1, 177–182. [Google Scholar]
  11. Bai, Y.; Liu, Y.; Yeo, W.M. Supply chain finance: What are the challenges in the adoption of blockchain technology? J. Digit. Econ. 2022, 1, 153–165. [Google Scholar] [CrossRef]
  12. Ioannou, I.; Demirel, G. Blockchain and supply chain finance: A critical literature review at the intersection of operations, finance and law. J. Bank. Financ. Technol. 2022, 6, 83–107. [Google Scholar] [CrossRef]
  13. Liu, Z. Literature Review of Supply Chain Finance Based on Blockchain Perspective. Open J. Bus. Manag. 2021, 9, 419–429. [Google Scholar] [CrossRef]
  14. Pandharkar, A. Supply Chain Finance through a Blockchain Lens. Ph.D. Thesis, University of British Columbia, Vancouver, BC, Canada, 2020. [Google Scholar]
  15. Rijanto, A. Blockchain Technology Adoption in Supply Chain Finance. J. Theor. Appl. Electron. Commer. Res. 2021, 16, 3078–3098. [Google Scholar] [CrossRef]
  16. Guerar, M.; Verderame, L.; Merlo, A.; Migliardi, M. Blockchain-Based Risk Mitigation for Invoice Financing. In Proceedings of the 23rd International Database Applications & Engineering Symposium, Athens, Greece, 10–12 June 2019. [Google Scholar]
  17. Deloitte. Unleashing Blockchain in Finance, CFO Insights. 2022. Available online: https://www2.deloitte.com/us/en/pages/finance/articles/unleashing-blockchain-in-finance.html (accessed on 27 September 2022).
  18. Unicsoft. Invoice Factoring with Blockchain: Pros and Cons, Plus a Case Study. 2022. Available online: https://unicsoft.com/blog/invoice-factoring-with-blockchain-pros-and-cons-plus-a-case-study (accessed on 15 February 2023).
  19. Paliwal, A. Analysis between different Decentralized Lending and Borrowing Protocols. J. Bus. Anal. Data Vis. 2022, 3, 15–23. [Google Scholar] [CrossRef]
  20. Majander, J. Development of Factoring by Using Blockchains. Master’s Thesis, LUT School of Business and Management, Lappeenranta, Finland, 2020. [Google Scholar]
  21. InvoiceMate. DeFi Invoice Financing. 2022. Available online: https://invoicemate.net/defi-invoice-financing-factoring (accessed on 23 September 2022).
  22. Finpay. Why Digitise and Certify Your Invoicing with Blockchain. 2022. Available online: https://www.finpay.es/en/facturacion.html (accessed on 14 September 2022).
  23. de La Rosa, J.; Stodder, J. On velocity in several complementary currencies. Int. J. Community Curr. Res. 2015, 19, 114–127. [Google Scholar]
  24. Auer, R.; Haslhofer, B.; Kitzler, S.; Saggese, P.; Victor, F. The Technology of Decentralized Finance (DeFi); Bank for International Settlements: Basel, Switzerland, 2023. [Google Scholar]
  25. de la Rosa Esteva, J.L. Potential Sources of Internet of Value Systemic Risk. In Enabling the Internet of Value: How Blockchain Connects Global Businesses; Springer International Publishing: Berlin, Germany, 2022; pp. 185–188. [Google Scholar]
  26. Xu, T.A.; Xu, J. A Short Survey on Business Models of Decentralized Finance (DeFi) Protocols. arXiv 2022, arXiv:2202.07742. [Google Scholar]
  27. Gudgeon, L.; Werner, S.; Perez, D.; Knottenbelt, W.J. DeFi Protocols for Loanable Funds: Interest Rates, Liquidity and Market Efficiency. In Proceedings of the 2nd ACM Conference on Advances in Financial Technologies, New York, NY, USA, 21–23 October 2020; pp. 92–112. [Google Scholar]
  28. Meyer, E.; Welpe, I.M.; Sandner, P.G. Decentralized Finance—A Systematic Literature Review and Research Directions; ECIS 2022 Research Papers; ECIS: London, UK, 2022. [Google Scholar]
  29. Werner, S.M.; Perez, D.; Gudgeon, L.; Klages-Mundt, A.; Harz, D.; Knottenbelt, W.J. SoK: Decentralized Finance (DeFi). arXiv 2021, arXiv:2101.08778. [Google Scholar]
  30. Kelly, J.L. A new interpretation of information rate. Bell Syst. Tech. J. 1956, 35, 917–926. [Google Scholar] [CrossRef]
  31. O’Neill, P.; Foley, S.; Putnins, T. Can Markets be Fully Automated? Evidence From an “Automated Market Maker”. 2022. Available online: https://raw.githubusercontent.com/petero1111/website/gh-pages/AMM_Paper_Foley_ONeill_Putnins_2023.pdf (accessed on 14 February 2023).
  32. Angeris, G.; Chitra, T. Improved price oracles: Constant function market makers. In Proceedings of the 2nd ACM Conference on Advances in Financial Technologies, New York, NY, USA, 21–23 October 2020; pp. 80–91. [Google Scholar]
  33. Bichuch, M.; Feinstein, Z. Axioms for Automated Market Makers: A Mathematical Framework in FinTech and Decentralized Finance. arXiv 2022, arXiv:2210.01227. [Google Scholar]
  34. Nekrasov, V. Kelly Criterion for Multivariate Portfolios: A Model-Free Approach. 2014. Available online: https://ssrn.com/abstract=2259133 (accessed on 7 July 2022).
  35. Ntropika Labs. Introducing the Kelly Machine. 2022. Available online: https://potion-protocol.medium.com/introducing-the-kelly-machine-53c0a9863af7 (accessed on 1 July 2022).
  36. de la Rosa Esteva, J.L. A Method and Device for Creating Trustworthy Agreements between Different Network Nodes of a Blockchain Network to Compensate Digital Assets. European Patent VN/REF: 22-1338, January 2023. [Google Scholar]
  37. Perez, D.; Werner, S.M.; Xu, J.; Livshits, B. Liquidations: DeFi on a Knife-Edge. In Proceedings of the Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, 1–5 March 2021; pp. 457–476. [Google Scholar]
  38. Carter, N.; Jeng, L. DeFi protocol risks: The paradox of DeFi. In Regtech, Suptech and Beyond: Innovation and Technology in Financial Services; Riskbooks Forthcoming, 2021; Volume 3, Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3866699 (accessed on 20 March 2023). [CrossRef]
Figure 1. Lending protocol framework [26].
Figure 1. Lending protocol framework [26].
Mathematics 11 01673 g001
Figure 2. The rkAMM input and output.
Figure 2. The rkAMM input and output.
Mathematics 11 01673 g002
Figure 3. How the rkAMM is included in the Byppay platform.
Figure 3. How the rkAMM is included in the Byppay platform.
Mathematics 11 01673 g003
Figure 4. rkAMM Curves from simulation of scenario 5 and 30 days of withdrawal period.
Figure 4. rkAMM Curves from simulation of scenario 5 and 30 days of withdrawal period.
Mathematics 11 01673 g004
Figure 5. Premium vs. No Premium Withdrawn rkAMM profit absolute values.
Figure 5. Premium vs. No Premium Withdrawn rkAMM profit absolute values.
Mathematics 11 01673 g005
Figure 6. Premium vs. No Premium Withdrawn rkAMM profit difference.
Figure 6. Premium vs. No Premium Withdrawn rkAMM profit difference.
Mathematics 11 01673 g006
Figure 7. No Premium Withdrawn vs. Premium Withdrawn.
Figure 7. No Premium Withdrawn vs. Premium Withdrawn.
Mathematics 11 01673 g007
Figure 8. rkAMM Curves from simulation of hack scenario and 30 days of withdrawal period.
Figure 8. rkAMM Curves from simulation of hack scenario and 30 days of withdrawal period.
Mathematics 11 01673 g008
Figure 9. Premium vs. No Premium Withdrawn rkAMM profit absolute values from hack scenario.
Figure 9. Premium vs. No Premium Withdrawn rkAMM profit absolute values from hack scenario.
Mathematics 11 01673 g009
Figure 10. Premium vs. No Premium Withdrawn rkAMM profit difference from hack scenario.
Figure 10. Premium vs. No Premium Withdrawn rkAMM profit difference from hack scenario.
Mathematics 11 01673 g010
Figure 11. No Premium Withdrawn vs. Premium Withdrawn. (Hack scenarios).
Figure 11. No Premium Withdrawn vs. Premium Withdrawn. (Hack scenarios).
Mathematics 11 01673 g011
Table 1. DeFi Protocols Comparison.
Table 1. DeFi Protocols Comparison.
DeFi ProtocolSmart ContractInvestorUserFinancial Service
Protocols for Loanable Funds (PLF)Lending PoolLenderBorrowerLoan
Decentralized Exchange (DEX)Liquidity PoolLiquidity ProviderBuyer/TraderExchange
Yield AggregatorsVaultVault User-Asset Management
Table 2. Initial rkAMM situation.
Table 2. Initial rkAMM situation.
rkAMM Initial ConditionValue
Liquidity available1800
Premium deposited0
Volume (Liquidity + Premium)1800
Table 3. Invoice amounts.
Table 3. Invoice amounts.
Invoice%Amount
Collateralized amount (p)601200
Non-collateralized amount (q)40800
Total1001200
Table 4. Intermediate rkAMM situation after accepting an invoice (collateralization).
Table 4. Intermediate rkAMM situation after accepting an invoice (collateralization).
rkAMM Intermediate ConditionValue (Euro)
Liquidity available1000
Premium deposited303.16
Volume (Liquidity + Premium)1303.16
Table 5. Final rkAMM situation after collateral repaid.
Table 5. Final rkAMM situation after collateral repaid.
rkAMM Final ConditionValue (Euro)
Liquidity available1800 (1000 + 800)
Premium deposited303.16
Volume (Liquidity + Premium)2103.16
Table 6. Invoice attributes definition.
Table 6. Invoice attributes definition.
ValueDescription
Id InvoiceInvoice identifier
Non-coll. %Value between 5% and 49%
Non-coll. amountValue between 100 and 2000 (euro)
Collateralized dateDay when the invoice is collateralized
Collateralized statusTrue if the invoice is collateralized/False otherwise
Payment delay daysValue between 30 and 120 (days)
Paid statusTrue if the non-coll. amount is repaid/False otherwise
Table 7. Attributes used to simulate default (non-payment) and hack scenarios.
Table 7. Attributes used to simulate default (non-payment) and hack scenarios.
DescriptionValueCommentFixed or Variable Parameter (across Different Scenarios)
Number of simulations100Number of simulations to determine the common behavior of the rkAMMFix
Initial collateral Q 0 10,000 (euro)This amount is the initial liquidity in the LP.Fix
Initial premium0N/AFix
Number of invoices500Max. value of invoices to processFix
Range of % from invoices to collateralize5–49%Max. and min. values allowed for invoice collateralizationVariable only for scenario 5 and Hack scenarios
Range of amount from invoices to collateralize100–2000 (euro)Max. and min. amounts allowed to be collateralized. As the initial collateral Q 0 is fixed to 10,000, we set the simulations in the range 0.1–20% of the initial liquidityVariable only for scenario 4
Invoice payment period range30–120 (days)Max. and min. delays in days for the payment of invoicesVariable only for scenario 3
Range of liquidity contribution by LPs0–0Max. and min. amounts of liquidity contribution to the rkAMMVariable only for scenario 1
Non-payment probability0%The probability that collateral on an invoice will never be paid backVariable only for scenario 2 and Hack scenarios
Hack probability0%The probability of including false invoices that will never be paid may affect the performance of the rkAMMVariable only for Hack scenarios
Probability of contribution by LPs0%The probability that an LP makes a liquidity deposit to the rkAMMVariable only for scenario 1
Maximum days500Days on which invoice entries are allowedFix to the number of invoices
Additional days30Extra days for simulations to reach the steady state of the rkAMMFix
Number of days of the simulation650Total days of simulation. Max. days + Max. delay invoice payment + Additional daysFix to maximum (days + delays) + additional days
Table 8. Baseline scenario output. Scenario 5 and 30 days of withdrawal period.
Table 8. Baseline scenario output. Scenario 5 and 30 days of withdrawal period.
ValueNo Premium WithdrawnPremium WithdrawnPremium vs. No Premium WithdrawnDescription
Number of simulations100.0100.00.0%Number of simulations conducted.
Simulation time period (days)650.0650.00.0%Total number of days on which the simulation has been conducted.
Total of invoices500.0500.00.0%Number of invoices to be processed by the rkAMM.
Average of accepted invoices (collateralized)350.96179.34−48.9%Number of invoices accepted by the rkAMM.
% of accepted invoices (collateralized)70.1935.87−48.9%% of invoices accepted by the rkAMM.
Average of paid invoices (capital returned)350.96179.34−48.9%Number of accepted invoices for which collateral has been returned.
% of paid invoices (capital returned)100.0100.00.0%% of accepted invoices for which collateral has been returned.
Average of unpaid invoices (capital not returned)0.00.00.0%Number of accepted invoices for which the collateral has not been returned.
% of unpaid invoices (capital not returned)0.00.00.0%% of accepted invoices for which the collateral has not been returned.
Average loss due to unpaid invoices)0.00.00.0%Amount (in EUR) lost due to unpaid invoices.
Total collateral covered329,583.29124,772.17−62.14%Total amount of collateral borrowed by the rkAMM.
Total collateral covered x (i.c.)32.9612.48−62.14%Total amount of collateral borrowed by the rkAMM with respect to the initial collateral Q 0 .
Total premium withdrawn0.033,161.86100.0%Total premium withdrawn.
Total premium withdrawn x (i.c.)0.03.32100.0%Total premium withdrawn with respect to the initial collateral Q 0 .
Remaining rkAMM premium10,344.890.0−100.0%Remaining premium in the rkAMM after the simulation ends.
Remaining rkAMM premium x (i.c.)1.030.0−100.0%Remaining premium in the rkAMM after the simulation ends with respect to the initial collateral Q 0 .
Final rkAMM volume98,416.6529,049.41−70.48%Total volume of the rkAMM after simulation.
rkAMM profit88,416.6552,211.27−40.95%rkAMM profit without including initial collateral Q 0 .
rkAMM profit percentage884.17522.11−40.95%rkAMM profit percentage without including initial collateral Q 0 .
Table 9. rkAMM results. Every day, 50% of the premium obtained is withdrawn.
Table 9. rkAMM results. Every day, 50% of the premium obtained is withdrawn.
Scenario% Accepted Invoices% Unpaid InvoicesAvg. Loss due toTotal Collateral CoveredTotal Premium with.Remaining PremiumrkAMM Profit
#(Collateralized)(Capital Not Returned)Unpaid Invoicesx (i.c.)x (i.c.)x (i.c.)Percentage
No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.
1.169.3936.290.00.00.00.032.4512.620.03.431.010.0872.63537.8
1.287.4269.220.00.00.00.043.6931.480.07.034.020.01601.631556.73
1.393.5586.470.00.00.00.047.9543.290.07.915.460.02407.742437.59
1.499.1897.50.00.00.00.052.0450.750.07.96.860.04901.764897.91
2.156.122.941.92.024512.981472.6224.467.00.01.960.280.0554.43199.11
2.251.5721.565.114.9911,049.933097.5221.696.370.01.760.190.0447.58160.02
2.336.5215.019.9819.7626,130.048128.0213.094.070.01.070.050.0117.3934.6
3.180.5535.110.00.00.00.039.9712.420.03.32.810.0748.97359.58
3.252.9822.820.00.00.00.023.547.360.01.970.290.0561.77213.34
3.332.3416.040.00.00.00.013.085.270.01.40.020.0340.62150.89
4.1100.0100.00.00.00.00.05.05.00.00.740.730.072.6273.62
4.248.6818.10.00.00.00.024.349.050.04.010.310.0578.46457.26
4.321.68.210.00.00.00.027.010.270.05.140.220.0728.34608.29
5.196.8730.290.00.00.00.050.210.160.08.0513.610.02182.86903.32
5.232.5622.870.00.00.00.010.796.840.00.720.030.0114.0572.34
5.323.4622.940.00.00.00.07.126.850.00.080.010.08.498.18
i.c. = initial collateral Q0; No With. = No Premium Withdrawn; With. = Premium Withdrawn.
Table 10. rkAMM hack scenario results. Every day, 50% of the premium obtained is withdrawn.
Table 10. rkAMM hack scenario results. Every day, 50% of the premium obtained is withdrawn.
Hack% Accepted Invoices% Unpaid InvoicesAvg. Loss due toTotal Collateral CoveredTotal Premium with.Remaining PremiumrkAMM Profit
Prob.(Collateralized)(Collateralized)Unpaid Invoicesx (i.c.)x (i.c.)x (i.c.)Percentage
No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.
10%99.9447.729.789.9151,136.7719,804.3252.320.080.026.7916.330.02300.963008.99
32.6318.1910.169.9310,627.945147.5410.525.120.00.890.040.080.2638.79
19.1618.519.89.545211.174895.745.385.210.00.060.010.0−45.71−42.75
50%99.9513.9650.1950.13264,936.5522,607.5452.84.520.06.551.740.0483.79572.29
11.46.6849.9349.6414,482.679884.922.921.960.00.320.010.0−94.93−66.01
7.397.1149.2448.8610,009.929823.792.012.00.00.020.00.0−97.73−95.88
100%98.992.35100.0100.0515,511.8610,923.7751.551.090.00.840.330.0−66.94−16.02
2.752.15100.0100.011,719.059992.761.171.00.00.150.010.0−99.44−84.9
2.272.24100.0100.010,077.269962.261.011.00.00.010.00.0−99.61−98.48
i.c. = initial collateral Q0; No With. = No Premium Withdrawn; With. = Premium Withdrawn. Colored values refer to those cases in which the rkAMM profit percentage is negative.
Table 11. rkAMM results. Every 30 days, 50% of the premium obtained is withdrawn.
Table 11. rkAMM results. Every 30 days, 50% of the premium obtained is withdrawn.
Scenario% Accepted Invoices% Unpaid InvoicesAvg. Loss due toTotal Collateral CoveredTotal Premium with.Remaining PremiumrkAMM Profit
#(Collateralized)(Capital Not Returned)Unpaid Invoicesx (i.c.)x (i.c.)x (i.c.)Percentage
No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.
1.169.6466.230.00.00.00.032.530.240.01.50.960.01868.36860.4
1.287.4986.280.00.00.00.043.7342.930.04.324.050.021610.661603.16
1.393.9793.160.00.00.00.048.1847.80.05.785.480.022432.652428.88
1.499.1198.90.00.00.00.051.851.710.07.026.830.024868.14828.38
2.156.4250.382.162.065418.734547.8924.6621.20.00.70.250.0561.84501.42
2.251.9948.285.154.8811,524.679398.7221.919.790.00.640.180.0453.12424.97
2.337.4132.019.7919.927,238.2521,592.1413.6510.880.00.360.060.0131.2497.31
3.180.7478.380.00.00.00.040.138.350.03.042.890.02757.77759.62
3.252.4949.010.00.00.00.023.3521.080.00.750.310.01561.81529.75
3.332.8229.50.00.00.00.013.2211.760.00.350.030.0344.3312.77
4.1100.0100.00.00.00.00.05.05.00.00.740.730.072.5373.77
4.248.9541.870.00.00.00.024.4820.930.00.810.30.0581.6525.56
4.321.8815.940.00.00.00.027.3419.930.01.390.210.01728.41584.32
5.196.8395.820.00.00.00.049.9249.220.013.9413.490.062172.022216.21
5.232.1130.230.00.00.00.010.779.810.00.230.030.0113.91103.73
5.323.723.160.00.00.00.07.146.920.00.050.010.08.528.26
i.c. = initial collateral Q0; No With. = No Premium Withdrawn; With. = Premium Withdrawn.
Table 12. rkAMM hack scenario results. Every 30 days, 50% of the premium obtained is withdrawn.
Table 12. rkAMM hack scenario results. Every 30 days, 50% of the premium obtained is withdrawn.
Hack% Accepted Invoices% Unpaid InvoicesAvg. Loss due toTotal Collateral CoveredTotal Premium with.Remaining PremiumrkAMM Profit
Prob.(Collateralized)(Collateralized)Unpaid Invoicesx (i.c.)x (i.c.)x (i.c.)Percentage
No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.
10%99.9699.649.869.7751256.7950,736.852.4552.320.017.6716.460.072309.782442.9
32.1229.9410.149.8310,675.989172.0310.399.480.00.290.040.077.8276.84
18.6518.0810.0710.525323.515332.925.25.050.00.040.010.0−47.04−47.31
50%99.9599.4350.2150.05264,606.12261,539.0252.6952.110.06.091.840.02483.06904.98
11.319.849.3750.6914,483.8513,215.622.932.660.00.110.010.0−94.73−86.87
7.077.0850.8549.3810,046.439880.932.01.960.00.020.00.0−98.11−96.5
100%99.093.26100.0100.0514,687.26472,315.0551.4747.230.03.210.350.01−64.97222.34
2.682.6100.0100.011,725.3411,529.511.171.150.00.020.010.0−99.42−97.86
2.232.21100.0100.010,074.2510,036.041.011.00.00.010.00.0−99.58−99.2
i.c. = initial collateral Q0; No With. = No Premium Withdrawn; With. = Premium Withdrawn. Colored values refer to those cases in which the rkAMM profit percentage is negative.
Table 13. rkAMM results. Every 90 days, 50% of the premium obtained is withdrawn.
Table 13. rkAMM results. Every 90 days, 50% of the premium obtained is withdrawn.
Scenario% Accepted Invoices% Unpaid InvoicesAvg. Loss due toTotal Collateral CoveredTotal Premium with.Remaining PremiumrkAMM Profit
#(Collateralized)(Capital Not Returned)Unpaid Invoicesx (i.c.)x (i.c.)x (i.c.)Percentage
No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.
1.169.9670.010.00.00.00.032.7332.710.01.041.10.18881.2889.71
1.286.8486.550.00.00.00.043.5643.390.03.563.930.451591.241607.24
1.393.6494.020.00.00.00.048.1648.190.05.165.470.52409.922435.5
1.499.2199.220.00.00.00.051.951.770.06.326.830.514844.954838.42
2.156.4652.611.951.954693.434125.0324.7922.420.00.340.310.04571.75523.22
2.251.1551.485.084.8810,905.0510,265.5621.4521.710.00.30.170.04436.98451.74
2.334.4234.6520.4220.0424,583.3824,005.712.0712.050.00.140.050.01102.84100.99
3.181.6280.540.00.00.00.040.8239.860.02.653.010.38766.99768.17
3.252.7450.550.00.00.00.023.4422.150.00.390.330.07566.55543.55
3.332.1731.620.00.00.00.012.7112.480.00.130.030.01332.73323.79
4.1100.0100.00.00.00.00.05.05.00.00.690.730.0572.6473.59
4.249.7146.70.00.00.00.024.8623.350.00.410.310.06590.31560.45
4.322.9120.520.00.00.00.028.6425.650.00.630.210.06762.75700.41
5.196.8196.730.00.00.00.050.1650.170.012.513.511.242177.662199.24
5.232.2931.890.00.00.00.010.7910.580.00.090.030.01113.95112.06
5.323.8223.330.00.00.00.07.167.10.00.020.010.08.548.48
i.c. = initial collateral Q0; No With. = No Premium Withdrawn; With. = Premium Withdrawn.
Table 14. rkAMM hack scenario results. Every 90 days, 50% of the premium obtained is withdrawn.
Table 14. rkAMM hack scenario results. Every 90 days, 50% of the premium obtained is withdrawn.
Hack% Accepted Invoices% Unpaid invoicesAvg. Loss due toTotal Collateral CoveredTotal Premium with.Remaining PremiumrkAMM Profit
Prob.(Collateralized)(Collateralized)Unpaid Invoicesx (i.c.)x (i.c.)x (i.c.)Percentage
No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.No With.With.
10%99.9699.9510.089.8752,195.5251,985.9152.4452.40.015.4216.391.342301.212337.35
33.0532.110.0810.0410,762.5210,505.5810.8310.450.00.120.040.0185.2380.5
19.0218.410.010.075192.235353.665.295.160.00.020.010.0−45.62−47.39
50%99.8999.9150.1249.94262,371.99260,757.4852.2952.350.03.251.790.25483.09659.2
11.5910.1749.4750.414,717.0513,754.293.062.690.00.050.010.0-94.57−91.64
7.217.2350.149.6110,057.439962.062.022.020.00.010.00.0−98.19−97.24
100%99.0897.19100.0100.0518,522.18501,747.5151.8550.170.01.180.390.09−60.7326.59
2.712.66100.0100.011,712.0811,620.561.171.160.00.010.010.0−99.38−98.56
2.232.19100.0100.010,076.6310,054.621.011.010.00.010.00.0−99.61−99.39
i.c. = initial collateral Q0; No With. = No Premium Withdrawn; With. = Premium Withdrawn. Colored values refer to those cases in which the rkAMM profit percentage is negative.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Esteva, P.R.; El-Fakdi, A.; Ballesteros-Rodríguez, A. Invoice Discounting Using Kelly Criterion by Automated Market Makers-like Implementations. Mathematics 2023, 11, 1673. https://doi.org/10.3390/math11071673

AMA Style

Esteva PR, El-Fakdi A, Ballesteros-Rodríguez A. Invoice Discounting Using Kelly Criterion by Automated Market Makers-like Implementations. Mathematics. 2023; 11(7):1673. https://doi.org/10.3390/math11071673

Chicago/Turabian Style

Esteva, Peplluis R., Andrés El-Fakdi, and Alberto Ballesteros-Rodríguez. 2023. "Invoice Discounting Using Kelly Criterion by Automated Market Makers-like Implementations" Mathematics 11, no. 7: 1673. https://doi.org/10.3390/math11071673

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop