Roommates Paying Bills Together
Last updated
Last updated
A percentage based ARP is an ARP that uses percentages to compute the amount due/owed to/by an account.
Let's take a scenario of an ARP used by a group of people (User A, B, C & D), that share the same apartment, to pay their utility bills. They are each responsible for the payment of 25% of the monthly bills.
Here is a step by step guide to setting up such an ARP:
The first step is to deploy a manual ARP like we did on this page
Click on the Details button of your ARP to reveal the panel
Since Employee One is paid in USD, let's select the USD tFIAT token. Click on the Select a currency button to reveal the token wizard like in the image below. Click on the Manage Tokens button to reveal the form on the right, activate the PaySwap Onramp tokens then go back to the previous form
Search for and select the USD tFIAT token
You should now have the USD selected like in the image below. Click on the Control Panel button to show the control panel's menu
Click the Create/Update Account button; fill in the form on the right image below. Make sure you read the description for each parameter in order to provide the correct value
The Account Owner field has been set to the address of User A
The Amount Receivable field has been set to 25% which is the share of the monthly bills, User A will be paying the contract periodically
The Period Receivable has been set to 43200 which is the number of minutes in a month. This parameter sets the duration of each payment cycle from User A to the contract
The Start Receivable sets the date at which the contract should start counting seconds to the next payment of User A to the contract. We set this parameter to October 20th, 2023
The Description parameter provides a descriptive comment about the account so we can remember the purpose of the account in the future.
Validate the form and reload the page. Tick the Mine Only button to only show your ARP contracts (this should enable you to find your ARP faster)
You should see the ID of your recently added account at the bottom left of your ARP's panel
Here is an image of our ARP panel before the new account has been added
And here is an image of our ARP panel after the new account has been added
Clicking on the ID of your recently added account (which in our example is 4) will show you the account details like in the image above.
The next step is to setup the other three accounts for Users B, C & D the same exact way as we've just done for User A
After setting up your users' account, you need to let the ARP contract know that 100% of all deposits made from those accounts should go to the ARP's treasury. To do so, go to your ARP's control panel menu and click on the Update Parameters button
Set the Admin Credit Share to 100% meaning
Fill in other fields as needed and validate the form
Once you've setup your various accounts, you will just need to notify the ARP contract of the latest bill for it to compute how much each roommate needs to pay and when. To do so, go to your ARP's control panel menu and click on the Notify Debt button. Make sure you have selected the correct currency clicking on the Control Panel button
Enter the amount of the latest bill in the Debt Amount field and validate the form
Congratulations, you have successfully setup your ARP contract to collect the monthly bills from each one of your roommates.
Here is a step by step guide to paying your share of the latest bill:
Got to your ARP and select your account by its ID at the bottom left of your ARP's panel
In the control panel's menu select the AutoCharge option and fill in the form with your account's id and the number of payment cycles ahead you are willing to pay for (which in this use case should be set to 0)
Validate the transaction so the contract can withdraw the amount necessary from your wallet
After your roommates have paid their share of the latest bill, you can withdraw the total amount paid from the ARP's treasury so you can pay your utility providers. To do so, go to your ARP's control panel menu and select the Withdraw option
Fill in the amount you wish to withdraw from the treasury and validate the transaction
Congratulations! You can now pay your utility providers.