Inner Workings - Part 3

Published on Jun 21, 2018

This is a third part about BeePlus's inner workings. You can read part 1 about investing into primary market items from here and about buying loans from secondary market from here.

Third part will be about BeePlus's functionality of selling loans on the Bondora's secondary market. This is an unique feature of BeePlus compared to Bondora's own automatic investment solutions.

Selling on a secondary market is technically much more complicated for BeePlus than buying from a primary or secondary market since it needs even more finely-orchestrated ever-running background jobs.

Logic for the end-user is similar with other investing functionalities - when user has created any rule with at least one filter (and BeePlus has been authorized), then that rule is participating in selling loans on Bondora's secondary market.

Also, as for buying, so called background jobs exist which do all the heavy-lifting and are not visible to the user directly. For selling on the secondary market there exists five forever-running jobs - one for sending out sale requests to secondary market, three for updating sale status of loans (one for recent sales, another for longer sale periods and one for special erroneous sale requests) and one for cancelling sales when item does not match rule's filters anymore. Last one allows for nice chainable sale strategies - you can read more about it in blog.

Selling Loans

BeePlus fetches user's current investments from Bondora as often as possible to get them with the most updated status. It would do it even more often, but Bondora has set up many different documented and undocumented rate limits. After getting investments, it will cycle through all of them trying to match against secondary market sell rules. Most of the matching is done by comparing rule's filter field value with the item's actual value, but there's also some more complicated algorithms involved when values are choices, ranges or time-based. After any rule with all matching filters has been found, a sale order is sent to Bondora.

Sale Status

Putting a sale order on Bondora's platform is an asynchronous process, which means that BeePlus needs to ask status of all the items to understand if anything has been sold already or not. BeePlus also cancels sales, when loan on sale does not match rule anymore.

Technical Challenges

While writing this post, everything seems to be quite simple, but it's far from reality. In reality there has been many undocumented API features, throttling rules have been changed during BeePlus's operation, API itself has been changed with very brief notice period (or without any notice), API is technically unstable at times and so on. It's not like a walk in the park even if it seems so from using BeePlus. One of the biggest problems for me as a developer has been working with Bondora's API throttling rules - basically, the more requests I need to perform against their API, the more I will hit against throttling rules. And there's quite many requests to perform to keep everything running for primary and secondary market at all time.

Conclusion

I hope that these inner working posts have given some overview of how BeePlus operates when operating on a primary and secondary market. If you have any other questions regarding BeePlus then do not hesitate to write me.