---
# System prepended metadata

title: Untitled

---

[toc]
## Use case definition
The main idea of the Factoring module of the Xsell Use Case is to define SME and SME_E customers who are eligible for the Factoring product.
### Main idea
By considering the product specification, we decide to implement the rule base logic based on expert opinion. In PASHA Bank there is a list of the CIB customers coorperation with which is a positive factor during the Factoring issuing process. So, the main field for exploration were the SME/SME_E customers who were counterparties in transactions with these CIB customers. The outcome here is the SME/SME_E and CIB customers pair who is eligible for Factoring.
### Target definition

SME/SME_E customers who received the money from the defined CIB list during the last 1 year and pass the rules below.

### CIB customer list

The list below provided by the Factoring team.

| CIB customer name | CIB customer tin |
| -------- | -------- |
| Azərbaycan Supermarket   | 1403051411     |
|Araz Supermarket| 1001994141|
|Veysəloğlu MMC|700159551|
|ANC Group|1701102351|
|Grand Mart|1401395111	|
|Bazarstore|2000102651|
|Al-Market|1005498281|
|Bizim Market|1501069851|
|Avrora|1000030571|
|Norm MMC|1400972921|
|Holcim|9900051081|
|PMD projects|1404255921|
|Azvirt|2000025721|
|PAŞA İnşaat|1700665151|
|"Üstay Yapı Taahhüt ve Ticaret Anonim şirketi"nin Azərbaycan Respublikasındakı Nümayəndəliyi|1401546461|
|Avromed|1500766751|
|Zeytun|1701688171|
|İrşad Electronics|1404510051|
|ABC Telecom|1401005061|
|Schlumberger Logelco INC|9900011691|
|"Bakı-Tbilisi-Ceyhan Boru Kəməri şirkəti"nin Azərbaycan Respublikasındakı Nümayəndəliyi|9900058661|
|Azərbaycan Beynəlxalq Əməliyyat şirkəti"nin Azərbaycan Respublikasındakı Nümayəndəliyi|9900071671|
|BP Eksploreyşn (Azərbaycan) Limited şirkətinin Azərbaycan Respublikasındakı Nümayəndəliyi|9900070341|
|BP Eksploreyşn (Kaspian Si) Limited şirkətinin Azərbaycan Respublikasındakı Nümayəndəliyi|9900070211|
|"Halliburton Services" MMC|1000472871|
|Technip Energies Italy S.P.A şirkətinin Azərbaycan Respublikasındakı Filialı|1701793251|


### Limitations

* Liability and overdue
If the customer has liability at the moment of prediction greater than 5000 AZN and any current overdue we exclude these customers.
If the customer has overdue > 90 days during the last one year we also exclude these customers.
* TIN
Customer's tax id should have tenure greater than 1 year.
* Transaction Tenure
As we generate outcome as SME/SME_E and CIB pair, we have to be ensure that these customers have transaction history at least 5 months.
* No active or fresh Factoring contracts
Also, these pairs of customers should not have open Factoring for a moment prediction generation. Additionally, we also exclude pairs where customers have even closed Factoring with the issuing date during last 6 months.
* PASHA tenure and activity
SME/SME_E should be PASHA Bank customers at least 2 months and the total transaction count between them during the last year should be greater than 2.
Otherwise, if the SME/SME_E customer has tenure in PASHA Bank less than 2 months, he/she should have at least 10 transactions in general.
* Trn amount > 50k
The sum of transactions between SME/SME_E and CIB customers should be at least 50000 AZN.

## Data Source
### Main Database

All data for analysis stored in PostgreSQL:

```
Host: 192.168.64.50
Port: 5445
Database name: ds_db_user
Schema names: use_case_cross_sell, analytics, integration
```
### Tables 
Transaction tables:
* `analytics.t_outgoing_trn` - transactions where sender in PASHA Bank and receiver the other bank
* `analytics.t_incoming_trn` - transactions where sender in other bank and receiver is PASHA Bank
* `analytics.t_internal_trn` - trasactions where sender and receiver are both PASHA Bank 

Liability and overdue stop factors:

`use_case_cross_sell.fact_stop_factors_part1` - the view where the customer's actual and annual overdue are calculated based on PASHA Bank portfolio table and MKR data. Also, here we consider the actual liability of the customer.

Factoring and the counterparty:
`use_case_cross_sell.t_fact_portfolio ` - Factoring contracts data
`integration.v_agreement` - counterparty side of the Factoring contracts.

## Monthly update
As a part of the Xsell engine the Factoring module also updating on a monthly basis. The list of the procedures which should be run in order to the proper data update listed below:

`call use_case_cross_sell.build_xsell_fact_liability_pasha(date) `
`call use_case_cross_sell.build_xsell_fact_liability_mkr(date)`
`call use_case_cross_sell.build_xsell_fact_overdue_pasha(start_date, end_date)`
`call use_case_cross_sell.build_xsell_fact_overdue_mkr(start_date, end_date)`
`call use_case_cross_sell.build_xsell_fact_portfolio(start_date, end_date)`
`call use_case_cross_sell.build_stop_factors_part1()`

## Final result
The final results of the module stored in a table:
`use_case_cross_sell.xsell_factoring_output`

## Feasibility analysis
First analysis that was performed is income potential of targeted clients. The calculations below are based on output of model for 03 Nov 2022.

Input metrics:


| Description                                             | Unit  | Value |
| ------------------------------------------------------- | ----- | ----- |
| Average outstanding portfolio period (portfolio tenure) | Month | 2.2   |
| Average effective interest income rate                  | %     | 13%   |
| Financing rate of invoice                               | %     | 90%   |
| Target precision of model during calls (actual = 6.8%)   | %     | 10%   |
| Conversion rate of offers (relevance for customers)     | %     | 40%   |
| Conversion rate after bank analysis (relevance for bank)   | %     | 80%   |


Income estimation:

Calculation for portfolio=( volume of transaction between given SME-CIB / Duration of business relationship between SME-CIB) average 

Calculation of income = portolio * effective interest income rate

Estimated realized interest income = Estimated income potentail * precision * conversion rates



| Metrics                           | Unit | Value |
| --------------------------------- | ---- | ----- |
|   Number of unique clients      |   #   |   380    |
| Number of predictions             | # | 544   |
| Estimated portfolio               | k AZN | 54,100 |
| Estimated income potential for 1y |  k AZN | 7,032 |
| Estimated realized income for 1y  |    k AZN  | 225 |

For comparison, actual factoring gross income of 2022 for sales offered during only 20222 is 77k AZN. So considiring that this is only one part of factoring model that is planned under scope of X-sell development, the results are quite satisfactory.

