Skip to content

Commit

Permalink
fix docstring of get_current_price and add record to CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nikanor.goreglyad committed Jul 29, 2024
1 parent 2e230b5 commit 3e76bf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

## [Unreleased]

### Added

- Implemented price caching mechanism in `get_current_price` function to reduce unnecessary oracle calls within the same block.

## [1.3.1] - 2024-06-03

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions src/amm_core/oracles/agg.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ mod OracleAgg {
};

// @notice Returns current spot price for given ticker (quote and base token)
// @dev This function first checks if a price has been cached in the current block.
// If so, it returns the cached price to avoid unnecessary oracle calls within
// the same block. This optimization reduces external calls and gas costs.
// @param quote_token_addr: Address of quote token in given ticker
// @param base_token_addr: Address of base token in given ticker
// @return current_price: Current spot price
Expand All @@ -36,9 +39,6 @@ mod OracleAgg {
}

// @notice Returns terminal spot price for given ticker (quote and base token)
// @dev This function first checks if a price has been cached in the current block.
// If so, it returns the cached price to avoid unnecessary oracle calls within
// the same block. This optimization reduces external calls and gas costs.
// @param quote_token_addr: Address of quote token in given ticker
// @param base_token_addr: Address of base token in given ticker
// @return terminal_price: Terminal spot price
Expand Down

0 comments on commit 3e76bf7

Please sign in to comment.