Creating an Investment Queue
When an investor’s funds becomes available on the platform, either through investor fund transactions or through repayments received from borrowers, these funds are queued for investing in loans on the marketplace if the Auto Invest feature is opted for by the investor. If funds from multiple investors become available for a loan contract, the system uses an investment queue.
The Investment queue is a queue of definite size money tokens. For example, if an investor brings 1000 to the lender for auto investing, and the size of money token set by the lender is 200, then 5 money tokens of 200 are created and queued for investing in the loans. The money tokens are invested in loans based on FIFO (First In First Out) model. That is, the money token which was created first gets to fund the loan first. When more funds become available, they are split into money tokens and added to the end of the investment queue. The size (amount) of the money tokens is decided and configured by the lender.
Scenario 1 - If multiple Investor’s fund are available at the same time for investment queue creation:
If multiple investors' funds become available at the same time, each token gets added to the queue. For example, Investor A brings 600 to the platform and Investor B brings 400, and the size of the money token is 200. Then, when the batch job runs, the queue is created as per the below sequence:
Sequence No. | Investor | Money Tokens |
---|---|---|
1 | A | 200 |
2 | B | 200 |
3 | A | 200 |
4 | B | 200 |
5 | A | 200 |
... | ... | ... |
If more investors become available after a batch job completes, then tokens are appropriately lined up in the queue for the next run of the batch job. For example, if investor C and D are added after the initial run of the batch job, then the next run of the batch job create the queue as follows:
Sequence No. | Investor | Money Tokens |
---|---|---|
1 | A | 200 |
2 | B | 200 |
3 | C | 200 |
4 | D | 200 |
5 | A | 200 |
6 | B | 200 |
7 | C | 200 |
8 | D | 200 |
9 | A | 200 |
... | ... | ... |
Scenario 2 - If investor withdraws fund:
If an investor withdraws the funds, then the money tokens of the investor are deleted from the investment queue based on LIFO (Last in first out) mechanism.
Scenario 3 - If the investor's funds are not perfectly divisible by the token size:
When funds are not perfectly divisible by the token size, then the remaining amounts should be added to the queue next time funds become available for that investor.
For example,
Day 1 – Lender A transfers 500. If the money token size is 200, two money tokens of 200 are added to the lending queue and the remaining 100 is not added.
Day 15 – Lender A gets a repayment of 150. One 200 money token is added to the investment queue and the remaining 50 is not added.
Once the batch jobs or defined triggers are executed, the tokens are listed in the Investment Queues tab in CL Marketplace.