abitrolly / opencompany

Компания с открытым исходным кодом // Open Source Company
The Unlicense
5 stars 2 forks source link

UpWork money transfer pipeline #34

Open abitrolly opened 3 years ago

abitrolly commented 3 years ago

In the world of money many intermediaries are taking a cut from your earned money while the money travels down from somebody to you. Those intermediary platforms do not cooperate to calculate the fees and takings. That's why one need to calculate them on their own. The UpWork pipeline looks like this.

[Somebody] --> [UpWork] --> [Payoneer] --> [Bank] --> [You]

When Somebody sends you first $500, the UpWork cuts 20%. https://support.upwork.com/hc/en-us/articles/211062538-Freelancer-Service-Fees

def upwork(money):
  # https://support.upwork.com/hc/en-us/articles/211062538-Freelancer-Service-Fees
  if money <= 500:
    fee = 0.2
  elif money <= 10000:
    fee = 0.1
  else:
    fee = 0.05
  return money-money*fee

Testing.

In [2]: upwork(100)                                                             
Out[2]: 80.0

In [3]: upwork(500)                                                             
Out[3]: 400.0

In [4]: upwork(500.01)                                                          
Out[4]: 450.009

In [5]: upwork(10000)                                                           
Out[5]: 9000.0

In [6]: upwork(10000.1)                                                         
Out[6]: 9500.095000000001

In [7]: upwork(0)                                                               
Out[7]: 0.0

In [8]: upwork(-1)                                                              
Out[8]: -0.8
abitrolly commented 3 years ago

This calculation is actually wrong. The correct one is this.

def upwork2(money):
  # https://support.upwork.com/hc/en-us/articles/211062538-Freelancer-Service-Fees
  fee500 = 0.2
  fee10000 = 0.1
  feeabove = 0.05

  if money <= 500:
    return money-money*fee500
  else:
    toll = 500*fee500
    if money <= 10000:
      toll += (money-500)*fee10000
    else:
      toll += (10000-500)*fee10000
      toll += (money-10000)*feeabove
    return money-toll

Testing to confirm that this progressive calculation actually gives less money from UpWork.

In [14]: upwork2(100)                                                               
Out[14]: 80.0

In [15]: upwork2(500)                                                               
Out[15]: 400.0

In [16]: upwork2(500.01)                                                            
Out[16]: 400.009

In [17]: upwork2(10000)                                                             
Out[17]: 8950.0

Checking with the real number from UpWork, which is $543.99 billed with reported $104.41 fees paid.

image

In [12]: upwork2(543.99)                                                        
Out[12]: 439.591

In [13]: 543.99-upwork2(543.99)                                                 
Out[13]: 104.399

Hey! Did somebody just steal 2 cents en route to me? Okay, it is 1.099999999999568 cents, but anyway. If I wanted to provide a superior service, I would try to round up the number in favour of users. The fishy part here is that round error doesn't fit into the 0-1 range. I mean maximum number that you may need to round up (ceil) some value after the dot is 0.9999999..

abitrolly commented 3 years ago

If you can imagine how outraged I was about that 2 stole cents, then try to guess how I felt looking at this digit. image

One may think that money are still on the way, but it is not the case. There are some extra "debits" taking place as shown in this summary.

image

That's another $21 "stolen". Okay, it is $20 and 88.0000000000052 cents, but still. If I wanted to provide a superior service, I would include the debits break down on that summary.

In [22]: 543.99-104.41-418.70                                                       
Out[22]: 20.880000000000052
abitrolly commented 3 years ago

The number 20.888 didn't make sense to me, so I decided to check it it is some kind of additional percentage fee from the money I had left.

In [25]: leftover = 543.99-104.41                                                   

In [26]: leftover                                                                   
Out[26]: 439.58000000000004

In [27]: howmuchisthecut = (leftover-418.70)/leftover                               

In [28]: howmuchisthecut                                                            
Out[28]: 0.04749988625506176

That looks like a round 4.75%, but maybe there is a better value. Let's check if that is the percentage of the fee that had already been taken.

In [29]: morecut = leftover-418.70                                                  

In [30]: morecut                                                                    
Out[30]: 20.880000000000052

In [31]: morecut/104.41                                                             
Out[31]: 0.19998084474667227

That's 20% cut seems more like it. In fact one if the reports page contains the hint that this must be the VAT.

image

The explanation there is "VAT is applied to the Upwork service fee, premium Upwork memberships, and purchases of Connects. The tax is collected by Upwork and remitted to the Belarusian government." So good that they've took care of paying taxes for me. The irony of the deal is that it is directly supporting the terror government of Belarus I am trying to escape by registering on UpWork.

