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

Create the fee engine #2003

Merged
merged 6 commits into from
Jul 21, 2020
Merged

Create the fee engine #2003

merged 6 commits into from
Jul 21, 2020

Conversation

jeremyletang
Copy link
Member

This implements the first fee engine and the logic to get the fee for the continuous trading.

close #1894

@jeremyletang jeremyletang requested a review from a team July 20, 2020 18:46
@jeremyletang jeremyletang force-pushed the feature/1894-create-fee-engine branch from 086ab3c to c704cff Compare July 20, 2020 18:52
@vega-ci-bot
Copy link
Collaborator

system-tests failed.

=== Test summary ===
../../grpcTesting/accounts/accountsTests.py .                            [100%]
../../grpcTesting/governance/newAssetTests.py .                          [100%]
../../grpcTesting/governance/newMarketGovTests.py EEEEEEEEEEEEEEEEEEEEEx [ 47%]
EEEEEEEEEEEEEEEEEEEEEEEE                                                 [100%]
 ERROR at setup of testVoteNDecline 
 ERROR at setup of testVoteYEnactedFail 
 ERROR at setup of testVoteYNProposalDraw 
 ERROR at setup of testVoteYYNProposalPass 
 ERROR at setup of testNewMarketRejectNoStake 
 ERROR at setup of testNewMarketValidProposal 
 ERROR at setup of testGetAllProposals 
 ERROR at setup of testGetAllOfTheProposals[6] 
 ERROR at setup of testGetNewMarketProposals[6] 
 ERROR at setup of testGetAllOfTheProposals[2] 
 ERROR at setup of testGetNewMarketProposals[2] 
 ERROR at setup of testGetAllOfTheProposals[5] 
 ERROR at setup of testGetNewMarketProposals[5] 
 ERROR at setup of testGetAllOfTheProposals[4] 
 ERROR at setup of testGetNewMarketProposals[4] 
 ERROR at setup of testGetAllOfTheProposals[3] 
 ERROR at setup of testGetNewMarketProposals[3] 
 ERROR at setup of testGetProposalsByParty 
 ERROR at setup of testGetRejectedProposalsByParty 
 ERROR at setup of testGetOpenProposalsByParty 
 ERROR at setup of testGetVotesByParty 
 ERROR at setup of testNewMarketOpenSingleTok 
 ERROR at setup of testVoteYSmallHolder 
 ERROR at setup of testVoteYMediumNSmallHolder 
 ERROR at setup of testVoteTopUpSmallDuringVote 
 ERROR at setup of testVoteYNNoFundsProposal 
 ERROR at setup of testNewMarketInvalidParty 
 ERROR at setup of testInvalidEnactTime 
 ERROR at setup of testVoteYOwnOpenProposal 
 ERROR at setup of testVoteYOpenProposal 
 ERROR at setup of testVoteNOpenProposal 
 ERROR at setup of testVoteNoStakeOpenProposal 
 ERROR at setup of testVoteNoStakeAddFunds 
 ERROR at setup of testVoteRejectProposal 
 ERROR at setup of testVotePassedProposal 
 ERROR at setup of testVoteBothYNOpen 
 ERROR at setup of testVoteTwiceYSameUser 
 ERROR at setup of testVoteInvalidProposalID 
 ERROR at setup of testVoteEnactedMarket 
 ERROR at setup of testVoteDeclinedMarket 
 ERROR at setup of testVoteYTaintedKey 
 ERROR at setup of testNewMarketClosedProposal 
 ERROR at setup of testSubmitEnactedGTCOrder 
 ERROR at setup of testSubmitUnEnactedMarketGTCOrder 
 ERROR at setup of testFiftyYesVoteProposal 
../../grpcTesting/governance/newMarketTradesTests.py EEEEEEEEEEEE        [100%]
 ERROR at setup of testTradeGTCToGTC 
 ERROR at setup of testTradeGTTToGTT 
 ERROR at setup of testTradeGTCToIOC 
 ERROR at setup of testTradeGTCToFOK 
 ERROR at setup of testTradesByParty 
 ERROR at setup of testPositionsByParty 
 ERROR at setup of testCloseOutTraderBuyOrders 
 ERROR at setup of testCloseOutTraderSellOrders 
 ERROR at setup of testTradesByMarket 
 ERROR at setup of testTradeGTTToIOC 
 ERROR at setup of testTradeGTTToFOK 
 ERROR at setup of testNoTradeGTCToStopped 
../../grpcTesting/margins/marginsTests.py .                              [100%]
../../grpcTesting/markets/marketsTests.py ..............                 [100%]
../../grpcTesting/orders/amendOrdersTests.py ........................... [ 87%]
....                                                                     [100%]
../../grpcTesting/orders/cancelOrdersTests.py .......................    [100%]
../../grpcTesting/orders/generalOrdersTests.py .F...                     [100%]
 testActiveOrdersByMarket 
../../grpcTesting/orders/limitOrdersTests.py ...........                 [100%]
../../grpcTesting/orders/marketOrdersTests.py ........                   [100%]
../../grpcTesting/orders/mixedOrdersTests.py .....................       [100%]
../../grpcTesting/orders/negativeOrdersTests.py ........................ [ 57%]
....x.........s...                                                       [100%]
../../grpcTesting/parallel/submitParallelOrdersTests.py ........         [100%]
../../grpcTesting/parties/partiesTests.py ..                             [100%]
../../grpcTesting/trading/positionsTests.py ..                           [100%]
../../grpcTesting/trading/tradesTests.py ............                    [100%]
../../grpcTesting/wallet/walletTests.py ................................ [ 76%]
..........                                                               [100%]
../../rest/orders/negativeOrdersTests.py .                               [100%]

@vega-ci-bot
Copy link
Collaborator

system-tests failed.

=== Test summary ===
../../grpcTesting/accounts/accountsTests.py F                            [100%]
 testWithdrawAsset 
../../grpcTesting/devnet/sanityTests.py ....F.                           [100%]
 testPriceOrderAmendment 
../../grpcTesting/governance/newAssetTests.py .                          [100%]
../../grpcTesting/governance/newMarketGovTests.py EEEEEEEEEEEEEEEEEEEEEx [ 47%]
EEEEEEEEEEEEEEEEEEEEEEEE                                                 [100%]
 ERROR at setup of testVoteNDecline 
 ERROR at setup of testVoteYEnactedFail 
 ERROR at setup of testVoteYNProposalDraw 
 ERROR at setup of testVoteYYNProposalPass 
 ERROR at setup of testNewMarketRejectNoStake 
 ERROR at setup of testNewMarketValidProposal 
 ERROR at setup of testGetAllProposals 
 ERROR at setup of testGetAllOfTheProposals[6] 
 ERROR at setup of testGetNewMarketProposals[6] 
 ERROR at setup of testGetAllOfTheProposals[2] 
 ERROR at setup of testGetNewMarketProposals[2] 
 ERROR at setup of testGetAllOfTheProposals[5] 
 ERROR at setup of testGetNewMarketProposals[5] 
 ERROR at setup of testGetAllOfTheProposals[4] 
 ERROR at setup of testGetNewMarketProposals[4] 
 ERROR at setup of testGetAllOfTheProposals[3] 
 ERROR at setup of testGetNewMarketProposals[3] 
 ERROR at setup of testGetProposalsByParty 
 ERROR at setup of testGetRejectedProposalsByParty 
 ERROR at setup of testGetOpenProposalsByParty 
 ERROR at setup of testGetVotesByParty 
 ERROR at setup of testNewMarketOpenSingleTok 
 ERROR at setup of testVoteYSmallHolder 
 ERROR at setup of testVoteYMediumNSmallHolder 
 ERROR at setup of testVoteTopUpSmallDuringVote 
 ERROR at setup of testVoteYNNoFundsProposal 
 ERROR at setup of testNewMarketInvalidParty 
 ERROR at setup of testInvalidEnactTime 
 ERROR at setup of testVoteYOwnOpenProposal 
 ERROR at setup of testVoteYOpenProposal 
 ERROR at setup of testVoteNOpenProposal 
 ERROR at setup of testVoteNoStakeOpenProposal 
 ERROR at setup of testVoteNoStakeAddFunds 
 ERROR at setup of testVoteRejectProposal 
 ERROR at setup of testVotePassedProposal 
 ERROR at setup of testVoteBothYNOpen 
 ERROR at setup of testVoteTwiceYSameUser 
 ERROR at setup of testVoteInvalidProposalID 
 ERROR at setup of testVoteEnactedMarket 
 ERROR at setup of testVoteDeclinedMarket 
 ERROR at setup of testVoteYTaintedKey 
 ERROR at setup of testNewMarketClosedProposal 
 ERROR at setup of testSubmitEnactedGTCOrder 
 ERROR at setup of testSubmitUnEnactedMarketGTCOrder 
 ERROR at setup of testFiftyYesVoteProposal 
../../grpcTesting/governance/newMarketTradesTests.py EEEEEEEEEEEE        [100%]
 ERROR at setup of testTradeGTCToGTC 
 ERROR at setup of testTradeGTTToGTT 
 ERROR at setup of testTradeGTCToIOC 
 ERROR at setup of testTradeGTCToFOK 
 ERROR at setup of testTradesByParty 
 ERROR at setup of testPositionsByParty 
 ERROR at setup of testCloseOutTraderBuyOrders 
 ERROR at setup of testCloseOutTraderSellOrders 
 ERROR at setup of testTradesByMarket 
 ERROR at setup of testTradeGTTToIOC 
 ERROR at setup of testTradeGTTToFOK 
 ERROR at setup of testNoTradeGTCToStopped 
../../grpcTesting/margins/marginsTests.py .                              [100%]
../../grpcTesting/markets/marketsTests.py ..............                 [100%]
../../grpcTesting/orders/amendOrdersTests.py ........................... [ 87%]
....                                                                     [100%]
../../grpcTesting/orders/cancelOrdersTests.py .......................    [100%]
../../grpcTesting/orders/generalOrdersTests.py .F...                     [100%]
 testActiveOrdersByMarket 
../../grpcTesting/orders/limitOrdersTests.py ...........                 [100%]
../../grpcTesting/orders/marketOrdersTests.py ........                   [100%]
../../grpcTesting/orders/mixedOrdersTests.py .....................       [100%]
../../grpcTesting/orders/negativeOrdersTests.py ........................ [ 57%]
....x.........s...                                                       [100%]
../../grpcTesting/parallel/submitParallelOrdersTests.py ........         [100%]
../../grpcTesting/parties/partiesTests.py ..                             [100%]
../../grpcTesting/trading/positionsTests.py ..                           [100%]
../../grpcTesting/trading/tradesTests.py ............                    [100%]
../../grpcTesting/wallet/walletTests.py ................................ [ 76%]
..........                                                               [100%]
../../rest/orders/negativeOrdersTests.py .                               [100%]

@jeremyletang jeremyletang marked this pull request as ready for review July 21, 2020 08:38
@vega-ci-bot
Copy link
Collaborator

system-tests failed.

=== Test summary ===
../../grpcTesting/accounts/accountsTests.py .                            [100%]
../../grpcTesting/devnet/sanityTests.py ......                           [100%]
../../grpcTesting/governance/newAssetTests.py .                          [100%]
../../grpcTesting/governance/newMarketGovTests.py EEEEEEEEEEEEEEEEEEEEEx [ 47%]
EEEEEEEEEEEEEEEEEEEEEEEE                                                 [100%]
 ERROR at setup of testVoteNDecline 
 ERROR at setup of testVoteYEnactedFail 
 ERROR at setup of testVoteYNProposalDraw 
 ERROR at setup of testVoteYYNProposalPass 
 ERROR at setup of testNewMarketRejectNoStake 
 ERROR at setup of testNewMarketValidProposal 
 ERROR at setup of testGetAllProposals 
 ERROR at setup of testGetAllOfTheProposals[6] 
 ERROR at setup of testGetNewMarketProposals[6] 
 ERROR at setup of testGetAllOfTheProposals[2] 
 ERROR at setup of testGetNewMarketProposals[2] 
 ERROR at setup of testGetAllOfTheProposals[5] 
 ERROR at setup of testGetNewMarketProposals[5] 
 ERROR at setup of testGetAllOfTheProposals[4] 
 ERROR at setup of testGetNewMarketProposals[4] 
 ERROR at setup of testGetAllOfTheProposals[3] 
 ERROR at setup of testGetNewMarketProposals[3] 
 ERROR at setup of testGetProposalsByParty 
 ERROR at setup of testGetRejectedProposalsByParty 
 ERROR at setup of testGetOpenProposalsByParty 
 ERROR at setup of testGetVotesByParty 
 ERROR at setup of testNewMarketOpenSingleTok 
 ERROR at setup of testVoteYSmallHolder 
 ERROR at setup of testVoteYMediumNSmallHolder 
 ERROR at setup of testVoteTopUpSmallDuringVote 
 ERROR at setup of testVoteYNNoFundsProposal 
 ERROR at setup of testNewMarketInvalidParty 
 ERROR at setup of testInvalidEnactTime 
 ERROR at setup of testVoteYOwnOpenProposal 
 ERROR at setup of testVoteYOpenProposal 
 ERROR at setup of testVoteNOpenProposal 
 ERROR at setup of testVoteNoStakeOpenProposal 
 ERROR at setup of testVoteNoStakeAddFunds 
 ERROR at setup of testVoteRejectProposal 
 ERROR at setup of testVotePassedProposal 
 ERROR at setup of testVoteBothYNOpen 
 ERROR at setup of testVoteTwiceYSameUser 
 ERROR at setup of testVoteInvalidProposalID 
 ERROR at setup of testVoteEnactedMarket 
 ERROR at setup of testVoteDeclinedMarket 
 ERROR at setup of testVoteYTaintedKey 
 ERROR at setup of testNewMarketClosedProposal 
 ERROR at setup of testSubmitEnactedGTCOrder 
 ERROR at setup of testSubmitUnEnactedMarketGTCOrder 
 ERROR at setup of testFiftyYesVoteProposal 
