Skip to content

How points are calculated

Points come from four kinds of entries. Each deposit earns credit points. A deposit can also earn a flat bonus. Each address can earn a volume bonus. A fourth kind, the referral bonus, exists in the data model but Altar does not award it at present (see the note at the end).

All point values are stored as whole numbers scaled by 10^18, so 1 point is 1000000000000000000. This page shows whole points.

Altar starts with every finalized deposit of the campaign. Before it calculates anything, it:

  1. Applies deposit corrections. An admin can ignore a deposit, change it, or add one.
  2. Applies price overrides. An admin can replace the price of a token at a block.
  3. Removes deposits to exchange addresses. A deposit whose points address is on the campaign’s exchange-address list earns no points.
  4. Removes deposits with no price. A deposit that has no price yet is left out until it is priced.

Corrections are public. See Onchain, calculated, and corrected.

Altar multiplies the token amount by the token price. The result is the deposit value in US dollars. Prices come from the token’s price source: a fixed one-dollar price (stable), an exchange market (ccxt), or a decentralized exchange pool (dex).

For each deposit, Altar applies these rules in this order:

  1. The deposit is after the end time: it earns 0.
  2. The deposit is before the start time and the campaign does not count early deposits: it earns 0.
  3. The deposit is before the inflection time: it earns dollars × base rate. There is no decay.
  4. Any later deposit earns dollars × base rate × decay factor.

The decay factor depends on the decay step of the deposit:

decay step = number of full step lengths between the inflection time and the deposit
decay factor = (1 / (1 + decay rate)) ^ decay step

The step count starts at 0 for the first step length after the inflection. A campaign can turn on useInflectionStepOne. Then the inflection moment itself counts as step 1, and every later step is one higher.

The base rate is the setting usdToPointBaseRate. The default is 10,000 points per dollar. The default decay rate is 6.25% per step.

The app also shows a rate multiplier. It is the inverse of the decay factor, so it starts at 1.00x and rises as points per dollar fall.

Altar sorts each deposit into a window by its time:

Window Time range Bonus
Volume Before start + volume cutoff × step length Volume bonus (per address)
Flat From the volume cutoff until start + flat cutoff × step length Flat bonus (per deposit)
None After the flat cutoff No bonus

Deposits before the start time also fall in the volume window, because they are earlier than the cutoff.

A deposit in the flat window earns credit points × flat bonus rate. The default rate is 100%.

Altar adds up the credit points of each address inside the volume window. It ranks the addresses from the smallest total to the largest. For an address with total volume V, where V₀ is the combined volume of all smaller addresses and T is the total volume of every address in the window:

bonus = 4 × (2·V₀ + V − 1) × V / (4 × (T − 1))

The factor 4 is the curve coefficient. The code fixes it at 4 for every campaign. The result is a straight curve:

  • The smallest address of many gets close to 1x its volume (no extra).
  • The largest address in a crowded field gets up to 3x its volume in total (its volume plus a bonus of up to twice its volume).
  • The average across all addresses is 2x.
  • An address that is alone gets 2x, not 3x. It is the whole distribution, so it earns the average.

The bonus depends on everyone else in the window. You cannot know it from your own deposits alone. The calculator lets you enter the other volumes to estimate it.

These examples use the default points curve and an example schedule: start on day 0, inflection on day 7, one step per day. Decay is 6.25% per step, the base rate is10,000 points per dollar, the volume window ends on day 54, and the flat window ends on day 59.

DepositDayDecay stepDecay factorCredit pointsFlat bonus
Early deposit ($100)3011,000,0000
After inflection ($100)1250.738508738,508.170
In the flat bonus window ($100)56490.05127251,272.251,272.2

Volume bonus for three addresses that each deposit once on day 2. The bonus depends on the other addresses, so you cannot know it from your own deposit alone. Total volume is 5,700,000 points.

AddressDepositCredit points (volume)Points of smaller addressesVolume bonus
Address A$50500,000043,859.64
Address B$1201,200,000500,000463,157.89
Address C$4004,000,0001,700,0005,192,982.45

The tables above run at build time with the same functions the backend uses (sacrifice-utils and the points package). They are not typed by hand.

Altar uses whole-number arithmetic with integer division. Each step rounds down. The totals you see can differ from a hand calculation by a very small fraction of a point.

  • The volume bonus rate setting. Campaigns store a volumeBonusRate, but the calculation does not read it. It uses the fixed curve above.
  • Referral points. Campaigns store a referralRate, and the app records referrals. The points calculation does not create referral entries at present, so referrals do not change anyone’s points. If this changes, this page will change with it.

Points are produced by Altar’s server from the rules above. They are not computed by a smart contract. Read Onchain, calculated, and corrected to see which parts you can check against a blockchain.