Depressive venting about the governmental terror that makes me cry. Don't read that. Many of my friends were punished for coming to last year elections to see the results. I was not surprised that the counting of results was without webcams regardless of the numerous proposals, and that were would be attempts to hide the counting process at any cost. I expected everything, except the terror that was imposed on people both counting votes and standing outside. Before that I thought that we have just opposition using media for political manipulations, but when facing it myself I could not do anything except go to the street on a peaceful, and I will repeat - peaceful - demonstration that I can not believe such voting. Dozen of my friends were detained and at least 10 people who know me are in jail right now, and I am not a political activist, opposition or anything. I had to argue about things that people take too personal, and the fact that right now I am writing this in a what is supposed to be unrelated post, just proves that I became such person myself. Politicized. I can't say that my friends were political activists. There were actually doing great things. Like AI powered city planning, donation system for open source and public projects, supported street basketball being official FIBA referees. Maybe everybody was pissed off by some fact, like I was pissed off when I discovered that access to the rules of gameplay on this country is behind a paywall. Now UpWork pays to that government by taking the money on top of what it had already taken as a service fee. I calm myself that they pay for the infrastructure, for the discounted heat, electricity, and among those things, paywall access to laws. I don't care really. I didn't invent neither dollars, nor the way I have to play this game. It is all imposed by force. I fear to get out to the streets because of the goverment terror, where people without any uniform can just grab you from the street and contain in a place with lice and other "advantages". For two days in a row I've seen that with my own eyes not being on a protest at all, and then I locked myself in my home and was trying to avoid any places I could be snatched. If you've ever wondered why it is so clean on the streets of Minsk, now I have an answer for you - the goal of the terror state is to keep its citizens in fear, and so far it happens. Damn it. How am I supposed to work in a state like this? :(
abitrolly commented 3 years ago

Watch https://www.coursera.org/learn/the-science-of-well-being if you've been tainted by the mood. I don't want to impose more censorship. I've been doing it for a long time, and it doesn't make things better. What makes things better is doing stuff and challenging the fears. Nothing could be done against a raw force. I can always opt-out from this game, but maybe there is a different lobby of my level.

abitrolly commented 3 years ago

The final version of the function that calculates cuts made by UpWork.

def upwork3(money):
  # https://support.upwork.com/hc/en-us/articles/211062538-Freelancer-Service-Fees
  # https://support.upwork.com/hc/en-us/articles/211061278--Value-Added-Tax-VAT-
  fee500 = 0.2
  fee10000 = 0.1
  feeabove = 0.05

  toll = 0  # this is how much UpWork took for its service
  vat = 0  # this is how much UpWork takes from me to give to the government

  if money <= 500:
    toll = money*fee500
  else:
    toll = 500*fee500
    if money <= 10000:
      toll += (money-500)*fee10000
    else:
      toll += (10000-500)*fee10000
      toll += (money-10000)*feeabove
  vat = toll*0.2
  return money-toll-vat

Checking.

In [33]: upwork3(534.99)                                                            
Out[33]: 410.7912

That's it. Now I need to get that money somehow.

abitrolly commented 3 years ago

Just for fun, here are some diagrams with input and output money from the three functions above.

# because everybody is using this
import numpy as np
# array of 101 numbers [0, 150, 300, ..., 15000]
xpoints = np.linspace(0, 15000, 101)

yupwork1 = [upwork(x) for x in xpoints]
yupwork2 = [upwork2(x) for x in xpoints]
yupwork3 = [upwork3(x) for x in xpoints]

# draw first function
import matplotlib.pyplot as plt
plt.plot(xpoints, yupwork1)
plt.show()

image

There are expected jumps in output value here. One is nearly invisible at 500 and another is at 10000.

In [66]: upwork(10000)                                                              
Out[66]: 9000.0

In [67]: upwork(10001)                                                              
Out[67]: 9500.95

It looks like a slope, because there is an interval of 150 between x points. Using smaller interval reduces the slope.

xpoints = np.linspace(0, 15000, 10000)
yupwork1 = [upwork(x) for x in xpoints]
plt.plot(xpoints, yupwork1)
plt.show()

image

That's still not convenient for the comparison. There should be a way to zoom on anomalies and draw all three functions in the same window.

abitrolly commented 3 years ago

More exercize for plotting with Python.

abitrolly commented 3 years ago

Let's move some funds. The cost of moving to bank account via wire transfer is $30 and about 7 days. That's 7.165% which is too expensive just for transfer. Most likely will be bank fee as well. Let's stick to the initial pipeline - move $418.70 to Payoneer. This page mentions a small transfer fee from UpWork side and additional "costs" from Payoneer without specify how much exactly for either side.

abitrolly commented 3 years ago

The "small transfer fee" from UpWork to Payoneer is $1. That cut sends only $417.70 down the pipeline.

image

abitrolly commented 3 years ago

There is a separate confirmation for receiving payment on Payoneer side. Looks like this step can not be automatied, or maybe it will cost $2.5.

image

And there is immediately another catching page, which I almost clicked.

image

abitrolly commented 3 years ago

It does looks like this 2 day limitation is artificial, because Payoneer is immediately aware of the incoming transfer. Holding the money for 2 days knowing that it came from UpWork with validated history does look like a fraud prevention scheme to me.

abitrolly commented 3 years ago

The funds are just received by Payoneer.

image

Which immediately introduces recurring payments.

image

There is a stateful activation fee per card (means it is attached to card state). There is also recurring maintenance fee.of $3 per month that is also depends on monthly transactions. With 3+ transactions it will be $1 per month.

https://myaccount.payoneer.com/MainPage/Widget.aspx?w=FeesUI#/settings/fees

There is also another interesting 12 months inactivity fee. Unlike blockchain, if you're dead or something, Payoneer just drains your balance like $29.95 per year.

image

In the end the available funds are $409.70 where 24.686% were taken off the initial $543.99

abitrolly commented 3 years ago

Another transaction down UpWork pipeline for tests.

$58.67 -> $52.80 ($5.87 Service Fee) -> $51.63 ($1.17 VAT for Service Fee) -> $50.63 ($1.00 Withdrawal Fee)
abitrolly commented 3 years ago

So far on 31st of January,

$409.70 + $50.63 = $460.33

-$23.98 for hosting.

abitrolly commented 3 years ago

$433.35 is new balance. $3 is the monthly maintenance fee. Payoneer decided to count the hosting transaction to be today instead of yesterday. That makes just 2 transactions in January, which are not eligible for reduced fee. Did they delay that on purpose?

image

abitrolly commented 3 years ago

-$68.46 for books.