Setting Up A Tontine
Manual ARPs can enable you to setup a tontine. A tontine is a joint financial arrangement whereby a group of people contribute equally to a prize that is awarded entirely to one of them every payment cycle.
Suppose User A, User B and User C started a tontine whereby they each contribute 10,000 USD tFIAT tokens to the tontine every month for 3 months. They agree that:
On Month One: User A gets the prize pot (30,000 USD)
On Month Two: User B gets the prize pot (30,000 USD)
On Month Three: User C gets the prize pot (30,000 USD)
Tontines are very popular in third world countries notably in African countries. The main issue with tontines though is the lack of trust in the participants to pay their due during each payment cycle and also the lack of trust in the treasurer in charge of the tontine's treasury.
ARP contracts are a fantastic way to solve all those issues with tontines. Let's setup the tontine described above between User A, B & C
The first step is to deploy a manual ARP like we did on this page
Creating Accounts For Our Participants
Click on the Details button of your ARP to reveal the panel
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-abd145919e6bf7f80743c3965641609aa136aa0e%252Farp22.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=57363bc&sv=1)
Since our tontine runs 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
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-a20c01c4022c2b4224e0d3665ec9ea0e0869205d%252Framp_select_token.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=aa60c3eb&sv=1)
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-0b4728d1f16db59d102765671efb14a1de0e54d0%252Framp_select_token2.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=61477284&sv=1)
Search for and select the USD tFIAT token
You should now have the USD selected as in the image below. Click on the Control Panel button to show the control panel's menu
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-097ef5cd50cad7ca990c1177fb05b75371a82e07%252Farp21.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=baf73565&sv=1)
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
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-08a0a33ca3c8a2e2252713630060204288a190e0%252Farp5.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=eecbec1&sv=1)
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-3a88ce262780fe6c6fab0f27aeceefe5ebfdaa7b%252Farp16.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=75d5b444&sv=1)
The Account Owner field has been set to the address of User A
The Amount Receivable field has been set to 10000 which is the amount of USD, User A will be paying the contract periodically
The Amount Payable field has been set to 30000 which is the amount of USD the contract pays User A
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 Period Payable has been set to 0, meaning the payment from the contract to User A will be a one-time payment.
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 Start Payable sets the date after which the contract should let User A withdraw his/her due amount from the contract. We set this parameter to November 20th, 2023 which is the end of the first month of the tontine.
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
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-a51f0fa47495518a80e0b8137f2012318c56c486%252Farp20.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=e0c567ff&sv=1)
And here is an image of our ARP panel after the new account has been added
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-2a09c9c7c73cea77a6586a7fa237f753e45484b2%252Farp27.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=d454edfe&sv=1)
Clicking on the ID of your recently added account (which in our example is 3) will show you the account details like in the image above. We can see that currently, the account is due 0 USD (Amount Due Payable) and owes 0 USD (Amount Due Payable), that the next payday for the account (Next Due Payable) is November 20th, 2023, and that the next due date for the account to pay the contract (Next Due Receivable) is also November 20th, 2023.
The ARP Liquidity parameter represents the amount of the token of the current account (USD) currently available in the ARP contract
To create accounts for the rest of the users, we proceed the same. We select the right token first (USD), then we create an account for our users. Here are images of those accounts being created:
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-8d29101b3d163b8262f8ee00900cba6be631a89c%252Farp17.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=c99dd0a6&sv=1)
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-53eb980470c3a17c75e4cb70b9c50a07efa28fdb%252Farp18.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=a05ee54d&sv=1)
As you can see, User B (on the left) is set to make a withdrawal of 30,000 from the contract on December 20th, 2023 (which is 2 months after the start of the tontine).
User C (on the right) is set to make a withdrawal of 30,000 from the contract on January 20th, 2024 (which is 3 months after the start of the tontine).
Congratulations! You have successfully created a tontine that will have Users A, B & C make monthly deposits of 10,000 USD for 3 months and reward one of them with 30,000 USD each month for 3 months.
Making Your Tontine Safe
To make our Tontine safe, we can take three quick actions:
Require our users who want to make withdrawals to not owe anything to the contract. To do so, go to your ARP's control panel menu and select the option Update Due Before Payable
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-f1839a53440aa4362c318d18b650df3306c65ee8%252Farp28.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=ba953d83&sv=1)
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-ef3434fd43e280e641867826a982f312c79375ba%252Farp29.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=92abd86f&sv=1)
Set the field on the form on the right to No so that users are required to be up to date on payments they owe the tontine before they can be paid by the tontine
Validate the form
Use bounties/collaterals to ensure the participants of our tontine are trustworthy. ARP contracts enable you to require your participants to attach bounties/collaterals to their accounts which can be claimed if they ever fail to make a payment. The value of this bounty is set when creating the account. It is the parameter Bounty Required which is the second to last parameter on the account creation form. In the image below, we are setting that value to 10000 USD tFIAT tokens.
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-c1d2cb3e40ae4acbfe1437c2b096e3e9922ed30f%252Farp34.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b991df9c&sv=1)
ARP contracts can also be set up to limit the number of accounts created to just the number of participants in the tontine. This will prevent the admin of the ARP from stealing funds from the tontine by creating fake accounts with the sole purpose of withdrawing funds from the ARP. To do so, go to the Update Parameters option in your ARP contract's control panel menu, set the Max Number of Accounts to your max, and validate the form. In the example below, we are setting that number to 3 since we only have 3 participants in our tontine.
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-df265768dbf04deb66b39de0f6a11dfc032e0ac8%252Farp33.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=e9f03219&sv=1)
Congratulations! Your tontine is now much safer, and more transparent than others that don't run on the blockchain. In addition to that, it distributes and collects due payments automatically.
Last updated