Commit 118cf17
committed
feat: per-address yield for xOGN staking
xOGN was the last yield-bearing Origin product on the portfolio page without
per-address yield. It's a MasterChef-style fixed-rate staking contract; adds
ESAddressYield, a per-staker daily OGN-reward series built by the same balance*dR
accumulator with R = accRewardPerShare (PRECISION 1e12, verified on-chain). balance
tracks xOGN points (reward share); stakedBalance tracks the OGN principal (APY
denominator). Captures unclaimed pending rewards — essential, since long-term stakers
rarely claim (summing ESReward would show zero).
Resolver: adds esAddressApy and a 4th UNION branch to addressApy (holder is the account
column; USD-weighted by OGN principal x OGN price), degrading gracefully when the OGN
price is unavailable. Restart re-hydration loads the previous-day baseline.
Validated on the xOGN launch window: 121 stakers, zero negatives, cumulativeYield within
98.8-99.7% of on-chain claimed+previewRewards (the ~1% gap is stored-vs-live
accRewardPerShare, self-correcting), per-address APY varies by lock multiplier, and yields
stay continuous across a mid-day restart.1 parent fc2ad3f commit 118cf17
9 files changed
Lines changed: 353 additions & 14 deletions
File tree
- db/migrations
- src
- model/generated
- server-extension
- templates/exponential-staking
Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1394 | 1394 | | |
1395 | 1395 | | |
1396 | 1396 | | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1397 | 1418 | | |
1398 | 1419 | | |
1399 | 1420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
135 | 156 | | |
136 | 157 | | |
137 | 158 | | |
| |||
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
176 | 205 | | |
177 | 206 | | |
178 | 207 | | |
| |||
215 | 244 | | |
216 | 245 | | |
217 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
218 | 259 | | |
219 | 260 | | |
220 | 261 | | |
| |||
252 | 293 | | |
253 | 294 | | |
254 | 295 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
258 | 299 | | |
259 | 300 | | |
260 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
261 | 305 | | |
262 | 306 | | |
263 | 307 | | |
| |||
267 | 311 | | |
268 | 312 | | |
269 | 313 | | |
270 | | - | |
| 314 | + | |
271 | 315 | | |
272 | 316 | | |
273 | 317 | | |
| |||
0 commit comments