Inner Workings - Part 1

Published on May 22, 2018

Update: There are also part 2 and part 3 available now.

BeePlus is still working well after ~1.5 years of operation. Nevertheless I've never written about its inner workings. I will start with the first part of (at least) three part series about how BeePlus is being awesome.

First part will be about BeePlus's oldest feature - its functionality of investing into Bondora's primary market items. This is a feature, which existed on Bondora's web too at the time of introducing it on BeePlus. Nowadays you don't see it anymore, since all loans are financed quickly enough. According to Bondora (I can't verify it) each loan on the primary market is open for bids only for 30 seconds nowadays and that window has gotten shorter in time. This means that BeePlus will need to act fast and efficiently to get any successful investments (and it is always not possible due to various reasons).

BeePlus has an easy to use and intuitive web interface while still trying to keep all the complex filtering functionality for allowing all its users to target as specific loans as needed. After user has created any rule with at least one filter (and BeePlus has been authorized), then that rule is participating in investing into any loans offered by Bondora.

There exists many so called background jobs which do all the heavy-lifting and are not visible to the user directly. Specifically for primary market, there are two forever-running jobs - one for placing bids and another for checking bids statuses.

Placing Bids

BeePlus requests currently open auctions from Bondora as often as possible. It would do it even more often, but Bondora has set up many different documented and undocumented rate limits. After getting some open auctions (there's not always any), it will cycle through all of the users who has any enabled rules for primary market. It does it in random order to make everything as "fair" as possible for its users.

Each rule will be matched against open auction by looking at its attributes one by one. Most of the matching is done by comparing rule's filter field value with the auction'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 and user daily limits are not exceeded, a bid is placed on Bondora.

Bids Prioritization

According to Bondora (I can't verify it) each bid will be prioritized before getting turned into (un)successful bid. Highest priority will be given to bids which fulfill loan's amount fully. If that happens then no-one else can get any part of that loan. After that bids will be prioritized by placement time and amount and will be included in financing of that loan until its amount has been fulfilled. That's why placing bids in random order each time, a "fair" prioritization will happen from BeePlus's side. It is really impossible to verify if there's any other prioritization going on at Bondora's side - for example Portfolio Manager, Portfolio Pro or other Bondora's inner tools might have even higher priorities.

Bids Status

After bids have been placed, another forever running background job requests bids statuses from Bondora to understand if any bids were successful or not. This is really important for daily limit functionality and BeePlus's subscription model (for calculating invoices). Bids might get successful status soon or it might take some time. If bid has gotten any final status, life-cycle of placing a bid has been completed from BeePlus's side.

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.

Upcoming

I hope this post has given some overview of how BeePlus operates. Next post will be about the functionality of buying from the secondary market.