../../grpcTesting/governance/newMarketTradesTests.py EEEEEEEEEEEE        [100%]
 ERROR at setup of testTradeGTCToGTC 
 ERROR at setup of testTradeGTTToGTT 
 ERROR at setup of testTradeGTCToIOC 
 ERROR at setup of testTradeGTCToFOK 
 ERROR at setup of testTradesByParty 
 ERROR at setup of testPositionsByParty 
 ERROR at setup of testCloseOutTraderBuyOrders 
 ERROR at setup of testCloseOutTraderSellOrders 
 ERROR at setup of testTradesByMarket 
 ERROR at setup of testTradeGTTToIOC 
 ERROR at setup of testTradeGTTToFOK 
 ERROR at setup of testNoTradeGTCToStopped 
../../grpcTesting/margins/marginsTests.py .                              [100%]
../../grpcTesting/markets/marketsTests.py ..............                 [100%]
../../grpcTesting/orders/cancelOrdersTests.py .......................    [100%]
../../grpcTesting/orders/generalOrdersTests.py .F...                     [100%]
 testActiveOrdersByMarket 
../../grpcTesting/orders/limitOrdersTests.py ...........                 [100%]
../../grpcTesting/orders/marketOrdersTests.py ..F.....                   [100%]
 testFilledFOKOrder 
../../grpcTesting/orders/mixedOrdersTests.py .....................       [100%]
../../grpcTesting/orders/negativeOrdersTests.py ........................ [ 57%]
....x.........s...                                                       [100%]
../../grpcTesting/parallel/submitParallelOrdersTests.py ........         [100%]
../../grpcTesting/parties/partiesTests.py ..                             [100%]
../../grpcTesting/trading/positionsTests.py ..                           [100%]
../../grpcTesting/trading/tradesTests.py .........F..                    [100%]
 testTradeGTTToIOC 
../../grpcTesting/wallet/walletTests.py ................................ [ 76%]
..........                                                               [100%]
../../rest/orders/negativeOrdersTests.py .                               [100%]

Copy link
Contributor

@EVODelavega EVODelavega left a comment

Choose a reason for hiding this comment

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

LGTM

@jeremyletang jeremyletang merged commit 4b8d3cd into develop Jul 21, 2020
@jeremyletang jeremyletang deleted the feature/1894-create-fee-engine branch July 21, 2020 09:55
@edd
Copy link
Member

edd commented Jul 21, 2020

I'd have asked for documention on the fees proto and the start of a readme that I can build on. Please add those in a future commit @jeremyletang

@jeremyletang
Copy link
Member Author

I'd have asked for documention on the fees proto and the start of a readme that I can build on. Please add those in a future commit @jeremyletang

Sorry for that, I'm adding in my next PR.

This was referenced Jul 22, 2020
@edd edd mentioned this pull request Aug 10, 2020
12 tasks
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.

Create Fee engine
4 participants