Adrena
  • About Adrena
    • ๐Ÿ‘๏ธVision
    • ๐Ÿ’‰What is Adrena?
      • โœจNo Liquidation Fees
      • ๐Ÿซ—Peer-to-Pool Perp Model (and the risks as a Liquidity Provider)
      • ๐Ÿ‹๏ธTrading Competitions
        • 0๏ธโƒฃPre-Season: Awakening
        • 1๏ธโƒฃSeason 1: Expanse
      • ๐Ÿ’ฝRPC and Trade Execution
    • ๐Ÿง€Fees
      • ๐Ÿ’ฐRevenue Sharing
      • ๐ŸฏWays to Earn Overview
      • ๐Ÿ’ฑBuybacks
    • ๐Ÿ‘พTrader Profile
    • ๐Ÿ“–Achievements
    • ๐ŸงชMutagen (Points System)
    • ๐ŸคReferral System
    • Audits
    • Bug Bounty Program
    • ๐Ÿ”—Useful Links
  • Tokenomics
    • ๐ŸซฆTokenomics Overview
    • ๐Ÿช™ADX
      • ๐Ÿค‘Distribution
      • ๐Ÿ’ธEmissions
      • ๐Ÿ‘ฅForms of ADX
      • ๐ŸฆบVesting
      • ๐ŸšฐStaked ADX - Rewards Emissions Schedule
      • ๐Ÿ”Staking and Duration Locked Parameters for ADX
      • ๐Ÿ—ณ๏ธVoting
    • ๐Ÿ’ŽALP
      • ๐ŸŒŠGenesis Liquidity [terminated]
        • ๐Ÿ’ฆGenesis Liquidity Program [Terminated]
      • ๐ŸšฐStaked ALP - Rewards Emissions Schedule [Terminated]
      • ๐Ÿ”Staking and Locked Stake Parameters for ALP
  • Technical Documentation
    • ๐Ÿ‘คGovernance Shadow Token
    • ๐Ÿค–MrSablier & MrSablierStaking (Open Source Keepers)
    • ๐Ÿ”ฎOracles and Price Feeds
    • โ˜ข๏ธ"Toxic Flow" Countermeasures
    • ๐Ÿช–Position Parameters
    • โŒšSablier Automation Threads (deprecated)
    • ๐ŸฆStaking Implementation Details
    • Terms and Conditions
    • Token Terms and Conditions
  • Guides
    • ๐Ÿ’ปHow to Change to Devnet in Phantom Wallet
    • ๐Ÿ’งHow to get Devnet SOL
    • ๐Ÿ’ฐHow to Get Tokens to Trade
    • ๐Ÿ“ˆHow to Open and Close a Trade
  • Reports
    • 21/11/2024 - BE - Increase Position, position.price miscalculations
    • 22/10/2024 - Upgrade staking accounting issue causing extra reward distribution
    • 12/10/2024 - BE - Borrow fees reset on position increase
    • 01/10/2024 - BE - Custody internal state for `Assets` reports too much locked collateral
    • 27/09/2024 - BE - Missing accounts reload during fee distribution
Powered by GitBook
On this page
  • Impact
  • Resolution
  • Details
  1. Reports

21/11/2024 - BE - Increase Position, position.price miscalculations

PreviousHow to Open and Close a TradeNext22/10/2024 - Upgrade staking accounting issue causing extra reward distribution

Last updated 5 months ago

Timeline

Offside labs, who are currently doing our second audit, contacted us at 9:28โ€ฏam UTC through telegram about the issue.

We acknowledged at 9:29โ€ฏam and confirmed the issue by 10:30. At 10:51:20 UTC we deployed and disabled the Increase on the program as a temporary safety measure.

We worked on a permanent fix, reviewed by Offside Labs, that was .

What

We increasing a position (long or short) the calculation that recalculated the average entry price did not take into account the current PnL and so user were loosing PnL on increase (based on the increase size and price diff between open and increase)

Impact

User loosing PnL, pool profiting. Data : - 18,1% of positions did an increase over the affected period - 29.8% of total trade volume was from positions that has had an increase during their lifespans Roughly 900 positions affected. Some user have up to 61 increase on a single position (Bonk, chasing scarce liquidities). Issue was only causing losses for users (the PnL was reduced). Total of 191 users affected : - 88 users with more than $1 deficit - 45 users with more than $10 deficit - 21 users with more than $100 deficit - 3 users with more than $1000 deficit Total deficit for users $18,881

Resolution

  • Updated the calculation that now take into account the PnL

Now the main resolution will be about what do we do to compensate users. Do we compensate users fully or partially, etc. This will be up for discussion in a proposal.

Details

issue found: Offside Labs issue fix: Orex and Corto patch in: Release/19 - Adrena Program v1.1.5 and 6 proposal url:

a hotfix
deployed at 14:23 UTC
https://dao.adrena.xyz/dao/AdrenaDAO/proposal/99bni5Vxb9NdR2XtYqigXuWqsXqzTXorx6ae8gG2pnkU