-
Notifications
You must be signed in to change notification settings - Fork 3
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
trader view precompile #181
base: isolated-margin
Are you sure you want to change the base?
Conversation
func getRequiredMargin(stateDB contract.StateDB, baseAsset *big.Int, price *big.Int, marketId int64, trader *common.Address) *big.Int { | ||
quoteAsset := hu.Div1e18(hu.Mul(hu.Abs(baseAsset), price)) | ||
return getRequiredMarginForQuote(stateDB, GetMarketAddressFromMarketID(marketId, stateDB), trader, quoteAsset) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yo keep it consistent with the structure in contracts, how about moving this function to traderViewer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah kept it here to avoid code duplication in juror and traderView but I see your point. moved it to traderViewer
Why this should be merged
Trader View Precompile to read trader account data.