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
  • What
  • Impact
  • Details
  1. Reports

27/09/2024 - BE - Missing accounts reload during fee distribution

Previous01/10/2024 - BE - Custody internal state for `Assets` reports too much locked collateral

Last updated 7 months ago

What

The smart contract uses an internal version of the swap to convert the collateral into USDC without fee in order to send them to the staking for rewards accrual. At some point in the code there are 2 successive calls to this internal swap, and so accounts must be reloaded in between to keep track with the state. We do so, but missed 2 accounts reloads after transfers. You swap open a Bonk long posting WBTC collateral, a swap is made to convert your WBTC to Bonk. You have generate 3 satoshis in swap fees, we swap these internally into USDC. These USDC are then sent to the reward vault for staking. The issue in the code would cause the total USDC sent to the rewards to be slightly higher or lower, but of the order of magnitude of a slight percentage on swap fees. (+/- ~10-100$).

Impact

This could cause issue if the amount was overall lesser, if all user were to theoretically claim reward for these rounds, as there would be missing a few $ for the last users. If this happen some day we will just send USDC to that account for resolution.

Details

issue found: Corto, trying to increase a Jitosol long with WBTC issue fix: Orex and Corto patch in: Release/5 - Adrena Program v1.0.3 on 27/29/2024 proposal url:

https://dao.adrena.xyz/dao/AdrenaDAO/proposal/9YyYNWvHyzBzWRESq4dQV92uN7DJ4PsTCSX1Wq4kEMWn