Skip to content

[BRAH-70] Add Lyra Avalon Integration#49

Open
Pradeep-selva wants to merge 63 commits into
masterfrom
ft-avalon
Open

[BRAH-70] Add Lyra Avalon Integration#49
Pradeep-selva wants to merge 63 commits into
masterfrom
ft-avalon

Conversation

@Pradeep-selva

Copy link
Copy Markdown
Member

No description provided.

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

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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