Skip to content
Business logic Audit finding Advanced

Junior LP exits are priced on a VPI charge that is refunded at close, letting a trader-LP take other Junior LPs' principal

Junior LP entry and exit prices count a trader's open-position VPI charge as final pool revenue, but the trader's own close later refunds that charge from pool cash. An account that is both a trader and a Junior LP can open a skew-increasing position just before its exit settles, redeem at the inflated NAV, then close to recover the charge, taking other Junior LPs' deposited principal.

skydev Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#97695 [SC-Critical] Junior LP exits are priced on a VPI charge that is refunded at close, letting a trader-LP take other Junior LPs' principal

Submitted on Nov 2nd 2026 at 18:07:21 UTC by @skydev for Audit Competition | Plether

Description

Severity: Critical

Impact: Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield

Code: packages/perps/src at a82d4fefb02768e5b3bddcc97dee371eee24fea8 (HousePool, TrancheVault, CfdEngineSettlementSidecar, CloseAccountingLib, CfdEnginePlanLib)

Why this impact:

  • The market has no revenue. The PoC market has zero open interest and no trader other than the attacker. In the time-matched control, Junior value changes only by the Senior coupon it pays: an independent 100,000 USDG Junior LP redeems 99,995.85, and the treasury receives nothing.
  • An LP that never interacts with the attacker realizes the loss. With the attack, the same LP redeems 99,802.19 after one cycle (193.66 less than in the control) and 581.14 less after three cycles. All non-attacker Junior holders lose 2,130.23 in that cycle. Of that, 1,318.32 goes to the attacker after all protocol fees (gas and Pyth update fees excluded) and 811.91 goes to the protocol treasury as the open-leg fee. Senior is unchanged, and conservation holds to the atom.
  • The value taken is deposited capital, not yield. The only VPI (virtual price impact) on this market is the attacker's own charge. The attacker's exit counts that charge as Junior equity. The attacker's close then pays the charge back to it from pool cash as the ordinary skew-restoring rebate, which the lifetime clamp caps at C, and the LPs who remain fund that payment from their deposits.

Brief/Intro

CloseAccountingLib.sol:112-114 gives the purpose of the lifetime VPI clamp:

Clamp so lifetime VPI (accrued + delta) never goes negative. Prevents LP sandwich attacks where an attacker opens at high depth, reduces pool depth, then closes to extract a net-negative lifetime VPI rebate.

The clamp does remove the trade-side profit of that sequence: here the attacker's lifetime VPI is exactly zero (asserted). The LP side of the same sequence still pays. Junior entry and exit are priced at the hourly epoch settlement, on a NAV that counts an open position's VPI charge as final pool revenue, and the position's close later pays that charge back to the trader. An account that is both a trader and a Junior LP does three things:

  1. Shortly before the settlement of its own exit epoch (19 s before the epoch boundary in the PoC, after the request cutoff), it opens a skew-increasing position and pays a VPI charge C into HousePool.
  2. It redeems its Junior shares at the settlement, at a NAV that includes C.
  3. It closes right after. The close restores the skew and earns the ordinary VPI rebate from pool cash, which the lifetime clamp caps at exactly C. The rebate is C in the base case and C − 0.87 in the constant-depth run, where the clamp does not bind; the attacker's gain differs by less than 1 USDG.

Its VPI nets to zero or slightly above, and its redemption carries θ·C, where θ is its share of Junior. The Junior LPs who remain pay the refund. The attacker's main cost is two 4 bps execution fees. At the skew cap C is about 0.2 % of the leg's notional and the two fees are 0.08 %, so the attack is profitable once θ is above about 0.4 at the release parameters.

Toy example (fees ignored):

  1. Junior holds 4,000 USDG: other LPs 1,000, attacker 3,000 (θ = 0.75).
  2. The attacker opens a skew-increasing position and pays VPI C = 40 into the pool. Junior NAV is now 4,040.
  3. At the exit settlement the attacker redeems 0.75 × 4,040 = 3,030.
  4. The attacker closes, and the skew-restoring rebate pays the 40 back from pool cash (the clamp caps it at 40). Its lifetime VPI is 0.
  5. The other LPs now hold 4,040 − 3,030 − 40 = 970. They lost 30 = θ·C, and the attacker gained 30.

