Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BRAH-70] Add Lyra Avalon Integration #49

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open

Conversation

Pradeep-selva
Copy link
Member

No description provided.

@Pradeep-selva Pradeep-selva requested a review from Bapi-Reddy July 6, 2022 13:30
contracts/LyraExecutor/LyraPositionHandler.sol Outdated Show resolved Hide resolved
contracts/LyraTradeExecutor.sol Outdated Show resolved Hide resolved
contracts/LyraL2/LyraController.sol Show resolved Hide resolved
contracts/LyraL2/LyraPositionHandlerL2.sol Outdated Show resolved Hide resolved
contracts/LyraL2/LyraPositionHandlerL2.sol Outdated Show resolved Hide resolved
contracts/LyraL2/LyraPositionHandlerL2.sol Outdated Show resolved Hide resolved
contracts/LyraL2/LyraController.sol Outdated Show resolved Hide resolved
contracts/LyraL2/LyraController.sol Outdated Show resolved Hide resolved

if (positionData.state == LyraAdapter.PositionState.ACTIVE) {
(uint256 callPremium, uint256 putPremium) = LyraAdapter
._getPurePremiumForStrike(currentPosition.strikeId);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bapi-Reddy this wont work for getting option price. What do we do in this case? For position in want token

sUSD.approve(address(lyraOptionMarket), sUSDBal);

if (updateExistingPosition) {
optionType = currentPosition.optionType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the previous purchased option amounts


sUSD.approve(address(lyraOptionMarket), sUSDBal);

if (updateExistingPosition) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test this condition in unit tests

"NOT_ENOUGH_TOKENS"
);

if (amountOut > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a unit test for amountOut == 0

Comment on lines 24 to 25
INonfungiblePositionManager public constant nonfungiblePositionManager =
INonfungiblePositionManager(0xC36442b4a4522E871399CD717aBDD847Ab11FE88);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

@@ -0,0 +1,73 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants