-
Notifications
You must be signed in to change notification settings - Fork 133
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
Bigz/update amm revenue pool logic #398
Conversation
tests/delistMarket.ts
Outdated
@@ -614,7 +614,9 @@ describe('delist market', () => { | |||
'totalExchangeFee:', | |||
marketAfter.amm.totalExchangeFee.toString() | |||
); | |||
assert(marketAfter.amm.feePool.scaledBalance.eq(new BN(21567000))); | |||
// assert(marketAfter.amm.feePool.scaledBalance.eq(new BN(21567000))); |
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.
delete?
market | ||
.insurance_claim | ||
.quote_settled_insurance | ||
.safe_add(market.insurance_claim.quote_max_insurance)? |
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.
why is this add?
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.
both numbers are positive cumulative numbers for insurance
cumulative liquidation fees are only given for revenue pool up to the current external insurance levels provided + net losses already paid for by external insurance
.safe_sub(market.amm.total_fee_withdrawn.cast()?)? | ||
let fee_pool_threshold = amm_fee_pool_token_amount_after | ||
.saturating_sub( | ||
FEE_POOL_TO_REVENUE_POOL_THRESHOLD.safe_add(market.amm.total_social_loss)?, |
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.
why do you add social loss here?
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.
if a market has had social loss, its indication it needs to maintain a larger fee pool for internal insurance (rather than giving to external insurance)
This reverts commit abb34e4.
No description provided.