Closed Allen-Muhani closed 2 years ago
What is happening:
What should happen:
Scenario 1: User Request cUSD Top up.
User posts request of 500 KSH
Fee for user = 0.05 cUSD (agent fee) + 0.04 cUSD (Wakala fee) = 0.09 cUSD
Amount the user will receive = (500 / 115) cUSD - 0.09 cUSD = 4.35 cUSD - 0.09 cUSD = 4.26 cUSD
Agent accepts request
money withdrawn from agent wallet to escrow = 4.26 cUSD (separate transaction: wallet to escrow contract)
money withdrawn from agent wallet to Kukuza treasury = 0.04 cUSD (separate transaction: wallet to kukuza treasury
Total withdrawn: 4.30 cUSD
4.30 cUSD is 5 cents less than 4.35 cUSD (500 / 115), because the agent retains the 5 cent agent fee
Scenario 2: User Requests cUSD Withdrawal
Agent receives: (500 / 115)- Wakala fee = 4.35 - 0.04 = 4.31 cUSD
Agent sends via M-PESA: 4.35 cUSD - wakala fee - agent fee = 500 KSH - 0.09 cUSD = 500 KSH - 10.35 KSH = 489.65 KSH
User post request to withdraw 500 KSH
amount withdrawn from user wallet to escrow: (500/115) - wakala fee = 4.35 - 0.04 = 4.31 cUSD
amount withdrawn from user wallet to treasury: 0.04 cUSD Wakala fee
Check: total withdrawn: 4.35 cUSD
M-PESA amount the user will receive: (500 / 115) cUSD - 0.09 cUSD = 4.35 cUSD - 0.09 cUSD = 4.26 cUSD
4.26 * 115 = 489.9
@steffenkrogmann Implementation on the smart contract is done and tested
https://github.com/Kukuza/kukuza-contracts-monorepo/pull/30 https://github.com/Kukuza/kukuza-contracts-monorepo/pull/31
What is happening:
What should happen:
Scenario 1: User Request cUSD Top up.
User posts request of 500 KSH
Fee for user = 0.05 cUSD (agent fee) + 0.04 cUSD (Wakala fee) = 0.09 cUSD
Amount the user will receive = (500 / 115) cUSD - 0.09 cUSD = 4.35 cUSD - 0.09 cUSD = 4.26 cUSD
Agent accepts request
money withdrawn from agent wallet to escrow = 4.26 cUSD (separate transaction: wallet to escrow contract)
money withdrawn from agent wallet to Kukuza treasury = 0.04 cUSD (separate transaction: wallet to kukuza treasury
Total withdrawn: 4.30 cUSD
4.30 cUSD is 5 cents less than 4.35 cUSD (500 / 115), because the agent retains the 5 cent agent fee
Scenario 2: User Requests cUSD Withdrawal
Agent accepts request
Agent receives: (500 / 115)- Wakala fee = 4.35 - 0.04 = 4.31 cUSD
Agent sends via M-PESA: 4.35 cUSD - wakala fee - agent fee = 500 KSH - 0.09 cUSD = 500 KSH - 10.35 KSH = 489.65 KSH
User post request to withdraw 500 KSH
Fee for user = 0.05 cUSD (agent fee) + 0.04 cUSD (Wakala fee) = 0.09 cUSD
amount withdrawn from user wallet to escrow: (500/115) - wakala fee = 4.35 - 0.04 = 4.31 cUSD
amount withdrawn from user wallet to treasury: 0.04 cUSD Wakala fee
Check: total withdrawn: 4.35 cUSD
M-PESA amount the user will receive: (500 / 115) cUSD - 0.09 cUSD = 4.35 cUSD - 0.09 cUSD = 4.26 cUSD
4.26 * 115 = 489.9