Commit c77c403
Release: develop -> main (#2927)
* fix(security): disable unused urlencoded parser and patch CVE-2024-45590 & CVE-2025-15284 (#2925)
- Add body-parser 1.20.3 override to fix CVE-2024-45590 (DoS via deep nesting)
- Add qs ^6.14.1 override to fix CVE-2025-15284 (arrayLimit bypass)
- Disable automatic bodyParser in NestFactory.create() to remove unused urlencoded attack surface
Closes #2921
* [DEV-3526] Add automatic liquidity pipeline for ref payouts (#2672)
* feat(ref-reward): Add automatic liquidity pipeline for ref payouts
When ref reward payouts lack sufficient liquidity, automatically trigger
the LiquidityManagement pipeline (similar to BuyCrypto).
Changes:
- Add liquidityPipeline relation to RefReward entity
- Extend secureLiquidity() to check available liquidity
- Start pipeline via liquidityService.buyLiquidity() when deficit detected
- Set status to PENDING_LIQUIDITY before pipeline attempt (consistent with BuyCrypto)
- Process pending rewards when pipeline completes
- Reset to PREPARED on pipeline failure for automatic retry
Flow:
PREPARED → [liquidity check] → PENDING_LIQUIDITY → [pipeline complete] → READY_FOR_PAYOUT
* refactor: improve consistency of liquidity pipeline implementation
- Add pendingLiquidity() and resetToPrepared() entity methods to RefReward
(consistent with existing entity method pattern like readyToPayout(), payingOut())
- Consolidate DB queries: load all rewards in single query instead of 3 separate
- Fix error handling: try/catch per individual reward instead of per asset group
(consistent with ref-reward-out.service.ts pattern)
- Atomize pipeline updates: create pipeline first, then update rewards
(avoids inconsistent state where rewards are PENDING_LIQUIDITY without pipeline)
- Remove misleading 'consistent with BuyCrypto' comment
* fix: change log level to warn for unexpected state
Rewards in PENDING_LIQUIDITY without pipeline should never occur
with atomic updates. This indicates legacy data or DB issues.
* feat: refactoring
* feat: added migration
---------
Co-authored-by: David May <david.leo.may@gmail.com>
* fix: exclude pending deposits from Kraken toKraken balance calculation (#2929)
Kraken deposits with status='pending' (On Hold) were incorrectly being
counted as "arrived" in the toKraken pending balance calculation. This
caused the balance to show ~117k CHF less than actual, because:
- 50k CHF On Hold
- 30k CHF On Hold
- 40k EUR On Hold (~37k CHF)
These deposits have not yet been credited to the Kraken account and
should not be subtracted from the pending-to-Kraken amount.
Add status !== 'pending' filter to both CHF and EUR receiver exchange_tx
filters in getFinancialDataLog().
* fix: prioritize user-provided refundTarget over pre-filled value (#2928)
When processing refunds, user input (dto.refundTarget) should take priority
over the pre-filled value (refundData.refundTarget). This allows customers
to override the original IBAN when it's a Multi-Account IBAN that cannot
be used for refunds.
Changed:
- BankTxReturn refund: dto.refundTarget ?? refundData.refundTarget
- BuyCrypto bank refund: dto.refundTarget ?? refundData.refundTarget
Previously the logic was reversed, ignoring user-provided values when
the backend had a pre-filled refundTarget.
---------
Co-authored-by: bernd2022 <104787072+bernd2022@users.noreply.github.com>
Co-authored-by: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com>
Co-authored-by: David May <david.leo.may@gmail.com>10 files changed
Lines changed: 142 additions & 121 deletions
File tree
- migration
- src
- subdomains
- core
- history/controllers
- liquidity-management/entities
- referral
- reward
- services
- supporting/log
| 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 | + | |
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 | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
0 commit comments