Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Dependancy on external price feeds #20

Open
zhiqiangxu opened this issue Dec 6, 2020 · 0 comments
Open

Dependancy on external price feeds #20

zhiqiangxu opened this issue Dec 6, 2020 · 0 comments

Comments

@zhiqiangxu
Copy link

The whitepaper says: Maintenance and execution of hedge contracts do not depend on the external price feeds.

But the code of payProfit is:

    function payProfit(Option memory option)
        internal
        override
        returns (uint profit)
    {
        uint currentPrice = uint(priceProvider.latestAnswer());
        require(option.strike <= currentPrice, "Current price is too low");
        profit = currentPrice.sub(option.strike).mul(option.amount).div(currentPrice);
        pool.send(option.holder, profit);
        unlockFunds(option);
    }

If the price feed is wrong, hegic will send huge amount of token by mistake.

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

No branches or pull requests

1 participant