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.
Step 0: which deposits take part
Section titled “Step 0: which deposits take part”Altar starts with every finalized deposit of the campaign. Before it calculates anything, it:
- Applies deposit corrections. An admin can ignore a deposit, change it, or add one.
- Applies price overrides. An admin can replace the price of a token at a block.
- Removes deposits to exchange addresses. A deposit whose points address is on the campaign’s exchange-address list earns no points.
- 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.
Step 1: the dollar value
Section titled “Step 1: the dollar value”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).
Step 2: credit points
Section titled “Step 2: credit points”For each deposit, Altar applies these rules in this order:
- The deposit is after the end time: it earns 0.
- The deposit is before the start time and the campaign does not count early deposits: it earns 0.
- The deposit is before the inflection time: it earns dollars × base rate. There is no decay.
- 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 depositdecay factor = (1 / (1 + decay rate)) ^ decay stepThe 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.
Step 3: the bonus windows
Section titled “Step 3: the bonus windows”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.
Flat bonus
Section titled “Flat bonus”A deposit in the flat window earns credit points × flat bonus rate. The default rate is 100%.
Volume bonus
Section titled “Volume bonus”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.
A worked example
Section titled “A worked example”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.
| Deposit | Day | Decay step | Decay factor | Credit points | Flat bonus |
|---|---|---|---|---|---|
| Early deposit ($100) | 3 | 0 | 1 | 1,000,000 | 0 |
| After inflection ($100) | 12 | 5 | 0.738508 | 738,508.17 | 0 |
| In the flat bonus window ($100) | 56 | 49 | 0.051272 | 51,272.2 | 51,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.
| Address | Deposit | Credit points (volume) | Points of smaller addresses | Volume bonus |
|---|---|---|---|---|
| Address A | $50 | 500,000 | 0 | 43,859.64 |
| Address B | $120 | 1,200,000 | 500,000 | 463,157.89 |
| Address C | $400 | 4,000,000 | 1,700,000 | 5,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.
Rounding
Section titled “Rounding”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.
What does not change the result
Section titled “What does not change the result”- 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.