Results of the attached Foundry test (the repository suite at a82d4fef, release parameters, one attacker address, public entrypoints only, constant price):

  • One cycle: the attacker nets +1,318.32 after fees. An independent 100,000 USDG Junior LP realizes 193.66 less than in the time-matched control. All other Junior holders lose 2,130.23 and the treasury receives 811.91. Senior is unchanged.
  • Three cycles at the three-hour minimum cadence: the attacker nets +3,957.82, other Junior holders lose 6,392.53, and the independent LP realizes 581.14 less.
  • Same gain without a depth drop: the attacker still nets +1,317.46 when an unrelated deposit keeps pool depth from falling, so the clamp does not bind (this is not the issue in AI scan items 30 and 31, which concern close-time depth changing the trader's VPI).
  • Minority attacker: with only A on line 40 of the test set to 900_000e6 (θ = 0.45), all four tests still pass. The attacker nets +105.70, +106.04 and +106.38 in the three cycles, and the independent LP realizes 53.02 less than in the control after one cycle (159.14 less after three).

Vulnerability Details

1. Junior entry and exit are priced on one post-reconcile principal

HousePool._settleLpEpoch reconciles once and prices both Junior redemptions and Junior deposits on the result:

Solidity
// src/HousePool.sol:835, :840-841, :915-916
_reconcile(accountingSnapshot, statusSnapshot);
...
juniorPhase.pricingPrincipal = juniorPrincipal;      // redemptions, funded at :881-888
juniorPhase.pricingSupply = _juniorShareSupply();
...
juniorDepositPhase.pricingAssets = juniorPrincipal;  // deposits, settled at :917-920
juniorDepositPhase.pricingSupply = _juniorShareSupply();

Reconcile measures distributable equity as physicalAssets + max(terminalDelta, 0) - traderClaims - max(-terminalDelta, 0) (src/libraries/HousePoolAccountingLib.sol:60-78).

  • physicalAssets is HousePool.totalAssets() (src/CfdEngineProtocolLens.sol:62-64; src/HousePool.sol:426-429).
  • terminalDelta is the LP-side marked price P&L of open positions. A positive receivable is capped per account at pnlPledgeAssets + traderClaimBalanceAssets (src/TerminalNavBookV2.sol:430-434), and a negative value is the amount owed to the trader. VPI is excluded from it by design (ACCOUNTING_SPEC.md:140-142).

A surplus first restores the Senior high-water mark and then goes to Junior. A shortfall is absorbed by Junior first (src/libraries/HousePoolReconcilePlanLib.sol:84-105; src/libraries/HousePoolWaterfallAccountingLib.sol:140-159, :167-184). Outside oracle-frozen hours the LP settlement fee is zero (src/HousePool.sol:1147-1155). So, with Senior at its high-water mark (the normal state), any VPI cash in the pool is Junior equity at the next settlement.

2. Open: the VPI charge becomes Junior equity

VPI is the change in cost(S) = k·S²/(2D) between the skew before and after a trade, at the current net depth D (src/CfdMath.sol:96-180; open depth at src/libraries/CfdEnginePlanLib.sol:448-449). On a skew-increasing open, the clearinghouse debits C plus the fee, credits the fee to the treasury and sends C to the pool (src/MarginClearinghouse.sol:1072-1103). The settlement sidecar books C as revenue:

Solidity
// src/CfdEngineSettlementSidecar.sol:454-463
if (delta.tradeCostAssets > 0) {
    uint256 poolCashInflowAssets = uint256(delta.tradeCostAssets) - protocolFeeCreditedAssets;
    if (poolCashInflowAssets > 0) {
        IHousePool(host.pool()).recordClaimantInflow(
            poolCashInflowAssets, IHousePool.ClaimantInflowKind.Revenue, IHousePool.ClaimantInflowCashMode.CashArrived
        );

CashArrived raises accountedAssets at once (src/HousePool.sol:640-642). The position records vpiAccrued = C.

3. Close: the skew-restoring rebate pays the charge back

Solidity
// src/libraries/CloseAccountingLib.sol:107-118
if (inputs.poolDepthAssets != 0) {
    state.vpiDeltaAssets = CfdMath.calculateVPI(
        inputs.preSkewAssets, inputs.postSkewAssets, inputs.poolDepthAssets, inputs.vpiFactor
    );
}
// Clamp so lifetime VPI (accrued + delta) never goes negative. Prevents LP sandwich attacks
// where an attacker opens at high depth, reduces pool depth, then closes to extract a
// net-negative lifetime VPI rebate. ...
if (state.proportionalAccrualAssets + state.vpiDeltaAssets < 0) {
    state.vpiDeltaAssets = -state.proportionalAccrualAssets;
}
  • Close VPI. A full close that restores the skew gets a fresh rebate at the close-time net depth (src/libraries/CfdEnginePlanLib.sol:1339-1341). At an unchanged price and a depth no higher than at the open, that rebate is at least C, so the clamp sets the close VPI to exactly −C. If depth is higher at the close, the rebate is below C and the trader pays the difference as net VPI.
  • Rebate payout. The net action amount (close VPI + fee + carry) is negative, so the pool pays it to the trader as an action rebate from free pool cash (src/libraries/CfdEnginePlanLib.sol:1041-1061, :970-978; src/CfdEngineSettlementSidecar.sol:621-624).
  • Close fee. On this net-rebate close the execution fee is netted against the rebate instead of being credited to the treasury (src/libraries/CfdEnginePlanLib.sol:1063-1073), so it stays in the pool.

4. Root cause

Settlement prices Junior shares as if an open position's VPI charge were final pool revenue, but the position's own close pays that charge back to its payer. A full close that restores the skew earns the ordinary VPI rebate, which the lifetime clamp caps at exactly C: the rebate is C in the base case, where depth has fallen since the open, and C − 0.87 in the constant-depth run, where the clamp does not bind and the attacker's gain is within 1 USDG of the base case. The trader's own VPI over the round trip is zero or slightly positive, as the clamp intends (SECURITY.md:1443); the defect is that a Junior exit is priced between the charge and its return. The reconcile snapshot has no term for the VPI that open positions can still recover at close. This has three consequences:

  • a Junior exit settled while such a charge is in the pool is overpaid by the leaver's share of it (θ·C is the leading term);
  • a Junior entry settled at the same time pays a NAV that includes the charge, and later bears its share of the refund;
  • the refund is later paid, pro rata, by whoever holds Junior at the close.

An account that is both trader and Junior LP can create the charge on demand and place its own exit between the charge and the refund.

5. Why existing controls do not stop it

  • Cooldown. The anti-flash control (WHITEPAPER.md:715-721) is the one-hour cooldown between deposit activation and a redemption request (src/TrancheVault.sol:38, :617-619, :1107-1111). The cycle respects it. The cooldown makes the cycle three hours long but does not change the amount moved.
  • Deposit size. Junior deposit requests are uncapped (src/TrancheVault.sol:1313-1326).
  • Execution. Order execution and LP settlement are permissionless (src/OrderRouter.sol:233-247, :474-484). The attacker executes its own orders and needs no other party.
  • Request cutoff. The five-minute cutoff (src/TrancheVault.sol:39, :545-556) does not stop it. Opening the leg after the cutoff keeps other Junior LPs out of the same exit, but it is not needed: opening it about an hour earlier moves the same amount (Impact Details).

6. One cycle, as run in the PoC

Activation epoch e (Monday 10:00Z in the PoC); one address; public entrypoints only.

Time Action Effect (PoC values, USDG)
e − 50 min juniorVault.requestDeposit(3,000,000) queued for epoch e
e + 10 s router.settleLpEpoch (any caller); claimDeposit shares at the fair NAV, no position open; θ = 0.7317
e + 1 h + 11 s requestRedeem(all shares) cooldown over; queued for epoch e + 2 h
e + 2 h − 20 s / − 19 s clearinghouse.deposit; router.commitOrder (LONG, 0.398 × net depth); own router.executeOrder after the e + 2 h cutoff; C = 4,039.25 enters pool cash
e + 2 h + 10 s router.settleLpEpoch; claimRedeem exit priced with C in Junior principal, fully funded
e + 2 h + 12 s / + 13 s commitOrder (full close); own executeOrder; withdraw depth 2.10M (5.10M at the open); fresh rebate 9,804.47; clamp: close VPI = −4,039.25

The next cycle activates at e + 3 h.

7. Fix direction

Recognize VPI in LP NAV only once it is final for its position:

  • Keep a signed aggregate of open positions' vpiAccrued, updated wherever vpiAccrued changes (open, increase, partial or full close, liquidation).
  • In the reconcile snapshot, treat its positive part as a liability: charges that the payer's close can still return.
  • Treat its negative part as a receivable: rebates already paid, backed one-for-one by the nonwithdrawable reserve.

A VPI round trip then leaves Junior NAV unchanged at every settlement, and entry and exit keep a single price. Changing fees, vpiFactor or the skew cap only moves the break-even share, and a longer cooldown only lengthens the cycle.

Impact Details

Single cycle against the control

test_lateVchg_singleCycle runs on a market that setUp builds through public LP routes: Junior 1,000,000 plus an independent 100,000 LP, Senior 1,000,000, and zero open interest. The attacker deposits 3,000,000. Control and attack run from one snapshot at identical timestamps (asserted).

USDG Control Attack Attack − control
Attacker net (wallet minus USDG minted to it) 0 1,318.319349 +1,318.319349
Independent 100k Junior LP, realized redemption 99,995.848841 99,802.191798 −193.657043
All non-attacker Junior holders, value at e + 2 h + 5 min 1,099,965.732704 1,097,835.498434 −2,130.234270
Senior 1,000,038.267295 1,000,038.267295 0
Protocol treasury 0 811.914921 +811.914921
  • Conservation. 2,130.234270 = 1,318.319349 + 811.914921 (residual 0 atoms).
  • Mechanism. The leg notional is 2,029,787.30 (0.398 × open depth 5,100,003.00, rounded down to 21,129 whole 100-token lots). C = 4,039.249092. Pool cash rose by exactly C at the open, and the close VPI is −C.
  • Attacker split. The LP leg made +2,942.195014: θ·C = 2,955.56 less the attacker's share of the two-hour Senior coupon. The trade leg made −1,623.875665: execution fees of 1,623.829842 and carry of 0.05.
  • Control. The independent LP's 4.15 shortfall is its share of the Senior coupon, and the treasury receives nothing. This market has no trading revenue.

Three cycles

test_threeCycles (activations at 10:00Z, 13:00Z and 16:00Z):

Cycle C Attacker, this cycle Other Junior vs control, cumulative Treasury, cumulative
1 4,039.25 +1,318.32 −2,130.23 +811.91
2 4,037.49 +1,319.27 −4,261.08 +1,623.48
3 4,035.74 +1,320.23 −6,392.53 +2,434.71

The independent LP then realizes 99,409.731226, against 99,990.867214 in the control (−581.135988). Senior is equal to the atom at every checkpoint, and the conservation residual is 0 atoms in every cycle.

Constant-depth run: the gain does not come from close-time depth

In test_constantDepthControl, an unrelated account requests a 3,000,000 Junior deposit for the exit epoch before the cutoff, before the leg exists. The deposit activates at the exit settlement, so depth at the close (5,101,101.09) is not below depth at the open (5,100,003.00).

  • Close VPI. It is −4,038.379579, the unclamped curve value (within 1 atom). The clamp does not bind, and the trader pays +0.87 net VPI.
  • Attacker. It still nets +1,317.455249, against +1,318.319349 when the clamp binds.
  • Who pays. The unrelated depositor, admitted at the C-inflated price, loses 2,360.19. Pre-existing Junior holders net +230.82, of which the independent LP +20.98. All non-attacker Junior holders together lose 2,129.37. Senior is unchanged and conservation is 0 atoms.

The loss falls pro rata on whoever holds Junior when the refund is paid. In the base case that is the incumbents; in this run it is mostly the entrant.

Leg opened before the cutoff: the timing is not the source

  • Change. Only line 179 of the attached test, to _openLeg(c, c.e + 1 hours + 30);. The leg then fills about 55 minutes before the request cutoff and an hour before the settlement. The printed header is fixed text and still says filled e+2h-19s.
  • Result. All four tests still pass. The LP leg again gains +2,942.20, and the attacker nets +1,313.84 against +1,318.32; the difference is about an hour of extra carry (4.48). The independent LP realizes 193.25 less than in the control.
<details> <summary>Feasibility under the program rules, and relation to documentation and known issues</summary>

Feasibility under the program rules

  • Capital. The program's Attack Investment Amount standard says: "A high capital requirement is generally not a valid reason to downgrade a report. Attacks requiring USD 100 million or more to execute are considered case by case."

    • The PoC uses 3,000,000 plus about 30,500 of trading collateral. The break-even is about 0.7 times the other Junior holders' capital.
    • The capital is not consumed. The deposit is in escrow from the request (50 minutes before activation here, at most 65) and returns at the exit, about two hours after activation. The collateral is in use for about 30 seconds.
    • Flash loans do not apply, because entries settle by epoch.
    • Each cycle earns the attacker about 0.04 % of the capital used.
  • Attacker risk. The program says: "Financial risk to the attacker only justifies a downgrade where the risk massively outweighs the reward. Low return on investment alone is not sufficient, and high risk alongside high return is not sufficient either." The position is open for about 30 seconds, and θ·C does not depend on price movement.

  • No special conditions.

    • One address, no privileged role, no oracle manipulation and no directional price prediction.
    • It uses only features active at launch (trading, the Junior tranche, permissionless keepers), at the release parameters in DEPLOYMENT.md, which the PoC sets and asserts.
    • Cycles run on trading days outside oracle-frozen windows, up to eight a day.
  • Not a majority or governance attack. The attacker's Junior share controls nothing; it only sets the attacker's pro-rata part of the overpaid exit, and no majority is needed. With only the constant A on line 40 of the attached test changed, all four tests still pass with every assertion, and conservation still holds to 0 atoms:

    A θ Attacker net per cycle (cycles 1, 2, 3) Independent LP, realized vs control (after 1 / 3 cycles)
    1_100_000e6 ~0.50 (0.5000-0.5003) +239.14, +239.54, +239.93 −68.05 / −204.23
    900_000e6 0.45 (0.4500-0.4502) +105.70, +106.04, +106.38 −53.02 / −159.14

    To reproduce, set line 40 to uint256 internal constant A = 1_100_000e6; (or 900_000e6) and run the PoC command; the printed labels are fixed text and still say 3,000,000 and 3M.

  • Containment. The rules allow a containment downgrade only with demonstrated monitoring coverage and response timing. The cycle creates no accounting inconsistency, since conservation is exact, and the leg is open for about 30 seconds around the settlement.

  • Scale. C is proportional to pool depth at a given skew ratio. At a fixed attacker share, the amount moved per cycle grows linearly with the pool.

Relation to documentation and known issues

Passage What it says Delta
Cash-basis VPI: ACCOUNTING_SPEC.md:140-142, :1064-1066; SECURITY.md:863, :871-872; WHITEPAPER.md:411-413, :811; public docs (docs.plether.com, source Plether-Fi/plether-app apps/gitbook/ at abb3aa962a0842d2187dbf44759c1e0b7ce5e595): liquidity-provider-quickstart.md:61, how-plether-works/trading-costs-fees-carry-and-vpi.md:132 VPI is a realized-settlement quantity outside the marked price book. A positive charge raises pool assets when paid and a rebate lowers them. Anticipated VPI and its reserve do not inflate NAV. Share value can rise with positive VPI. These passages describe the cash flows, which the PoC reproduces as written; the defect is their use as final equity in LP entry and exit pricing while the payer can still recover the charge at close. None of them covers an LP exit priced on a charge that the payer's close returns after that exit. The rebate side does get that protection: the reserve "cannot be extracted by LPs before its account obligation settles" (ACCOUNTING_SPEC.md:821-822; WHITEPAPER.md:887-888), and the public docs call open-time negative VPI "provisional" (trading-costs-fees-carry-and-vpi.md:198, :227). The positive side, which "a closing rebate can offset" (:225), is counted as final at once.
Collection-time ownership of carry: ACCOUNTING_SPEC.md:731-740; WHITEPAPER.md:966-977 Carry belongs to the shares outstanding when it is collected. The policy allows "a trader and incoming LP" to time collection after activation and share carry accrued before entry. It "is a collection-time ownership policy, not a claim that timing cannot transfer part of old carry revenue to a new LP". The acceptance is limited to carry, which differs on each point that matters. Carry is accrued rent that the trader owes whatever the timing. Once collected it is final revenue, bounded by organic accrual. Timing only changes which LPs share a gain: incumbents receive less revenue, never less than their capital. The VPI charge here is created on demand by the attacker and paid back to it by its own close after its exit, so it never becomes final revenue. The refund is paid out of the remaining LPs' deposited capital. This market has no revenue to share (see the control), yet with the attack the independent LP loses 193.66 of principal. The documents contain no VPI counterpart of this acceptance.
LP request cutoff: SECURITY.md:1036-1065, in particular :1044-1048; ACCOUNTING_SPEC.md:228-229; WHITEPAPER.md:679-681 The five-minute cutoff is a maximum-membership quiet period, "not an immutable settlement snapshot". Before settlement, "trading, closes, liquidations, claims, carry, and pool accounting can change NAV". Monitors treat request totals as upper bounds. The attack does not depend on this passage. Opening the leg about 55 minutes before the cutoff moves the same amount (attacker +1,313.84, independent LP −193.25; see Impact Details); late timing only removes price exposure and the incumbents' chance to react. The passage describes NAV changes that every holder in the epoch bears alike. The defect is that this change is counted as final although the payer's close returns it right after the settlement. So the leaving LP is overpaid, and an entering LP overpays (constant-depth run). This section is documentation; it is not one of the SECURITY.md sections listed as known issues.
Epoch timing: WHITEPAPER.md:734-746, :1793-1796 Entry and exit consume one snapshot. Epochs "do not remove ordinary timing and liveness risk", and requests have no share-price limit. Entry and exit are priced alike, as stated. The problem is what that snapshot counts as equity. Timing risk is a requester's exposure to genuine NAV moves before settlement. Here an LP creates the NAV move itself, and its own close reverses it after the settlement.
VPI path dependence: WHITEPAPER.md:859-869, :1777-1780 Changing depth and lifetime clamps alter VPI path outcomes. These passages are about the trader's VPI amount. Here it is exactly 0 when the clamp binds, and +0.87 (paid by the trader) when depth does not fall.
Known issue, SECURITY.md Known Limitations: VPI limitations :1434-1444, including :1443 "the lifetime clamp intentionally zeroes otherwise extractable rebate-only round trips"; LP accounting limitations :1380-1399 Trader-side VPI rules; LP accounting caveats. The VPI bullets describe the trader-side VPI amount, which behaves as documented: zero over the round trip when the clamp binds, and +0.87 (paid by the trader) when it does not. The LP accounting bullets cover mark freshness, receivables versus cash, the non-upgradeable terminal book, frozen settlement, backlog passes, the Senior coupon cap, Senior limits and reservations, and cooldown lot timestamps. None addresses VPI in LP pricing, or LP timing around open positions' VPI. The cycle respects the cooldown rules at :1396-1399. The other Known Limitations subsections (oracle and market-closure :1330-1342, Router and keeper :1343-1379, LP claim and allocation :1401-1420, rounding :1421-1433, clearinghouse :1446-1457) and the separately listed live basket component selection (:687-700) do not address VPI in LP pricing either.
Known issue, AI scan items 30 and 31: "Temporary pool liquidity can reduce a skew-increasing close charge" and "Temporary pool-liquidity reduction can amplify a skew-reducing close rebate" (audits/scan-plether-fi-plether-core-d4541b49.md:1693-1741, :1742-1810) Close VPI uses execution-time depth. An LP/trader that moves liquidity around its own close can lower a close charge, or enlarge a close rebate within the clamp. Measured, not argued. When depth falls, the close VPI is exactly −C (the clamp binds). When an unrelated deposit keeps depth at the close above depth at the open, the close VPI equals the unmanipulated curve value and the trader pays +0.87 net VPI. The attacker's gain is nearly the same in both runs (+1,318.32 and +1,317.46). It is realized through the Junior redemption price at settlement, which neither item mentions.
Known issue, Arbitrum and Pyth clock alignment (HIGH-1) A trader may commit after a price is published and be filled at it. Not used. The PoC runs at one constant price with zero confidence, and the gain θ·C − fees does not depend on the price (the leg is sized as a fraction of depth).
Cecuro AI audit; SC Audit Studio pre-audit n/a Neither report has a finding on LP entry or exit pricing against open positions' VPI.
</details>

Variants of the same root cause (not separate findings)

Entry side. The same gap works when the attacker enters rather than exits.

  • Mechanism. A skew-reducing open receives a VPI rebate R from pool cash, while the matching reserve stays in the clearinghouse outside NAV (src/CfdEngineSettlementSidecar.sol:442-444, :466-477; src/libraries/CfdEnginePlanLib.sol:343-349). A Junior deposit settled while R is outstanding enters at a NAV lowered by R. The close then charges at least R back into the pool (src/CfdEngineSettlementSidecar.sol:604-613, :690-693).
  • Precondition. It needs existing one-sided skew from other traders, which the PoC market does not have.
  • Result. Not demonstrated in the attached test; not claimed here.

Both directions in one LP round trip. A rebate leg before the entry and a charge leg before the exit add up, and with organic skew this lowers the break-even share. Not claimed here.

The fix direction above (an aggregate of open positions' lifetime VPI in the reconcile snapshot) covers both variants.

References

Repository links are at commit a82d4fefb02768e5b3bddcc97dee371eee24fea8; public-docs links are at Plether-Fi/plether-app commit abb3aa962a0842d2187dbf44759c1e0b7ce5e595.

The original report as published on Immunefi, by skydev. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the LP settlement snapshot treats an open position's VPI charge as final equity, with no term for the VPI that the payer can still recover when it closes.

Impact

Other Junior LPs lose deposited principal each cycle (about 2,130 USDG in the single-cycle PoC, with the attacker netting about 1,318 USDG), while Senior is unchanged; the one-hour cooldown and five-minute cutoff only lengthen or re-time the cycle and do not prevent it.

What the attacker needed

A Junior LP position; enough capital to hold a large Junior share; ability to trade on the same market; no privileged role needed

The fix

It should be fixed by recognising VPI in LP NAV only once it is final for its position, treating open positions' positive accrued VPI as a liability and its negative part as a receivable in the reconcile snapshot.

How it was found

  1. Request a Junior deposit and let it activate at the epoch settlement, giving the attacker a large share of Junior.
  2. Request a redemption of all shares and wait out the one-hour cooldown so it queues for a later epoch.
  3. Shortly before that exit epoch settles, open a skew-increasing position so a VPI charge enters pool cash.
  4. At the exit settlement, redeem the shares at a NAV that includes the charge.
  5. Close the position right after, receiving the skew-restoring rebate capped at the charge.
  6. Withdraw the funds; the remaining Junior LPs bear the refund.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A liquidity provider (LP) puts money into a shared pool and gets shares whose value should reflect the pool's real assets. Here the pool briefly counted a fee paid by a trader as if it were permanent income, so shares looked more valuable than they really were. The same trader then got that fee back when closing the trade, leaving the other LPs short.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by skydev

View all

4 more disclosed reports, best first.

More from Plether

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.