← Home

◢◢ Treasury

The treasury is a representation of the flow of money through the platform, eventually making its way to users.

Flow

To see a general diagram of how the treasury flows, see this diagram.

Glossary

Ledger

The treasury is powered by a postgres database called the ledger. It is comprised primarily of two tables:

Paying into the vault

Funds are added to the vault via the Add funds to vault button on the Just About Admin > Vault Overview screen of the Strapi admin panel. This will add a row to the entries table, debitting the paid-in account and crediting the unallocated account.

Payouts

Payouts are made to users who have earned at least $25 and have connected their PayPal account. Users must have a Payout Request in order to be paid. These can be created for all users who qualify by pressing the Create new payout requests button on the Just About Admin > Payout requests screen of the Strapi admin panel.

Note: Only admin users with the Treasurer role can access the Payout Requests section of the admin panel.

Payout Requests are manually approved via this Payout requests screen. Only approved payouts will be processed. If a Payout Request is rejected, the funds will be returned from the holding account to the user wallet in the users account.

The GET /api/cron/process-payouts cron will process all approved payout requests. It is currently not set up to run and is called manually on the first of every month. This will trigger each payout request to be sent to PayPal to process. Upon success, the user's PayPal account will be credited, and the funds will be moved from the holding account to paid-out. The Payout Request will then have its status set to complete.

Payout Requests have the following statuses:

Treasury models

Treasury

This is the main model where treasury configuration is stored. It has a one-to-one relationship with communities, and a lifecycle hook creates one whenever a new community is created.

It has the following fields:

TreasuryBreakdown

This model determines what percentage of the contributor budget should go towards different automated rewards. It has a one-to-one relationship with the Treasury and is automatically created when a new treasury is created.

It has the following fields:

Currently this defaults to assigning 100% of the contributor budget to forum as this is the only functionality that exists.

TreasuryRankingBreakdown

This model determines how many users and articles are ranked, and what cut of their budget they should receive per day. It has a one-to-one relationship with the Treasury and is automatically created when a new treasury is created.

It has the following fields:

TreasuryRunway

This model is deprecated and should not still be used anywhere. It was used to calculate how much of the contributor budget should be spent each day. This is now obsolete thanks to the contributorBudgetEnd field on the Treasury model.

Treasury administration

The treasury is managed via the Strapi admin panel under Just About Admin. The treasury section will only be visible to treasurers.

Treasuries > Manage treasuries

This screen shows a listing of all the treasuries along with breakdowns of how funds within those treasuries are allocated. Click on a treasury to to manage it.

Adding funds

Funds can be added to the treasury via the Add funds button at the top of the screen. You cannot add more funds than there are currently in the unallocated account, and you must provide a description (for instance, where the funds came from).

Overview

This section is where individual community treasuries are managed. From here you can see an overview of funds in the treasury, and where they are allocated. You can also see a list of the last 50 transactions in and out of the community treasury. Note: This will not include funds going leaving bounty and contributor budgets, i.e. if a new bounty is created, the funds going from the bounty budget into the bounty reserve will not be shown in this listing.

Configuration

Treasuries can be configured at the bottom of the screen. Here you can set the bounty budget, contributor budget, etc. as per the fields described in the Treasury models section above.

Updating the bounty budget or the contributor budget will create a new row in the entries table of the ledger, tracking the difference between the current budget and the new budget. Any increases to the bounty or contributor budgets cannot exceed the unallocated total.

Treasuries > Vault overview

The vault overview provides a general view of where funds are currently allocated, including individual treasuries, user wallets, and pending payouts.

The Community treasuries listing shows a simple breakdown of how many funds are in each community, including unallocated funds, bounties and organic reward allocation (i.e. the contributor budget). The bounty allocation is the sum of both the bounty budget, and the total funds already in the bounty reserve.

At the bottom of the screen is a list of the last 50 transactions on the unallocated account. This will mostly consist of funds received from the bank, and outgoing funds to community treasuries or individual users.

Treasuries > Full ledger entries

This screen is simply an overview of the last 50 transactions in the entries table. This show all transactions across the entire ledger, across all accounts.

Treasuries > Audit tools

This screen provides a view of any issues in the ledger. Specifically at the moment this means highlighting any sub-accounts that have a negative balance

Users and User Wallets

To get a view on an individual user's wallet, you must navigate to their overview in the Users section of Just About Admin.

Treasurers will be able to credit a user via the Credit user button. Here you can set which community treasury to credit the user from - if not set, it will come directly from unallocated funds. If a community treasury is set, then you can determine what budget it will come from, the bounty budget or the contributor budget - if not set then it will come from the community treasury's unallocated budget.

On this screen you can also see the last 50 transactions in the user's wallet. This will include funds coming in from communities (or unallocated funds), or outgoing to the holding account. Note: This will not show funds going from the holding account to their PayPal account.