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

Feature/restructure market creation incentives #62

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

Conversation

udkreddySomish
Copy link
Collaborator

@udkreddySomish udkreddySomish commented Oct 20, 2020

MarketRegistry contract to be upgraded with new implmentation.
Market creation incentives to be now distributed as per the estimate of gas cost of the market creation transaction.
Incentives will be transaction cost worth of PLOT(as per the price prevailing at the time of market creation)
Fast gas price to be fetched from Chainlink Fast gas/ GWei aggregator
Formulae for incentive calculation: min(gas price given, chainlinkfeed*1.25, max Gas price)* gasUsed for tx worth of PLOT
1.25 is to be considered as maximum deviation of fast gas price from Chainlink aggregator.
gas price given is the gas price set by user while signing the transaction
max Gas price is pre set configurable variable of value 100GWei
A part of reward pool of market will also be distributed to market creator only if leveraged participation of market reches threshold of 1Eth(Configurable)
Formulae for Percent of market reward pool to be distributed to market creator
Minimum( maxRewardPoolPercForMC, (minRewardPoolPercForMC + tokensLocked/plotStakeForRewardPoolShare))
maxRewardPoolPercForMC: Maximum reward pool share percent(configurable)- Default: 5%
minRewardPoolPercForMC: Minimum reward pool share percent(configurable)Default: 0.5%
tokensLocked: Tokens staked by market creator for reason SM
plotStakeForRewardPoolShare: Minimum plot stake required to increase reward pool share% (configurable)Default: 25000PLOT

contracts/MarketRegistryNew.sol Show resolved Hide resolved
contracts/MarketRegistryNew.sol Outdated Show resolved Hide resolved
contracts/MarketRegistryNew.sol Outdated Show resolved Hide resolved
contracts/mock/MockChainLinkGasPriceAgg.sol Show resolved Hide resolved
IMarket(penultimateMarket).settleMarket();
}
if(marketCreationData[_marketType][_marketCurrencyIndex].marketAddress != address(0)) {
(,,,,,,,, uint _status) = getMarketDetails(marketCreationData[_marketType][_marketCurrencyIndex].marketAddress);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Making marketStatus() public and then directly using that instead of this generic function will save a decent chunk of gas. However, that'll only work for new markets.

contracts/MarketRegistryNew.sol Show resolved Hide resolved
contracts/MarketRegistryNew.sol Show resolved Hide resolved
contracts/MarketRegistryNew.sol Show resolved Hide resolved
contracts/MarketRegistryNew.sol Outdated Show resolved Hide resolved
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.

Incentives for market creation o be calculated based on gas price
2 participants