Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ampleforth/spot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.1
Choose a base ref
...
head repository: ampleforth/spot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 10 commits
  • 126 files changed
  • 4 contributors

Commits on Aug 23, 2023

  1. Configuration menu
    Copy the full SHA
    2bd0c0e View commit details
    Browse the repository at this point in the history
  2. ran linter

    aalavandhan committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    d3aacb8 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2023

  1. Subgraph setup (#108)

    * setup subgraph repo
    
    * rollover vault subgraph
    
    * fixed hold amt math
    aalavandhan authored Sep 5, 2023
    Configuration menu
    Copy the full SHA
    d6867b1 View commit details
    Browse the repository at this point in the history
  2. Bump coverallsapp/github-action from 2.2.1 to 2.2.2 (#175)

    Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.1 to 2.2.2.
    - [Release notes](https://github.com/coverallsapp/github-action/releases)
    - [Commits](coverallsapp/github-action@v2.2.1...v2.2.2)
    
    ---
    updated-dependencies:
    - dependency-name: coverallsapp/github-action
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 5, 2023
    Configuration menu
    Copy the full SHA
    522364d View commit details
    Browse the repository at this point in the history
  3. Bump actions/checkout from 3 to 4 (#174)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 5, 2023
    Configuration menu
    Copy the full SHA
    870cffd View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Bump coverallsapp/github-action from 2.2.2 to 2.2.3 (#176)

    Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.2 to 2.2.3.
    - [Release notes](https://github.com/coverallsapp/github-action/releases)
    - [Commits](coverallsapp/github-action@v2.2.2...v2.2.3)
    
    ---
    updated-dependencies:
    - dependency-name: coverallsapp/github-action
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 15, 2023
    Configuration menu
    Copy the full SHA
    98cc7fa View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2023

  1. Bump actions/setup-node from 3 to 4 (#179)

    Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
    - [Release notes](https://github.com/actions/setup-node/releases)
    - [Commits](actions/setup-node@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-node
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 30, 2023
    Configuration menu
    Copy the full SHA
    d877928 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2024

  1. Configuration menu
    Copy the full SHA
    2b5879b View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. Update README.md (#200)

    Added security contact
    aalavandhan authored Mar 13, 2024
    Configuration menu
    Copy the full SHA
    88f0aaa View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. V3.0.0 (#193)

    * Added perp redemption to vault recovery flow (#159)
    
    * added perp redemption to vault recovery flow
    
    * perp external functions returning ops data
    
    * added natspec comments and renamed rollover preview struct
    
    * refactors bond and tranche helpers, added a new method to compute proportional tranche balances
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * meld method on rollover vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * added todos
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Apply suggestions from code review
    
    Co-authored-by: Brandon Iles <[email protected]>
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed duplicate implementation
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * unit tests for meld
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved unused contracts to  folder
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * imported sigmoid utility
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Fee strategy 2.0
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp changes for fee strategy 2.0
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated unit tests with the new fee scheme
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Apply suggestions from code review
    
    Co-authored-by: Brandon Iles <[email protected]>
    Co-authored-by: nms-7 <[email protected]>
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated fee strategy
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * using a normalized factor to compute sigmoid, rather than using a different target
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Update spot-contracts/contracts/strategies/FeeStrategy.sol
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * using explicit cast instead of abs
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed holding pen and discount math from perp
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp cleanups, removed unused revert paramters
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated peripheral contracts with the new fee mechanism and rollover scheme
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated fee strategy to compute tranche ratios based on senior most tranche, rather than using discount adjusted ratios
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated unit test suite
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed deprecated fee strategy interface functions
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * deleted deprecated contracts
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Apply suggestions from code review
    
    Co-authored-by: Brandon Iles <[email protected]>
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated rollover math condition
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed dirty diff from rebase
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * deleted unused contracts
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated sigmoid utility, imported two pow code
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * replaced == 0 conditions with <= 0
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * reverted exp val snapping
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * imported two pow tests
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * handling zero vault deposit/redeem
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * cleaned up error codes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated fee (monetary) policy for spot
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated bond issuer
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated perp
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed meld from rollover vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault code cleanup and private fn refactor
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault v2 storage update, mint redeem and deployment fees
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved rollover vault to parent dir
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Apply suggestions from code review
    
    Co-authored-by: Brandon Iles <[email protected]>
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy terminology updates and review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * review pass, removed annualized rollover fees, comment and naming updates
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * code review updates
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault allows 2-way swap between perps and underlying
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * subscription aware fee policy for swapping, using minting bond as the source of truth for tranche ratios
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed unused interface fn from bond issuer
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy updates for perp, skipping fees when used by vault, reverting to only one authorized roller ie vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * utility to calculate ampl required to create x perps
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * error and comment cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated swap fee logic
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * code review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Apply suggestions from code review
    
    Co-authored-by: Brandon Iles <[email protected]>
    Signed-off-by: aalavandhann <[email protected]>
    
    * code review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed perp as a vault asset, and redeeming perps only on swaps
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * simplified fee policy interface, accepts sr instead of computing it
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Perp removed external pricing strategy and optimized tranche value computation
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Vault clean up, function reorg and optimized tvl comp
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Assuming that incoming tranches withold no fees, thus removing all bw fee related math
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * interface cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy: code review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp: code review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault: code review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * interface: code review fixes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed string require errors infavor of custom errors
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * feePolicy: updated fee policy interface
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp: new fee policy interface, view methods regorg, skipping update state when paused, optimized cdr
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault: handling dust
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault: new fee policy interface, variable caching and tvl optimization, recoverAndRedeem and view methods reorg
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * unit tests
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy: code review fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp: code review fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy: updated dr condition
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault : code review fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * code review fix: unit-tests, perp expects valid vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * reorg return data
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * redemption amt calc optimization, assuming bond has only 2 tranches
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * code review fix for commit 1&2
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated lisc
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Renamed fee variable
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved keeper only methods to its own section
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved rollover vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * ran linter
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * bumped up solidity version to 0.8.20
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated hyper-param methods, removed logs & zero checks
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * comment fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * nonReentrant updateState
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * set keeper in init method
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * comment update
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * made transfer fn nonReentrant
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * returning instead of reverting in deposit,redeem and rollover
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved value fn into perp
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed perp supply zero check on burn computation
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Removed reserve count method
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed multiple reads
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * refactored rollover condition
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed paramter from rollover amt
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed one time use variable
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed zero price check
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * added comment
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed zero check
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * added else if
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * flipped rollover condition
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved perp supply call into compute redemption amt method
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Renamed fee policy variable
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * added fee initiailzier
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * router preview deposit update return struct
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed approve 0
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * added back perp rollover zero price check for safety
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * router assumming bond has only 2 tranches
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy update, dr bounds
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved rollover vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault init cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * minUnderlyingBal check
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed address(0) check in updateFeePolicy
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * non-reentrant transferERC20
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed virtual updateKeeper
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed deployedAmt from deploy
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * rollover typo fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault sync refactor
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * rollover gas optimizaiton, removed storage read for
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * rollover performs tranche cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * made MAX_DEPLOYED_COUNT uint8
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * recover comment fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault deposit/redeem return zero instead of reverting
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * renamed totalSupply_ to noteSupply
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed whenNotPaused from recover and redeem
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * using safeTransfer for transfer
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed _enforceVaultComposition
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed MIN_SWAP_UNITS check
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * min underlying perc in vault
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * renamed perp and vault share fee variables
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault get tvl cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * tranche helpers cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed deployed count and deployed at
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * comment update
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * assuming bond has only two tranches, thus bond-tranches data structure has fixed len arrays
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * increased vault's dust amt
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * meld perps style change
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault comment fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed comment vault
    
    n
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault using cached variable
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * cleaned up perp mint estimation, added comments
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * sync asset made into online fn
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed bond duration method
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * bond helpers using return val for getSeniorTranche
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fixed sigmoid condition
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Ran linter
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed bond/tranche double check in favor of one check for bond validity
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fixed bug, with underlying perc calc after swap
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * using cached value of reserve count
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp: renamed rollout condition and fixed order of checks in
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed duplicate comment in bond helpers
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp enforcing max len for reserve and using uint8 for reserve len,  returning only tokens up for rollover
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fee policy cleanup
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * perp defensive check on rollover
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault enforcing liquidity constraints on both swap functions
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * bond helper minor style fix
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated testcases, back to full coverage
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * vault: removed redundant sync with redeem tranches on meld and rollover
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fixed router bug, with undeployed bonds
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * removed returns in bond helper
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Fee delta update
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated variable name
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * updated tasks with the new interface
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * testnet deployment
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * Pre release fixes (#199)
    
    * using fixed perc fees for ops
    
    * removed some unreachable code
    
    * added test case to check for dust recovery
    
    * removed vault deployment fee
    
    * pve002 router validation
    
    * pve004 preview deposit mature bond handling
    
    * Removed from paramters from asset transfer wrapper functions and using msg.sender directly, also using msg.sender instead of _msgSender
    
    * ran linter
    
    * updated unit tests
    
    * pve001 updating constructors
    
    * pve002-3 bond issuer tranche granularity check
    
    * Removed redundant computeDeviationRatio method from fee policy
    
    * openzeppelin defender report informational issues
    
    * Reverted pve002
    
    * deployed to sepolia testnet (#201)
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * fixed liner issue
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * V2 final updates (#204)
    
    * updated sigmoid bound for 20% yearly rollover rate
    
    * updated LICENSE
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * natspec comment updates for variable reanmes
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * moved hyper paramter controls to keeper
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * a few more unit tests to improve coverage
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * upgrade tasks
    
    Signed-off-by: aalavandhann <[email protected]>
    
    * v2 deployment
    
    Signed-off-by: aalavandhann <[email protected]>
    
    ---------
    
    Signed-off-by: aalavandhann <[email protected]>
    Co-authored-by: Brandon Iles <[email protected]>
    Co-authored-by: nms-7 <[email protected]>
    3 people authored Apr 16, 2024
    Configuration menu
    Copy the full SHA
    be85d76 View commit details
    Browse the repository at this point in the history
Loading