-
Notifications
You must be signed in to change notification settings - Fork 15
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
Simplify liquidity cover check and fix issue with validation #2880
Labels
core-dev-squad
oss-core
This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
story
Milestone
Comments
elnyry-sam-k
added
story
oss-core
This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
core-dev-squad
labels
Aug 17, 2022
mdebarros
added a commit
to mojaloop/central-settlement
that referenced
this issue
Aug 18, 2022
…th validation feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - fixed logger module names for deferred and gross handlers - updated modle.transferSettlement.facade.updateTransferSettlement to correctly capture participantPositionChange entries - added some comments to help clarify whats going on in the modle.transferSettlement.facade.updateTransferSettlement
mdebarros
added a commit
to mojaloop/central-ledger
that referenced
this issue
Aug 18, 2022
…th validation feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - Simplified and consolidated Liquidity check for both Immediate and Deferred with the Position Handler - Cleaned up some code and utilised local variables for consistency
PR for consideration:
|
Useful queriesSELECT * from central_ledger.participantPositionChange WHERE participantPositionId IN ('64', '36') AND createdDate > '2022-08-18 17:58:00' order by createdDate desc; SELECT * from central_ledger.participantPositionChange WHERE createdDate > '2022-08-18 17:58:00' order by createdDate desc; For transferParticipantId Insertselect TP.transferParticipantId, TP.transferId, TP.participantCurrencyId, TP.transferParticipantRoleTypeId, TP.ledgerEntryTypeId, TP.amount * -1 from transferParticipant as TP
inner join participantCurrency as PC on TP.participantCurrencyId = PC.participantCurrencyId
inner join settlementModel as M on PC.ledgerAccountTypeId = M.ledgerAccountTypeId
inner join settlementGranularity as G on M.settlementGranularityId = G.settlementGranularityId
where (TP.transferId = 'f9e605e8-5e53-4b99-995e-166ab38a1853' and (G.name = 'GROSS'))
union
select TP.transferParticipantId, TP.transferId, PC1.participantCurrencyId, TP.transferParticipantRoleTypeId, TP.ledgerEntryTypeId, TP.amount * +1 from transferParticipant as TP
inner join participantCurrency as PC on TP.participantCurrencyId = PC.participantCurrencyId
inner join settlementModel as M on PC.ledgerAccountTypeId = M.ledgerAccountTypeId
inner join settlementGranularity as G on M.settlementGranularityId = G.settlementGranularityId
inner join participantCurrency as PC1 on PC1.currencyId = PC.currencyId and PC1.participantId = PC.participantId and PC1.ledgerAccountTypeId = M.settlementAccountTypeId
where (TP.transferId = 'f9e605e8-5e53-4b99-995e-166ab38a1853' and (G.name = 'GROSS')); For participantPositionChange Insertselect TP.transferParticipantId, TP.transferId, TP.participantCurrencyId, TP.transferParticipantRoleTypeId, TP.ledgerEntryTypeId, TP.amount * +1 from transferParticipant as TP
inner join participantCurrency as PC on TP.participantCurrencyId = PC.participantCurrencyId
inner join settlementModel as M on PC.ledgerAccountTypeId = M.ledgerAccountTypeId
inner join settlementGranularity as G on M.settlementGranularityId = G.settlementGranularityId
where (TP.transferId = 'f9e605e8-5e53-4b99-995e-166ab38a1853' and (G.name = 'GROSS'))
union
select TP.transferParticipantId, TP.transferId, PC1.participantCurrencyId, TP.transferParticipantRoleTypeId, TP.ledgerEntryTypeId, TP.amount * -1 from transferParticipant as TP
inner join participantCurrency as PC on TP.participantCurrencyId = PC.participantCurrencyId
inner join settlementModel as M on PC.ledgerAccountTypeId = M.ledgerAccountTypeId
inner join settlementGranularity as G on M.settlementGranularityId = G.settlementGranularityId
inner join participantCurrency as PC1 on PC1.currencyId = PC.currencyId and PC1.participantId = PC.participantId and PC1.ledgerAccountTypeId = M.settlementAccountTypeId
where (TP.transferId = 'f9e605e8-5e53-4b99-995e-166ab38a1853' and (G.name = 'GROSS')); |
mdebarros
added a commit
to mojaloop/testing-toolkit-test-cases
that referenced
this issue
Aug 25, 2022
…th validation feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - fixes to collections/hub/golden_path/feature_tests/block_transfers - aligned liquidity and position calculations with central-ledger logic - cleaned up unecessary requests (i.e. why have two requests to fetch settlement and position accounts when it can be done in one?)
Follow-up stories:
TODO:
|
mdebarros
added a commit
to mojaloop/helm
that referenced
this issue
Sep 1, 2022
feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - upgraded central-ledger from v15.1.2 to v15.1.2.1-snapshot.1
mdebarros
added a commit
to mojaloop/helm
that referenced
this issue
Sep 1, 2022
feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - upgraded central-settlements from v14.0.0 to v14.0.0.1-snapshot.1
mdebarros
added a commit
to mojaloop/testing-toolkit-test-cases
that referenced
this issue
Sep 8, 2022
…th validation (#84) feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - fixes to collections/hub/golden_path/feature_tests/block_transfers - aligned liquidity and position calculations with central-ledger logic - cleaned up unnecessary requests (i.e. why have two requests to fetch settlement and position accounts when it can be done in one?) - re-factored `[new sims] transfers, positions CGS Window1 tests (OTC-649, OTC-645)` @ collections/hub/golden_path/settlement_cgs/newsetcgs - standardised naming convention - re-aligned position, settlement and interchange checks with central-ledger logic, and expanded on checks dynamically based on the transfer amounts (`Tx1`, `Tx2`, `Tx3`, `Tx4`, `Tx5`, `Tx6`) instead of using "hard-coded" values - consolidated separate `GET /account` test-case for settlement, and positions into a single test-case (i.e. only need one call to admin API to retrieve balances and do validation checks) - added new OPTIONAL env vars for: 1. `SETTLEMENT_CGS_TX_AMOUNT_1` (defaults: 15), `SETTLEMENT_CGS_TX_AMOUNT_2` (defaults: 87.88), `SETTLEMENT_CGS_TX_AMOUNT_3` (defaults: 158.36), `SETTLEMENT_CGS_TX_AMOUNT_4` (defaults: 211.11), `SETTLEMENT_CGS_TX_AMOUNT_5` (defaults: 14.05), `SETTLEMENT_CGS_TX_AMOUNT_6` (defaults: 150) representing the transfer amounts for each Transaction. These correlate to `Tx1`...`Tx6` 2. `SETTLEMENT_RULE_INTERCHANGE_FEE` (defaults: 0.006) which is the Interchange Fee % used to calculate the aggregate Fee fix(mojaloop/#2734): failures in daily cron job running GP tests - mojaloop/project#2734 - added re-try logic to create interchange-fee settlements as part of CGS test-suite - bumped up RETRY_MAX_ATTEMPTS (10 to 20) & RETRY_MAX_WAIT_IN_MS (200 to 250) values to improve stability
mdebarros
added a commit
to mojaloop/central-settlement
that referenced
this issue
Sep 8, 2022
…th validation (#384) feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - fixed logger module names for deferred and gross handlers - updated `model.transferSettlement.facade.updateTransferSettlement` to correctly capture participantPositionChange entries - added some comments to help clarify whats going on in the modle.transferSettlement.facade.updateTransferSettlement chore: maintenance - updated dependencies - standardised package.json order - removed deprecated faucet and replace with tap-spec, and updated associated npm test scripts - replaced npm-audit-resolve with audit-ci - audit fixes
mdebarros
added a commit
to mojaloop/central-ledger
that referenced
this issue
Sep 8, 2022
…th validation (#917) feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - Simplified and consolidated Liquidity check for both Immediate and Deferred with the Position Handler - Cleaned up some code and utilised local variables for consistency - added todo for the reservedValue being returned when retrieving account information via the Admin API which does not conform to the API Spec. If there is any reservedValue, the position returned by the Admin API should calculated the "effectivePosition" as the actual position instead of returning the reservedValue. chore: maintenance - updated dependencies & fixed audit issues - replaced audit-resolve with audit-ci
mdebarros
added a commit
to mojaloop/central-ledger
that referenced
this issue
Sep 8, 2022
…th validation (for master) (#918) feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - Simplified and consolidated Liquidity check for both Immediate and Deferred with the Position Handler - Cleaned up some code and utilised local variables for consistency - added todo for the reservedValue being returned when retrieving account information via the Admin API which does not conform to the API Spec. If there is any reservedValue, the position returned by the Admin API should calculated the "effectivePosition" as the actual position instead of returning the reservedValue. chore: maintenance - updated dependencies & fixed audit issues - replaced audit-resolve with audit-ci
mdebarros
added a commit
to mojaloop/testing-toolkit-test-cases
that referenced
this issue
Sep 8, 2022
…th validation (master) (#86) feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - fixes to collections/hub/golden_path/feature_tests/block_transfers - aligned liquidity and position calculations with central-ledger logic - cleaned up unnecessary requests (i.e. why have two requests to fetch settlement and position accounts when it can be done in one?) - re-factored `[new sims] transfers, positions CGS Window1 tests (OTC-649, OTC-645)` @ collections/hub/golden_path/settlement_cgs/newsetcgs - standardised naming convention - re-aligned position, settlement and interchange checks with central-ledger logic, and expanded on checks dynamically based on the transfer amounts (`Tx1`, `Tx2`, `Tx3`, `Tx4`, `Tx5`, `Tx6`) instead of using "hard-coded" values - consolidated separate `GET /account` test-case for settlement, and positions into a single test-case (i.e. only need one call to admin API to retrieve balances and do validation checks) - added new OPTIONAL env vars for: 1. `SETTLEMENT_CGS_TX_AMOUNT_1` (defaults: 15), `SETTLEMENT_CGS_TX_AMOUNT_2` (defaults: 87.88), `SETTLEMENT_CGS_TX_AMOUNT_3` (defaults: 158.36), `SETTLEMENT_CGS_TX_AMOUNT_4` (defaults: 211.11), `SETTLEMENT_CGS_TX_AMOUNT_5` (defaults: 14.05), `SETTLEMENT_CGS_TX_AMOUNT_6` (defaults: 150) representing the transfer amounts for each Transaction. These correlate to `Tx1`...`Tx6` 2. `SETTLEMENT_RULE_INTERCHANGE_FEE` (defaults: 0.006) which is the Interchange Fee % used to calculate the aggregate Fee fix(mojaloop/#2734): failures in daily cron job running GP tests - mojaloop/project#2734 - added re-try logic to create interchange-fee settlements as part of CGS test-suite - bumped up RETRY_MAX_ATTEMPTS (10 to 20) & RETRY_MAX_WAIT_IN_MS (200 to 250) values to improve stability
mdebarros
added a commit
to mojaloop/helm
that referenced
this issue
Sep 9, 2022
…th validation (#496) feat(mojaloop/[#2880](https://github.com/mdebarros/helm/issues/2880)): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880 - upgraded mojaloop-simulator to v13.0.1 - upgraded central-settlement to v15.0.0 - upgraded central-ledger to v15.1.2.1 - updated TTK Test-Collection to v14.0.0.1 fix(mojaloop/#2734): Failures in daily cron job running GP tests - mojaloop/project#2734 - Included stability fixes in TTK Test-Collection to v14.0.0.1 release
Moja1Deployment❯ helm -n moja1 list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
moja1 moja1 1 2022-09-09 16:07:32.685854 +0200 SAST deployed mojaloop-14.0.0-13942.8ece499 ml-api-adapter: v14.0.0; central-ledger: v15.1.2.1; account-lookup-service: v13.0.0; quoting-service: v15.0.2; central-settlement: v15.0.0; central-event-processor: v12.0.0; bulk-api-adapter: v13.0.1; email-notifier: v12.0.0; als-oracle-pathfinder: v12.0.0; transaction-requests-service: v14.0.1; simulator: v12.0.0; mojaloop-simulator: v13.0.1; sdk-scheme-adapter: v18.0.2; thirdparty-sdk: v15.1.0; ml-testing-toolkit: v15.0.0; ml-testing-toolkit-ui: v15.0.0; Test Results
|
DefaultDeployment❯ helm -n moja3 list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
moja3 moja3 1 2022-09-09 16:29:23.902667 +0200 SAST deployed mojaloop-14.0.0-13942.8ece499 ml-api-adapter: v14.0.0; central-ledger: v15.1.2.1; account-lookup-service: v13.0.0; quoting-service: v15.0.2; central-settlement: v15.0.0; central-event-processor: v12.0.0; bulk-api-adapter: v13.0.1; email-notifier: v12.0.0; als-oracle-pathfinder: v12.0.0; transaction-requests-service: v14.0.1; simulator: v12.0.0; mojaloop-simulator: v13.0.1; sdk-scheme-adapter: v18.0.2; thirdparty-sdk: v15.1.0; ml-testing-toolkit: v15.0.0; ml-testing-toolkit-ui: v15.0.0; Test Results
|
Helm v14.0.0 Rev-2 release:
|
Moja1Deployment❯ helm -n moja1 list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
moja1 moja1 1 2022-09-12 13:37:36.870681 +0200 SAST deployed mojaloop-14.0.0 ml-api-adapter: v14.0.0; central-ledger: v15.1.2.1; account-lookup-service: v13.0.0; quoting-service: v15.0.2; central-settlement: v15.0.0; central-event-processor: v12.0.0; bulk-api-adapter: v13.0.1; email-notifier: v12.0.0; als-oracle-pathfinder: v12.0.0; transaction-requests-service: v14.0.1; simulator: v12.0.0; mojaloop-simulator: v13.0.1; sdk-scheme-adapter: v18.0.2; thirdparty-sdk: v15.1.0; ml-testing-toolkit: v15.0.0; ml-testing-toolkit-ui: v15.0.0; Test Results
|
Moja3 (Default)Deployment❯ helm -n moja3 list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
moja3 moja3 1 2022-09-12 16:01:21.614392 +0200 SAST deployed mojaloop-14.0.0 ml-api-adapter: v14.0.0; central-ledger: v15.1.2.1; account-lookup-service: v13.0.0; quoting-service: v15.0.2; central-settlement: v15.0.0; central-event-processor: v12.0.0; bulk-api-adapter: v13.0.1; email-notifier: v12.0.0; als-oracle-pathfinder: v12.0.0; transaction-requests-service: v14.0.1; simulator: v12.0.0; mojaloop-simulator: v13.0.1; sdk-scheme-adapter: v18.0.2; thirdparty-sdk: v15.1.0; ml-testing-toolkit: v15.0.0; ml-testing-toolkit-ui: v15.0.0; Tests
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
core-dev-squad
oss-core
This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
story
Goal:
As a Hub Operator
I would like to add an additional check on top of the Net-debit-cap check to validate liquidity cover (settlementPosition balance)
so that defaulting DFSP risk can be reduced
Notes:
This is not the initial implementation of the issue. This enhances existing implementation by simplifying it and fixing related issues. Follow-up to implementation after DA issue: mojaloop/design-authority-project#90. Review the DA issue for further information (approved by DA).
Acceptance Criteria:
Utilise ML-Number library to handle all mathematical operations within the Settlement Gross Handler<-- Align liquidity calculations for both the Settlement and Transfer Processes #2927 has been created to address this issue.model.transferSettlement.facade.updateTransferSettlement
functionComplexity: Medium
Uncertainty: Low
Tasks:
Done
Pull Requests:
Follow-up:
Dependencies:
Accountability:
The text was updated successfully, but these errors were encountered: