@hyperscale0/hsx 2.4.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/CHANGELOG.md +4 -406
  2. package/README.md +3 -92
  3. package/dist/src/ast.d.ts +99 -310
  4. package/dist/src/ast.d.ts.map +1 -1
  5. package/dist/src/ast.js +16 -69
  6. package/dist/src/ast.js.map +1 -1
  7. package/dist/src/cli.d.ts +6 -19
  8. package/dist/src/cli.d.ts.map +1 -1
  9. package/dist/src/cli.js +77 -315
  10. package/dist/src/cli.js.map +1 -1
  11. package/dist/src/compile.d.ts +23 -73
  12. package/dist/src/compile.d.ts.map +1 -1
  13. package/dist/src/compile.js +1113 -148
  14. package/dist/src/compile.js.map +1 -1
  15. package/dist/src/cost.d.ts +8 -77
  16. package/dist/src/cost.d.ts.map +1 -1
  17. package/dist/src/cost.js +13 -422
  18. package/dist/src/cost.js.map +1 -1
  19. package/dist/src/format.d.ts +8 -7
  20. package/dist/src/format.d.ts.map +1 -1
  21. package/dist/src/format.js +9 -175
  22. package/dist/src/format.js.map +1 -1
  23. package/dist/src/headers.d.ts +35 -0
  24. package/dist/src/headers.d.ts.map +1 -0
  25. package/dist/src/headers.js +108 -0
  26. package/dist/src/headers.js.map +1 -0
  27. package/dist/src/index.d.ts +6 -12
  28. package/dist/src/index.d.ts.map +1 -1
  29. package/dist/src/index.js +4 -9
  30. package/dist/src/index.js.map +1 -1
  31. package/dist/src/lex.d.ts +8 -28
  32. package/dist/src/lex.d.ts.map +1 -1
  33. package/dist/src/lex.js +88 -146
  34. package/dist/src/lex.js.map +1 -1
  35. package/dist/src/parse.d.ts +4 -17
  36. package/dist/src/parse.d.ts.map +1 -1
  37. package/dist/src/parse.js +402 -1040
  38. package/dist/src/parse.js.map +1 -1
  39. package/dist/src/std-bundle.d.ts.map +1 -1
  40. package/dist/src/std-bundle.js +12 -20
  41. package/dist/src/std-bundle.js.map +1 -1
  42. package/dist/src/std-library.d.ts +1 -1
  43. package/dist/src/std-library.d.ts.map +1 -1
  44. package/dist/src/std-library.js +1 -5
  45. package/dist/src/std-library.js.map +1 -1
  46. package/dist/src/tunables.d.ts +7 -0
  47. package/dist/src/tunables.d.ts.map +1 -0
  48. package/dist/src/tunables.js +26 -0
  49. package/dist/src/tunables.js.map +1 -0
  50. package/dist/src/version.d.ts +2 -4
  51. package/dist/src/version.d.ts.map +1 -1
  52. package/dist/src/version.js +2 -4
  53. package/dist/src/version.js.map +1 -1
  54. package/docs/README.md +179 -41
  55. package/docs/headers.md +44 -0
  56. package/examples/cost-table.json +99 -751
  57. package/examples/library.hsx +59 -0
  58. package/package.json +9 -17
  59. package/src/ast.ts +82 -441
  60. package/src/cli.ts +78 -362
  61. package/src/compile.ts +1535 -247
  62. package/src/cost.ts +28 -671
  63. package/src/format.ts +12 -256
  64. package/src/headers.ts +126 -0
  65. package/src/index.ts +7 -39
  66. package/src/lex.ts +99 -195
  67. package/src/parse.ts +403 -1209
  68. package/src/std-bundle.ts +12 -20
  69. package/src/std-library.ts +2 -7
  70. package/src/tunables.ts +31 -0
  71. package/src/version.ts +2 -5
  72. package/std/approvals.hsx +17 -0
  73. package/std/cards.hsx +63 -0
  74. package/std/collections.hsx +31 -0
  75. package/std/escrow.hsx +43 -0
  76. package/std/financing.hsx +372 -0
  77. package/std/insurance.hsx +59 -0
  78. package/std/lending.hsx +115 -0
  79. package/std/marketplace.hsx +24 -0
  80. package/std/money.hsx +195 -0
  81. package/std/savings.hsx +44 -0
  82. package/std/travel.hsx +98 -0
  83. package/std/wallet.hsx +41 -0
  84. package/dist/src/diagnostics.d.ts +0 -13
  85. package/dist/src/diagnostics.d.ts.map +0 -1
  86. package/dist/src/diagnostics.js +0 -587
  87. package/dist/src/diagnostics.js.map +0 -1
  88. package/dist/src/emit.d.ts +0 -51
  89. package/dist/src/emit.d.ts.map +0 -1
  90. package/dist/src/emit.js +0 -192
  91. package/dist/src/emit.js.map +0 -1
  92. package/dist/src/entry-overrides.d.ts +0 -58
  93. package/dist/src/entry-overrides.d.ts.map +0 -1
  94. package/dist/src/entry-overrides.js +0 -284
  95. package/dist/src/entry-overrides.js.map +0 -1
  96. package/dist/src/ir.d.ts +0 -73
  97. package/dist/src/ir.d.ts.map +0 -1
  98. package/dist/src/ir.js +0 -15
  99. package/dist/src/ir.js.map +0 -1
  100. package/dist/src/limits.d.ts +0 -23
  101. package/dist/src/limits.d.ts.map +0 -1
  102. package/dist/src/limits.js +0 -23
  103. package/dist/src/limits.js.map +0 -1
  104. package/dist/src/lsp/server.d.ts +0 -32
  105. package/dist/src/lsp/server.d.ts.map +0 -1
  106. package/dist/src/lsp/server.js +0 -391
  107. package/dist/src/lsp/server.js.map +0 -1
  108. package/dist/src/modules.d.ts +0 -38
  109. package/dist/src/modules.d.ts.map +0 -1
  110. package/dist/src/modules.js +0 -372
  111. package/dist/src/modules.js.map +0 -1
  112. package/dist/src/typecheck.d.ts +0 -8
  113. package/dist/src/typecheck.d.ts.map +0 -1
  114. package/dist/src/typecheck.js +0 -4160
  115. package/dist/src/typecheck.js.map +0 -1
  116. package/docs/guide/01-first-program.md +0 -24
  117. package/docs/guide/02-money.md +0 -25
  118. package/docs/guide/03-instruments.md +0 -93
  119. package/docs/guide/04-lifecycles.md +0 -40
  120. package/docs/guide/05-fees-and-splits.md +0 -45
  121. package/docs/guide/06-schedules.md +0 -26
  122. package/docs/guide/07-composition.md +0 -52
  123. package/docs/guide/08-writing-a-module.md +0 -85
  124. package/docs/guide/09-cost.md +0 -24
  125. package/docs/guide/10-diagnostics.md +0 -27
  126. package/docs/llms-full.txt +0 -3684
  127. package/docs/llms.txt +0 -44
  128. package/docs/piece-plans.md +0 -120
  129. package/docs/playground.md +0 -55
  130. package/docs/reference/cli.md +0 -36
  131. package/docs/reference/diagnostics.md +0 -901
  132. package/docs/reference/grammar.md +0 -38
  133. package/docs/reference/std/advance.md +0 -112
  134. package/docs/reference/std/cancellable_booking.md +0 -159
  135. package/docs/reference/std/captured_payment.md +0 -115
  136. package/docs/reference/std/conditional_disbursement.md +0 -101
  137. package/docs/reference/std/credit_facility.md +0 -108
  138. package/docs/reference/std/held_payment.md +0 -173
  139. package/docs/reference/std/instant_transfer.md +0 -97
  140. package/docs/reference/std/metered.md +0 -89
  141. package/docs/reference/std/pooled_split.md +0 -95
  142. package/docs/reference/std/premium_forward.md +0 -119
  143. package/docs/reference/std/reconciled_payout.md +0 -103
  144. package/docs/reference/std/rotating_pool.md +0 -130
  145. package/docs/reference/std/scheduled.md +0 -136
  146. package/docs/reference/std/security_deposit.md +0 -138
  147. package/docs/reference/std/settlement_batch.md +0 -123
  148. package/docs/reference/std/swap.md +0 -133
  149. package/docs/reference/std/threshold_pool.md +0 -138
  150. package/docs/reference/std/weighted_distribution.md +0 -135
  151. package/docs/reference/types.md +0 -61
  152. package/docs/reference/udl-output.md +0 -13
  153. package/examples/01-first-program/README.md +0 -45
  154. package/examples/01-first-program/tip-jar.hsx +0 -17
  155. package/examples/02-imports-and-modules/README.md +0 -96
  156. package/examples/02-imports-and-modules/photo-booth.hsx +0 -37
  157. package/examples/03-diagnostics/README.md +0 -68
  158. package/examples/03-diagnostics/corner-shop-fixed.hsx +0 -22
  159. package/examples/03-diagnostics/corner-shop.hsx +0 -19
  160. package/examples/04-complete-product/README.md +0 -84
  161. package/examples/04-complete-product/study-hall.hsx +0 -67
  162. package/examples/05-authored-instrument/README.md +0 -5
  163. package/examples/05-authored-instrument/payment.hsx +0 -37
  164. package/examples/05-watch-club/README.md +0 -6
  165. package/examples/05-watch-club/watch-club.hsx +0 -123
  166. package/examples/README.md +0 -48
  167. package/examples/advance/README.md +0 -3
  168. package/examples/advance/advance.hsx +0 -13
  169. package/examples/advance/advance.udl +0 -367
  170. package/examples/cancellable_booking/README.md +0 -3
  171. package/examples/cancellable_booking/cancellable_booking.hsx +0 -14
  172. package/examples/cancellable_booking/cancellable_booking.udl +0 -413
  173. package/examples/captured_payment/README.md +0 -3
  174. package/examples/captured_payment/captured_payment.hsx +0 -17
  175. package/examples/captured_payment/captured_payment.udl +0 -686
  176. package/examples/conditional_disbursement/README.md +0 -3
  177. package/examples/conditional_disbursement/conditional_disbursement.hsx +0 -15
  178. package/examples/conditional_disbursement/conditional_disbursement.udl +0 -418
  179. package/examples/credit_facility/README.md +0 -3
  180. package/examples/credit_facility/credit_facility.hsx +0 -24
  181. package/examples/credit_facility/credit_facility.udl +0 -1396
  182. package/examples/held_payment/README.md +0 -3
  183. package/examples/held_payment/held_payment.hsx +0 -13
  184. package/examples/held_payment/held_payment.udl +0 -569
  185. package/examples/instant_transfer/README.md +0 -3
  186. package/examples/instant_transfer/instant_transfer.hsx +0 -16
  187. package/examples/instant_transfer/instant_transfer.udl +0 -376
  188. package/examples/metered/README.md +0 -3
  189. package/examples/metered/metered.hsx +0 -13
  190. package/examples/metered/metered.udl +0 -253
  191. package/examples/pooled_split/README.md +0 -3
  192. package/examples/pooled_split/pooled_split.hsx +0 -15
  193. package/examples/pooled_split/pooled_split.udl +0 -432
  194. package/examples/premium_forward/README.md +0 -3
  195. package/examples/premium_forward/premium_forward.hsx +0 -19
  196. package/examples/premium_forward/premium_forward.udl +0 -604
  197. package/examples/reconciled_payout/README.md +0 -3
  198. package/examples/reconciled_payout/reconciled_payout.hsx +0 -13
  199. package/examples/reconciled_payout/reconciled_payout.udl +0 -312
  200. package/examples/rotating_pool/README.md +0 -3
  201. package/examples/rotating_pool/rotating_pool.hsx +0 -18
  202. package/examples/rotating_pool/rotating_pool.udl +0 -4370
  203. package/examples/scheduled/README.md +0 -3
  204. package/examples/scheduled/scheduled.hsx +0 -12
  205. package/examples/scheduled/scheduled.udl +0 -355
  206. package/examples/security_deposit/README.md +0 -3
  207. package/examples/security_deposit/security_deposit.hsx +0 -21
  208. package/examples/security_deposit/security_deposit.udl +0 -320
  209. package/examples/settlement_batch/README.md +0 -3
  210. package/examples/settlement_batch/settlement_batch.hsx +0 -19
  211. package/examples/settlement_batch/settlement_batch.udl +0 -757
  212. package/examples/swap/README.md +0 -3
  213. package/examples/swap/swap.hsx +0 -19
  214. package/examples/swap/swap.udl +0 -892
  215. package/examples/threshold_pool/README.md +0 -3
  216. package/examples/threshold_pool/threshold_pool.hsx +0 -16
  217. package/examples/threshold_pool/threshold_pool.udl +0 -680
  218. package/examples/weighted_distribution/README.md +0 -3
  219. package/examples/weighted_distribution/weighted_distribution.hsx +0 -20
  220. package/examples/weighted_distribution/weighted_distribution.udl +0 -348
  221. package/skills/hsx/SKILL.md +0 -449
  222. package/src/diagnostics.ts +0 -620
  223. package/src/emit.ts +0 -282
  224. package/src/entry-overrides.ts +0 -428
  225. package/src/ir.ts +0 -113
  226. package/src/limits.ts +0 -22
  227. package/src/lsp/server.ts +0 -460
  228. package/src/modules.ts +0 -452
  229. package/src/typecheck.ts +0 -5515
  230. package/std/SEMANTICS.md +0 -44
  231. package/std/money_flows/advance.hsx +0 -235
  232. package/std/money_flows/cancellable_booking.hsx +0 -402
  233. package/std/money_flows/captured_payment.hsx +0 -220
  234. package/std/money_flows/conditional_disbursement.hsx +0 -226
  235. package/std/money_flows/credit_facility.hsx +0 -214
  236. package/std/money_flows/held_payment.hsx +0 -812
  237. package/std/money_flows/index.hsx +0 -4
  238. package/std/money_flows/instant_transfer.hsx +0 -231
  239. package/std/money_flows/metered.hsx +0 -104
  240. package/std/money_flows/pooled_split.hsx +0 -109
  241. package/std/money_flows/premium_forward.hsx +0 -307
  242. package/std/money_flows/reconciled_payout.hsx +0 -119
  243. package/std/money_flows/rotating_pool.hsx +0 -305
  244. package/std/money_flows/scheduled.hsx +0 -599
  245. package/std/money_flows/security_deposit.hsx +0 -248
  246. package/std/money_flows/settlement_batch.hsx +0 -173
  247. package/std/money_flows/swap.hsx +0 -1192
  248. package/std/money_flows/threshold_pool.hsx +0 -307
  249. package/std/money_flows/weighted_distribution.hsx +0 -237
@@ -1,4370 +0,0 @@
1
- {
2
- "instruments": [
3
- {
4
- "actionOrder": [
5
- "create",
6
- "cancel",
7
- "activate",
8
- "ready_cycle_1",
9
- "advance_cycle_1",
10
- "ready_cycle_2",
11
- "advance_cycle_2",
12
- "ready_cycle_3",
13
- "advance_cycle_3"
14
- ],
15
- "actions": {
16
- "activate": {
17
- "agentDescription": "Start cycle one. Refused unless every member on the roster has exactly one contribution row waiting at the first cycle, so a pool can never run a member short. No money moves.",
18
- "effects": {
19
- "reads": [
20
- {
21
- "signature": "reads.requires_aggregate",
22
- "source": "requiresAggregate"
23
- }
24
- ]
25
- },
26
- "moves": [],
27
- "publicAction": "activatePool",
28
- "requiresAggregate": [
29
- {
30
- "check": {
31
- "field": "one",
32
- "kind": "count_equals_field"
33
- },
34
- "instrumentId": "pool_member_a_contribution",
35
- "over": "children",
36
- "refField": "poolId",
37
- "statuses": [
38
- "cycle_1_due"
39
- ]
40
- },
41
- {
42
- "check": {
43
- "field": "one",
44
- "kind": "count_equals_field"
45
- },
46
- "instrumentId": "pool_member_b_contribution",
47
- "over": "children",
48
- "refField": "poolId",
49
- "statuses": [
50
- "cycle_1_due"
51
- ]
52
- },
53
- {
54
- "check": {
55
- "field": "one",
56
- "kind": "count_equals_field"
57
- },
58
- "instrumentId": "pool_member_c_contribution",
59
- "over": "children",
60
- "refField": "poolId",
61
- "statuses": [
62
- "cycle_1_due"
63
- ]
64
- }
65
- ],
66
- "steps": [],
67
- "summary": "Activate only after every fixed member row exists once"
68
- },
69
- "advance_cycle_1": {
70
- "agentDescription": "Close cycle 1 once every member row has paid into that cycle pot, moving the pool to the next cycle or to completed on the last one. Refused while any row is unpaid. No money moves here. The money moved on the member rows.",
71
- "effects": {
72
- "reads": [
73
- {
74
- "signature": "reads.requires_aggregate",
75
- "source": "requiresAggregate"
76
- }
77
- ]
78
- },
79
- "moves": [],
80
- "publicAction": "advanceCycle1Pool",
81
- "requiresAggregate": [
82
- {
83
- "check": {
84
- "kind": "all_in"
85
- },
86
- "instrumentId": "pool_member_a_contribution",
87
- "over": "children",
88
- "refField": "poolId",
89
- "statuses": [
90
- "cycle_2_due"
91
- ]
92
- },
93
- {
94
- "check": {
95
- "kind": "all_in"
96
- },
97
- "instrumentId": "pool_member_b_contribution",
98
- "over": "children",
99
- "refField": "poolId",
100
- "statuses": [
101
- "cycle_2_due"
102
- ]
103
- },
104
- {
105
- "check": {
106
- "kind": "all_in"
107
- },
108
- "instrumentId": "pool_member_c_contribution",
109
- "over": "children",
110
- "refField": "poolId",
111
- "statuses": [
112
- "cycle_2_due"
113
- ]
114
- }
115
- ],
116
- "steps": [],
117
- "summary": "Advance after every cycle 1 contribution pays"
118
- },
119
- "advance_cycle_2": {
120
- "agentDescription": "Close cycle 2 once every member row has paid into that cycle pot, moving the pool to the next cycle or to completed on the last one. Refused while any row is unpaid. No money moves here. The money moved on the member rows.",
121
- "effects": {
122
- "reads": [
123
- {
124
- "signature": "reads.requires_aggregate",
125
- "source": "requiresAggregate"
126
- }
127
- ]
128
- },
129
- "moves": [],
130
- "publicAction": "advanceCycle2Pool",
131
- "requiresAggregate": [
132
- {
133
- "check": {
134
- "kind": "all_in"
135
- },
136
- "instrumentId": "pool_member_a_contribution",
137
- "over": "children",
138
- "refField": "poolId",
139
- "statuses": [
140
- "cycle_3_due"
141
- ]
142
- },
143
- {
144
- "check": {
145
- "kind": "all_in"
146
- },
147
- "instrumentId": "pool_member_b_contribution",
148
- "over": "children",
149
- "refField": "poolId",
150
- "statuses": [
151
- "cycle_3_due"
152
- ]
153
- },
154
- {
155
- "check": {
156
- "kind": "all_in"
157
- },
158
- "instrumentId": "pool_member_c_contribution",
159
- "over": "children",
160
- "refField": "poolId",
161
- "statuses": [
162
- "cycle_3_due"
163
- ]
164
- }
165
- ],
166
- "steps": [],
167
- "summary": "Advance after every cycle 2 contribution pays"
168
- },
169
- "advance_cycle_3": {
170
- "agentDescription": "Close cycle 3 once every member row has paid into that cycle pot, moving the pool to the next cycle or to completed on the last one. Refused while any row is unpaid. No money moves here. The money moved on the member rows.",
171
- "effects": {
172
- "reads": [
173
- {
174
- "signature": "reads.requires_aggregate",
175
- "source": "requiresAggregate"
176
- }
177
- ]
178
- },
179
- "moves": [],
180
- "publicAction": "advanceCycle3Pool",
181
- "requiresAggregate": [
182
- {
183
- "check": {
184
- "kind": "all_in"
185
- },
186
- "instrumentId": "pool_member_a_contribution",
187
- "over": "children",
188
- "refField": "poolId",
189
- "statuses": [
190
- "completed"
191
- ]
192
- },
193
- {
194
- "check": {
195
- "kind": "all_in"
196
- },
197
- "instrumentId": "pool_member_b_contribution",
198
- "over": "children",
199
- "refField": "poolId",
200
- "statuses": [
201
- "completed"
202
- ]
203
- },
204
- {
205
- "check": {
206
- "kind": "all_in"
207
- },
208
- "instrumentId": "pool_member_c_contribution",
209
- "over": "children",
210
- "refField": "poolId",
211
- "statuses": [
212
- "completed"
213
- ]
214
- }
215
- ],
216
- "steps": [],
217
- "summary": "Complete after the final shared pot pays"
218
- },
219
- "cancel": {
220
- "agentDescription": "Cancel the pool before it activates. Only a forming pool cancels, no money has moved yet, and there is nothing to refund. Once the pool activates this exit is gone.",
221
- "moves": [],
222
- "publicAction": "cancelPool",
223
- "steps": [],
224
- "summary": "Cancel before activation without moving money"
225
- },
226
- "create": {
227
- "agentDescription": "Create the pool with its frozen roster, cycle count, contribution amount, and payout order. No money moves. Each member's contribution row is created separately, and the pool cannot activate until every row exists.",
228
- "moves": [],
229
- "publicAction": "createPool",
230
- "steps": [],
231
- "summary": "Create the fixed roster before activation"
232
- },
233
- "ready_cycle_1": {
234
- "agentDescription": "Lock cycle 1 once every member row is funded or covered by the guarantor. Refused while any row is still due or defaulted. No money moves here. Locking the cycle is what lets its payouts run.",
235
- "effects": {
236
- "reads": [
237
- {
238
- "signature": "reads.requires_aggregate",
239
- "source": "requiresAggregate"
240
- }
241
- ]
242
- },
243
- "moves": [],
244
- "publicAction": "readyCycle1Pool",
245
- "requiresAggregate": [
246
- {
247
- "check": {
248
- "kind": "all_in"
249
- },
250
- "instrumentId": "pool_member_a_contribution",
251
- "over": "children",
252
- "refField": "poolId",
253
- "statuses": [
254
- "cycle_1_funded",
255
- "cycle_1_guaranteed"
256
- ]
257
- },
258
- {
259
- "check": {
260
- "kind": "all_in"
261
- },
262
- "instrumentId": "pool_member_b_contribution",
263
- "over": "children",
264
- "refField": "poolId",
265
- "statuses": [
266
- "cycle_1_funded",
267
- "cycle_1_guaranteed"
268
- ]
269
- },
270
- {
271
- "check": {
272
- "kind": "all_in"
273
- },
274
- "instrumentId": "pool_member_c_contribution",
275
- "over": "children",
276
- "refField": "poolId",
277
- "statuses": [
278
- "cycle_1_funded",
279
- "cycle_1_guaranteed"
280
- ]
281
- }
282
- ],
283
- "steps": [],
284
- "summary": "Lock cycle 1 only after every member row is funded or guaranteed"
285
- },
286
- "ready_cycle_2": {
287
- "agentDescription": "Lock cycle 2 once every member row is funded or covered by the guarantor. Refused while any row is still due or defaulted. No money moves here. Locking the cycle is what lets its payouts run.",
288
- "effects": {
289
- "reads": [
290
- {
291
- "signature": "reads.requires_aggregate",
292
- "source": "requiresAggregate"
293
- }
294
- ]
295
- },
296
- "moves": [],
297
- "publicAction": "readyCycle2Pool",
298
- "requiresAggregate": [
299
- {
300
- "check": {
301
- "kind": "all_in"
302
- },
303
- "instrumentId": "pool_member_a_contribution",
304
- "over": "children",
305
- "refField": "poolId",
306
- "statuses": [
307
- "cycle_2_funded",
308
- "cycle_2_guaranteed"
309
- ]
310
- },
311
- {
312
- "check": {
313
- "kind": "all_in"
314
- },
315
- "instrumentId": "pool_member_b_contribution",
316
- "over": "children",
317
- "refField": "poolId",
318
- "statuses": [
319
- "cycle_2_funded",
320
- "cycle_2_guaranteed"
321
- ]
322
- },
323
- {
324
- "check": {
325
- "kind": "all_in"
326
- },
327
- "instrumentId": "pool_member_c_contribution",
328
- "over": "children",
329
- "refField": "poolId",
330
- "statuses": [
331
- "cycle_2_funded",
332
- "cycle_2_guaranteed"
333
- ]
334
- }
335
- ],
336
- "steps": [],
337
- "summary": "Lock cycle 2 only after every member row is funded or guaranteed"
338
- },
339
- "ready_cycle_3": {
340
- "agentDescription": "Lock cycle 3 once every member row is funded or covered by the guarantor. Refused while any row is still due or defaulted. No money moves here. Locking the cycle is what lets its payouts run.",
341
- "effects": {
342
- "reads": [
343
- {
344
- "signature": "reads.requires_aggregate",
345
- "source": "requiresAggregate"
346
- }
347
- ]
348
- },
349
- "moves": [],
350
- "publicAction": "readyCycle3Pool",
351
- "requiresAggregate": [
352
- {
353
- "check": {
354
- "kind": "all_in"
355
- },
356
- "instrumentId": "pool_member_a_contribution",
357
- "over": "children",
358
- "refField": "poolId",
359
- "statuses": [
360
- "cycle_3_funded",
361
- "cycle_3_guaranteed"
362
- ]
363
- },
364
- {
365
- "check": {
366
- "kind": "all_in"
367
- },
368
- "instrumentId": "pool_member_b_contribution",
369
- "over": "children",
370
- "refField": "poolId",
371
- "statuses": [
372
- "cycle_3_funded",
373
- "cycle_3_guaranteed"
374
- ]
375
- },
376
- {
377
- "check": {
378
- "kind": "all_in"
379
- },
380
- "instrumentId": "pool_member_c_contribution",
381
- "over": "children",
382
- "refField": "poolId",
383
- "statuses": [
384
- "cycle_3_funded",
385
- "cycle_3_guaranteed"
386
- ]
387
- }
388
- ],
389
- "steps": [],
390
- "summary": "Lock cycle 3 only after every member row is funded or guaranteed"
391
- }
392
- },
393
- "agentDescription": "Reach for rotating pool when a fixed group pays the same contribution every cycle and one member takes the whole pot each cycle, in a declared order. The roster freezes at creation, one contribution row per member, and the pot rotates until every member has been paid. Scheduled is the one payer, one payee shape on a calendar.",
394
- "description": "Fixed rotating contribution and payout order",
395
- "fields": {
396
- "contributionAmount": {
397
- "description": "Exact contribution in SAR minor units",
398
- "pattern": "^[1-9][0-9]{0,17}$",
399
- "type": "string",
400
- "x-hyperscale-currency": "SAR"
401
- },
402
- "currency": {
403
- "description": "ISO 4217 currency code",
404
- "maxLength": 3,
405
- "minLength": 3,
406
- "pattern": "^[A-Z]{3}$",
407
- "type": "string"
408
- },
409
- "firstContributionAt": {
410
- "description": "Stored first contribution due date",
411
- "format": "hyperscale-date-time",
412
- "type": "string"
413
- },
414
- "guarantorAccountId": {
415
- "description": "The guarantor account",
416
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
417
- "type": "string",
418
- "x-hyperscale-reference-filter": {
419
- "column": "role",
420
- "values": [
421
- "customer_balance"
422
- ]
423
- }
424
- },
425
- "memberAAccountId": {
426
- "description": "The member a account",
427
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
428
- "type": "string",
429
- "x-hyperscale-reference-filter": {
430
- "column": "role",
431
- "values": [
432
- "customer_balance"
433
- ]
434
- }
435
- },
436
- "memberBAccountId": {
437
- "description": "The member b account",
438
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
439
- "type": "string",
440
- "x-hyperscale-reference-filter": {
441
- "column": "role",
442
- "values": [
443
- "customer_balance"
444
- ]
445
- }
446
- },
447
- "memberCAccountId": {
448
- "description": "The member c account",
449
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
450
- "type": "string",
451
- "x-hyperscale-reference-filter": {
452
- "column": "role",
453
- "values": [
454
- "customer_balance"
455
- ]
456
- }
457
- },
458
- "one": {
459
- "const": 1,
460
- "description": "Exact fixed member-row count",
461
- "type": "integer"
462
- }
463
- },
464
- "id": "pool",
465
- "idPrefix": "pool",
466
- "lifecycle": {
467
- "initial": "forming",
468
- "states": [
469
- "forming",
470
- "cancelled",
471
- "active_cycle_1",
472
- "cycle_1_ready",
473
- "active_cycle_2",
474
- "cycle_2_ready",
475
- "active_cycle_3",
476
- "cycle_3_ready",
477
- "completed"
478
- ],
479
- "transitions": {
480
- "activate": {
481
- "from": [
482
- "forming"
483
- ],
484
- "to": "active_cycle_1"
485
- },
486
- "advance_cycle_1": {
487
- "from": [
488
- "cycle_1_ready"
489
- ],
490
- "to": "active_cycle_2"
491
- },
492
- "advance_cycle_2": {
493
- "from": [
494
- "cycle_2_ready"
495
- ],
496
- "to": "active_cycle_3"
497
- },
498
- "advance_cycle_3": {
499
- "from": [
500
- "cycle_3_ready"
501
- ],
502
- "to": "completed"
503
- },
504
- "cancel": {
505
- "from": [
506
- "forming"
507
- ],
508
- "to": "cancelled"
509
- },
510
- "ready_cycle_1": {
511
- "from": [
512
- "active_cycle_1"
513
- ],
514
- "to": "cycle_1_ready"
515
- },
516
- "ready_cycle_2": {
517
- "from": [
518
- "active_cycle_2"
519
- ],
520
- "to": "cycle_2_ready"
521
- },
522
- "ready_cycle_3": {
523
- "from": [
524
- "active_cycle_3"
525
- ],
526
- "to": "cycle_3_ready"
527
- }
528
- }
529
- },
530
- "parties": {
531
- "payer": "guarantorAccountId"
532
- },
533
- "required": [
534
- "memberAAccountId",
535
- "memberBAccountId",
536
- "memberCAccountId",
537
- "guarantorAccountId",
538
- "currency",
539
- "contributionAmount",
540
- "firstContributionAt",
541
- "one"
542
- ],
543
- "summary": "3-member rotating pool",
544
- "templateBinding": {
545
- "id": "rotating_pool",
546
- "parameters": {
547
- "count": 3,
548
- "membership": false,
549
- "memo": false
550
- }
551
- },
552
- "title": "Pool"
553
- },
554
- {
555
- "actionOrder": [
556
- "create",
557
- "contribute_cycle_1",
558
- "mark_default_cycle_1",
559
- "guarantee_cycle_1",
560
- "pay_cycle_1",
561
- "pay_guaranteed_cycle_1",
562
- "contribute_cycle_2",
563
- "mark_default_cycle_2",
564
- "guarantee_cycle_2",
565
- "pay_cycle_2",
566
- "pay_guaranteed_cycle_2",
567
- "contribute_cycle_3",
568
- "mark_default_cycle_3",
569
- "guarantee_cycle_3",
570
- "pay_cycle_3",
571
- "pay_guaranteed_cycle_3",
572
- "close"
573
- ],
574
- "actions": {
575
- "close": {
576
- "agentDescription": "Retire this member row after its final payout. Refused while the row escrow account still holds anything, so a row can never close over stranded money. No money moves.",
577
- "moves": [],
578
- "publicAction": "closePoolMemberAContribution",
579
- "requiresDrainedAccount": {
580
- "path": "refs.escrowAccountId"
581
- },
582
- "steps": [],
583
- "summary": "Complete after the final payout drains this member custody"
584
- },
585
- "contribute_cycle_1": {
586
- "due": {
587
- "field": "firstContributionAt"
588
- },
589
- "effects": {
590
- "moves": [
591
- {
592
- "signature": "moves.collection.pay_in",
593
- "source": "moves[0]"
594
- }
595
- ],
596
- "reads": [
597
- {
598
- "signature": "reads.requires_refs",
599
- "source": "requiresRefs"
600
- }
601
- ],
602
- "schedules": [
603
- {
604
- "signature": "schedules.due",
605
- "source": "due"
606
- }
607
- ]
608
- },
609
- "moves": [
610
- {
611
- "bind": {
612
- "amount": {
613
- "from": "instance",
614
- "path": "fields.contributionAmount"
615
- },
616
- "currency": {
617
- "from": "const",
618
- "value": "SAR"
619
- },
620
- "destinationAccountId": {
621
- "from": "instance",
622
- "path": "refs.escrowAccountId"
623
- },
624
- "metadata.instrumentId": {
625
- "from": "const",
626
- "value": "pool_member_a_contribution"
627
- },
628
- "metadata.instrumentInstanceId": {
629
- "from": "instance",
630
- "path": "instrumentInstanceId"
631
- },
632
- "metadata.phase": {
633
- "from": "const",
634
- "value": "contribute_cycle_1"
635
- },
636
- "productId": {
637
- "from": "instance",
638
- "path": "productId"
639
- },
640
- "sourceAccountId": {
641
- "from": "instance",
642
- "path": "fields.memberAAccountId"
643
- }
644
- },
645
- "capture": {
646
- "contributeCycle1ContributionTransferId": "transferId"
647
- },
648
- "key": "contribution",
649
- "operation": "internal_transfer.create"
650
- }
651
- ],
652
- "requiresRefs": [
653
- {
654
- "field": "poolId",
655
- "statuses": [
656
- "active_cycle_1"
657
- ]
658
- }
659
- ],
660
- "sandboxFailurePoint": "funding",
661
- "steps": [],
662
- "summary": "Fund member a's cycle 1 contribution"
663
- },
664
- "contribute_cycle_2": {
665
- "due": {
666
- "field": "firstContributionAt",
667
- "offset": "P30D"
668
- },
669
- "effects": {
670
- "moves": [
671
- {
672
- "signature": "moves.collection.pay_in",
673
- "source": "moves[0]"
674
- }
675
- ],
676
- "reads": [
677
- {
678
- "signature": "reads.requires_refs",
679
- "source": "requiresRefs"
680
- }
681
- ],
682
- "schedules": [
683
- {
684
- "signature": "schedules.due",
685
- "source": "due"
686
- }
687
- ]
688
- },
689
- "moves": [
690
- {
691
- "bind": {
692
- "amount": {
693
- "from": "instance",
694
- "path": "fields.contributionAmount"
695
- },
696
- "currency": {
697
- "from": "const",
698
- "value": "SAR"
699
- },
700
- "destinationAccountId": {
701
- "from": "instance",
702
- "path": "refs.escrowAccountId"
703
- },
704
- "metadata.instrumentId": {
705
- "from": "const",
706
- "value": "pool_member_a_contribution"
707
- },
708
- "metadata.instrumentInstanceId": {
709
- "from": "instance",
710
- "path": "instrumentInstanceId"
711
- },
712
- "metadata.phase": {
713
- "from": "const",
714
- "value": "contribute_cycle_2"
715
- },
716
- "productId": {
717
- "from": "instance",
718
- "path": "productId"
719
- },
720
- "sourceAccountId": {
721
- "from": "instance",
722
- "path": "fields.memberAAccountId"
723
- }
724
- },
725
- "capture": {
726
- "contributeCycle2ContributionTransferId": "transferId"
727
- },
728
- "key": "contribution",
729
- "operation": "internal_transfer.create"
730
- }
731
- ],
732
- "requiresRefs": [
733
- {
734
- "field": "poolId",
735
- "statuses": [
736
- "active_cycle_2"
737
- ]
738
- }
739
- ],
740
- "steps": [],
741
- "summary": "Fund member a's cycle 2 contribution"
742
- },
743
- "contribute_cycle_3": {
744
- "due": {
745
- "field": "firstContributionAt",
746
- "offset": "P60D"
747
- },
748
- "effects": {
749
- "moves": [
750
- {
751
- "signature": "moves.collection.pay_in",
752
- "source": "moves[0]"
753
- }
754
- ],
755
- "reads": [
756
- {
757
- "signature": "reads.requires_refs",
758
- "source": "requiresRefs"
759
- }
760
- ],
761
- "schedules": [
762
- {
763
- "signature": "schedules.due",
764
- "source": "due"
765
- }
766
- ]
767
- },
768
- "moves": [
769
- {
770
- "bind": {
771
- "amount": {
772
- "from": "instance",
773
- "path": "fields.contributionAmount"
774
- },
775
- "currency": {
776
- "from": "const",
777
- "value": "SAR"
778
- },
779
- "destinationAccountId": {
780
- "from": "instance",
781
- "path": "refs.escrowAccountId"
782
- },
783
- "metadata.instrumentId": {
784
- "from": "const",
785
- "value": "pool_member_a_contribution"
786
- },
787
- "metadata.instrumentInstanceId": {
788
- "from": "instance",
789
- "path": "instrumentInstanceId"
790
- },
791
- "metadata.phase": {
792
- "from": "const",
793
- "value": "contribute_cycle_3"
794
- },
795
- "productId": {
796
- "from": "instance",
797
- "path": "productId"
798
- },
799
- "sourceAccountId": {
800
- "from": "instance",
801
- "path": "fields.memberAAccountId"
802
- }
803
- },
804
- "capture": {
805
- "contributeCycle3ContributionTransferId": "transferId"
806
- },
807
- "key": "contribution",
808
- "operation": "internal_transfer.create"
809
- }
810
- ],
811
- "requiresRefs": [
812
- {
813
- "field": "poolId",
814
- "statuses": [
815
- "active_cycle_3"
816
- ]
817
- }
818
- ],
819
- "steps": [],
820
- "summary": "Fund member a's cycle 3 contribution"
821
- },
822
- "create": {
823
- "agentDescription": "Create the contribution row for the member a and provision its escrow account. The pool must still be forming, and every member needs exactly one row before the pool can activate. No money moves.",
824
- "effects": {
825
- "reads": [
826
- {
827
- "signature": "reads.requires_refs",
828
- "source": "requiresRefs"
829
- }
830
- ]
831
- },
832
- "moves": [],
833
- "publicAction": "createPoolMemberAContribution",
834
- "requiresRefs": [
835
- {
836
- "bind": {
837
- "contributionAmount": "fields.contributionAmount",
838
- "currency": "fields.currency",
839
- "firstContributionAt": "fields.firstContributionAt",
840
- "guarantorAccountId": "fields.guarantorAccountId",
841
- "memberAAccountId": "fields.memberAAccountId",
842
- "memberBAccountId": "fields.memberBAccountId",
843
- "memberCAccountId": "fields.memberCAccountId"
844
- },
845
- "field": "poolId",
846
- "statuses": [
847
- "forming"
848
- ],
849
- "unique": true
850
- }
851
- ],
852
- "steps": [
853
- {
854
- "bind": {
855
- "currency": {
856
- "from": "const",
857
- "value": "SAR"
858
- },
859
- "owner.id": {
860
- "from": "instance",
861
- "path": "productId"
862
- },
863
- "owner.type": {
864
- "from": "const",
865
- "value": "product"
866
- },
867
- "productId": {
868
- "from": "instance",
869
- "path": "productId"
870
- },
871
- "role": {
872
- "from": "const",
873
- "value": "product_escrow"
874
- }
875
- },
876
- "capture": {
877
- "escrowAccountId": "accountId"
878
- },
879
- "operation": "account.escrow.provision"
880
- }
881
- ],
882
- "summary": "Create the fixed contribution row for member a"
883
- },
884
- "guarantee_cycle_1": {
885
- "agentDescription": "Have the guarantor fund cycle 1 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
886
- "effects": {
887
- "moves": [
888
- {
889
- "signature": "moves.collection.pay_in",
890
- "source": "moves[0]"
891
- }
892
- ],
893
- "reads": [
894
- {
895
- "signature": "reads.requires_refs",
896
- "source": "requiresRefs"
897
- }
898
- ]
899
- },
900
- "moves": [
901
- {
902
- "bind": {
903
- "amount": {
904
- "from": "instance",
905
- "path": "fields.contributionAmount"
906
- },
907
- "currency": {
908
- "from": "const",
909
- "value": "SAR"
910
- },
911
- "destinationAccountId": {
912
- "from": "instance",
913
- "path": "refs.escrowAccountId"
914
- },
915
- "metadata.instrumentId": {
916
- "from": "const",
917
- "value": "pool_member_a_contribution"
918
- },
919
- "metadata.instrumentInstanceId": {
920
- "from": "instance",
921
- "path": "instrumentInstanceId"
922
- },
923
- "metadata.phase": {
924
- "from": "const",
925
- "value": "guarantee_cycle_1"
926
- },
927
- "productId": {
928
- "from": "instance",
929
- "path": "productId"
930
- },
931
- "sourceAccountId": {
932
- "from": "instance",
933
- "path": "fields.guarantorAccountId"
934
- }
935
- },
936
- "capture": {
937
- "guaranteeCycle1GuaranteeTransferId": "transferId"
938
- },
939
- "key": "guarantee",
940
- "operation": "internal_transfer.create"
941
- }
942
- ],
943
- "publicAction": "guaranteeCycle1PoolMemberAContribution",
944
- "requiresRefs": [
945
- {
946
- "field": "poolId",
947
- "statuses": [
948
- "active_cycle_1"
949
- ]
950
- }
951
- ],
952
- "steps": [],
953
- "summary": "Fund the defaulted cycle 1 amount before payout"
954
- },
955
- "guarantee_cycle_2": {
956
- "agentDescription": "Have the guarantor fund cycle 2 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
957
- "effects": {
958
- "moves": [
959
- {
960
- "signature": "moves.collection.pay_in",
961
- "source": "moves[0]"
962
- }
963
- ],
964
- "reads": [
965
- {
966
- "signature": "reads.requires_refs",
967
- "source": "requiresRefs"
968
- }
969
- ]
970
- },
971
- "moves": [
972
- {
973
- "bind": {
974
- "amount": {
975
- "from": "instance",
976
- "path": "fields.contributionAmount"
977
- },
978
- "currency": {
979
- "from": "const",
980
- "value": "SAR"
981
- },
982
- "destinationAccountId": {
983
- "from": "instance",
984
- "path": "refs.escrowAccountId"
985
- },
986
- "metadata.instrumentId": {
987
- "from": "const",
988
- "value": "pool_member_a_contribution"
989
- },
990
- "metadata.instrumentInstanceId": {
991
- "from": "instance",
992
- "path": "instrumentInstanceId"
993
- },
994
- "metadata.phase": {
995
- "from": "const",
996
- "value": "guarantee_cycle_2"
997
- },
998
- "productId": {
999
- "from": "instance",
1000
- "path": "productId"
1001
- },
1002
- "sourceAccountId": {
1003
- "from": "instance",
1004
- "path": "fields.guarantorAccountId"
1005
- }
1006
- },
1007
- "capture": {
1008
- "guaranteeCycle2GuaranteeTransferId": "transferId"
1009
- },
1010
- "key": "guarantee",
1011
- "operation": "internal_transfer.create"
1012
- }
1013
- ],
1014
- "publicAction": "guaranteeCycle2PoolMemberAContribution",
1015
- "requiresRefs": [
1016
- {
1017
- "field": "poolId",
1018
- "statuses": [
1019
- "active_cycle_2"
1020
- ]
1021
- }
1022
- ],
1023
- "steps": [],
1024
- "summary": "Fund the defaulted cycle 2 amount before payout"
1025
- },
1026
- "guarantee_cycle_3": {
1027
- "agentDescription": "Have the guarantor fund cycle 3 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
1028
- "effects": {
1029
- "moves": [
1030
- {
1031
- "signature": "moves.collection.pay_in",
1032
- "source": "moves[0]"
1033
- }
1034
- ],
1035
- "reads": [
1036
- {
1037
- "signature": "reads.requires_refs",
1038
- "source": "requiresRefs"
1039
- }
1040
- ]
1041
- },
1042
- "moves": [
1043
- {
1044
- "bind": {
1045
- "amount": {
1046
- "from": "instance",
1047
- "path": "fields.contributionAmount"
1048
- },
1049
- "currency": {
1050
- "from": "const",
1051
- "value": "SAR"
1052
- },
1053
- "destinationAccountId": {
1054
- "from": "instance",
1055
- "path": "refs.escrowAccountId"
1056
- },
1057
- "metadata.instrumentId": {
1058
- "from": "const",
1059
- "value": "pool_member_a_contribution"
1060
- },
1061
- "metadata.instrumentInstanceId": {
1062
- "from": "instance",
1063
- "path": "instrumentInstanceId"
1064
- },
1065
- "metadata.phase": {
1066
- "from": "const",
1067
- "value": "guarantee_cycle_3"
1068
- },
1069
- "productId": {
1070
- "from": "instance",
1071
- "path": "productId"
1072
- },
1073
- "sourceAccountId": {
1074
- "from": "instance",
1075
- "path": "fields.guarantorAccountId"
1076
- }
1077
- },
1078
- "capture": {
1079
- "guaranteeCycle3GuaranteeTransferId": "transferId"
1080
- },
1081
- "key": "guarantee",
1082
- "operation": "internal_transfer.create"
1083
- }
1084
- ],
1085
- "publicAction": "guaranteeCycle3PoolMemberAContribution",
1086
- "requiresRefs": [
1087
- {
1088
- "field": "poolId",
1089
- "statuses": [
1090
- "active_cycle_3"
1091
- ]
1092
- }
1093
- ],
1094
- "steps": [],
1095
- "summary": "Fund the defaulted cycle 3 amount before payout"
1096
- },
1097
- "mark_default_cycle_1": {
1098
- "due": {
1099
- "field": "firstContributionAt"
1100
- },
1101
- "effects": {
1102
- "reads": [
1103
- {
1104
- "signature": "reads.requires_refs",
1105
- "source": "requiresRefs"
1106
- }
1107
- ],
1108
- "schedules": [
1109
- {
1110
- "signature": "schedules.due",
1111
- "source": "due"
1112
- }
1113
- ]
1114
- },
1115
- "moves": [],
1116
- "requiresRefs": [
1117
- {
1118
- "field": "poolId",
1119
- "statuses": [
1120
- "active_cycle_1"
1121
- ]
1122
- }
1123
- ],
1124
- "steps": [],
1125
- "summary": "Mark the stored cycle 1 due condition"
1126
- },
1127
- "mark_default_cycle_2": {
1128
- "due": {
1129
- "field": "firstContributionAt",
1130
- "offset": "P30D"
1131
- },
1132
- "effects": {
1133
- "reads": [
1134
- {
1135
- "signature": "reads.requires_refs",
1136
- "source": "requiresRefs"
1137
- }
1138
- ],
1139
- "schedules": [
1140
- {
1141
- "signature": "schedules.due",
1142
- "source": "due"
1143
- }
1144
- ]
1145
- },
1146
- "moves": [],
1147
- "requiresRefs": [
1148
- {
1149
- "field": "poolId",
1150
- "statuses": [
1151
- "active_cycle_2"
1152
- ]
1153
- }
1154
- ],
1155
- "steps": [],
1156
- "summary": "Mark the stored cycle 2 due condition"
1157
- },
1158
- "mark_default_cycle_3": {
1159
- "due": {
1160
- "field": "firstContributionAt",
1161
- "offset": "P60D"
1162
- },
1163
- "effects": {
1164
- "reads": [
1165
- {
1166
- "signature": "reads.requires_refs",
1167
- "source": "requiresRefs"
1168
- }
1169
- ],
1170
- "schedules": [
1171
- {
1172
- "signature": "schedules.due",
1173
- "source": "due"
1174
- }
1175
- ]
1176
- },
1177
- "moves": [],
1178
- "requiresRefs": [
1179
- {
1180
- "field": "poolId",
1181
- "statuses": [
1182
- "active_cycle_3"
1183
- ]
1184
- }
1185
- ],
1186
- "steps": [],
1187
- "summary": "Mark the stored cycle 3 due condition"
1188
- },
1189
- "pay_cycle_1": {
1190
- "agentDescription": "Pay this row's funded cycle 1 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
1191
- "effects": {
1192
- "moves": [
1193
- {
1194
- "signature": "moves.transfer.internal",
1195
- "source": "moves[0]"
1196
- }
1197
- ],
1198
- "reads": [
1199
- {
1200
- "signature": "reads.requires_refs",
1201
- "source": "requiresRefs"
1202
- }
1203
- ]
1204
- },
1205
- "moves": [
1206
- {
1207
- "bind": {
1208
- "amount": {
1209
- "from": "instance",
1210
- "path": "fields.contributionAmount"
1211
- },
1212
- "currency": {
1213
- "from": "const",
1214
- "value": "SAR"
1215
- },
1216
- "destinationAccountId": {
1217
- "from": "instance",
1218
- "path": "fields.memberBAccountId"
1219
- },
1220
- "metadata.instrumentId": {
1221
- "from": "const",
1222
- "value": "pool_member_a_contribution"
1223
- },
1224
- "metadata.instrumentInstanceId": {
1225
- "from": "instance",
1226
- "path": "instrumentInstanceId"
1227
- },
1228
- "metadata.phase": {
1229
- "from": "const",
1230
- "value": "pay_cycle_1"
1231
- },
1232
- "productId": {
1233
- "from": "instance",
1234
- "path": "productId"
1235
- },
1236
- "sourceAccountId": {
1237
- "from": "instance",
1238
- "path": "refs.escrowAccountId"
1239
- }
1240
- },
1241
- "capture": {
1242
- "payCycle1PayoutTransferId": "transferId"
1243
- },
1244
- "key": "payout",
1245
- "operation": "internal_transfer.create"
1246
- }
1247
- ],
1248
- "publicAction": "payCycle1PoolMemberAContribution",
1249
- "requiresRefs": [
1250
- {
1251
- "field": "poolId",
1252
- "statuses": [
1253
- "cycle_1_ready"
1254
- ]
1255
- }
1256
- ],
1257
- "sandboxFailurePoint": "release",
1258
- "steps": [],
1259
- "summary": "Pay this member's stored contribution into cycle 1's shared pot recipient"
1260
- },
1261
- "pay_cycle_2": {
1262
- "agentDescription": "Pay this row's funded cycle 2 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
1263
- "effects": {
1264
- "moves": [
1265
- {
1266
- "signature": "moves.transfer.internal",
1267
- "source": "moves[0]"
1268
- }
1269
- ],
1270
- "reads": [
1271
- {
1272
- "signature": "reads.requires_refs",
1273
- "source": "requiresRefs"
1274
- }
1275
- ]
1276
- },
1277
- "moves": [
1278
- {
1279
- "bind": {
1280
- "amount": {
1281
- "from": "instance",
1282
- "path": "fields.contributionAmount"
1283
- },
1284
- "currency": {
1285
- "from": "const",
1286
- "value": "SAR"
1287
- },
1288
- "destinationAccountId": {
1289
- "from": "instance",
1290
- "path": "fields.memberCAccountId"
1291
- },
1292
- "metadata.instrumentId": {
1293
- "from": "const",
1294
- "value": "pool_member_a_contribution"
1295
- },
1296
- "metadata.instrumentInstanceId": {
1297
- "from": "instance",
1298
- "path": "instrumentInstanceId"
1299
- },
1300
- "metadata.phase": {
1301
- "from": "const",
1302
- "value": "pay_cycle_2"
1303
- },
1304
- "productId": {
1305
- "from": "instance",
1306
- "path": "productId"
1307
- },
1308
- "sourceAccountId": {
1309
- "from": "instance",
1310
- "path": "refs.escrowAccountId"
1311
- }
1312
- },
1313
- "capture": {
1314
- "payCycle2PayoutTransferId": "transferId"
1315
- },
1316
- "key": "payout",
1317
- "operation": "internal_transfer.create"
1318
- }
1319
- ],
1320
- "publicAction": "payCycle2PoolMemberAContribution",
1321
- "requiresRefs": [
1322
- {
1323
- "field": "poolId",
1324
- "statuses": [
1325
- "cycle_2_ready"
1326
- ]
1327
- }
1328
- ],
1329
- "steps": [],
1330
- "summary": "Pay this member's stored contribution into cycle 2's shared pot recipient"
1331
- },
1332
- "pay_cycle_3": {
1333
- "agentDescription": "Pay this row's funded cycle 3 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
1334
- "effects": {
1335
- "moves": [
1336
- {
1337
- "signature": "moves.transfer.internal",
1338
- "source": "moves[0]"
1339
- }
1340
- ],
1341
- "reads": [
1342
- {
1343
- "signature": "reads.requires_refs",
1344
- "source": "requiresRefs"
1345
- }
1346
- ]
1347
- },
1348
- "moves": [
1349
- {
1350
- "bind": {
1351
- "amount": {
1352
- "from": "instance",
1353
- "path": "fields.contributionAmount"
1354
- },
1355
- "currency": {
1356
- "from": "const",
1357
- "value": "SAR"
1358
- },
1359
- "destinationAccountId": {
1360
- "from": "instance",
1361
- "path": "fields.memberAAccountId"
1362
- },
1363
- "metadata.instrumentId": {
1364
- "from": "const",
1365
- "value": "pool_member_a_contribution"
1366
- },
1367
- "metadata.instrumentInstanceId": {
1368
- "from": "instance",
1369
- "path": "instrumentInstanceId"
1370
- },
1371
- "metadata.phase": {
1372
- "from": "const",
1373
- "value": "pay_cycle_3"
1374
- },
1375
- "productId": {
1376
- "from": "instance",
1377
- "path": "productId"
1378
- },
1379
- "sourceAccountId": {
1380
- "from": "instance",
1381
- "path": "refs.escrowAccountId"
1382
- }
1383
- },
1384
- "capture": {
1385
- "payCycle3PayoutTransferId": "transferId"
1386
- },
1387
- "key": "payout",
1388
- "operation": "internal_transfer.create"
1389
- }
1390
- ],
1391
- "publicAction": "payCycle3PoolMemberAContribution",
1392
- "requiresRefs": [
1393
- {
1394
- "field": "poolId",
1395
- "statuses": [
1396
- "cycle_3_ready"
1397
- ]
1398
- }
1399
- ],
1400
- "steps": [],
1401
- "summary": "Pay this member's stored contribution into cycle 3's shared pot recipient"
1402
- },
1403
- "pay_guaranteed_cycle_1": {
1404
- "agentDescription": "Pay this row's guarantor-funded cycle 1 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
1405
- "effects": {
1406
- "moves": [
1407
- {
1408
- "signature": "moves.transfer.internal",
1409
- "source": "moves[0]"
1410
- }
1411
- ],
1412
- "reads": [
1413
- {
1414
- "signature": "reads.requires_refs",
1415
- "source": "requiresRefs"
1416
- }
1417
- ]
1418
- },
1419
- "moves": [
1420
- {
1421
- "bind": {
1422
- "amount": {
1423
- "from": "instance",
1424
- "path": "fields.contributionAmount"
1425
- },
1426
- "currency": {
1427
- "from": "const",
1428
- "value": "SAR"
1429
- },
1430
- "destinationAccountId": {
1431
- "from": "instance",
1432
- "path": "fields.memberBAccountId"
1433
- },
1434
- "metadata.instrumentId": {
1435
- "from": "const",
1436
- "value": "pool_member_a_contribution"
1437
- },
1438
- "metadata.instrumentInstanceId": {
1439
- "from": "instance",
1440
- "path": "instrumentInstanceId"
1441
- },
1442
- "metadata.phase": {
1443
- "from": "const",
1444
- "value": "pay_guaranteed_cycle_1"
1445
- },
1446
- "productId": {
1447
- "from": "instance",
1448
- "path": "productId"
1449
- },
1450
- "sourceAccountId": {
1451
- "from": "instance",
1452
- "path": "refs.escrowAccountId"
1453
- }
1454
- },
1455
- "capture": {
1456
- "payGuaranteedCycle1PayoutTransferId": "transferId"
1457
- },
1458
- "key": "payout",
1459
- "operation": "internal_transfer.create"
1460
- }
1461
- ],
1462
- "publicAction": "payGuaranteedCycle1PoolMemberAContribution",
1463
- "requiresRefs": [
1464
- {
1465
- "field": "poolId",
1466
- "statuses": [
1467
- "cycle_1_ready"
1468
- ]
1469
- }
1470
- ],
1471
- "steps": [],
1472
- "summary": "Pay the funded default into cycle 1's stored recipient"
1473
- },
1474
- "pay_guaranteed_cycle_2": {
1475
- "agentDescription": "Pay this row's guarantor-funded cycle 2 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
1476
- "effects": {
1477
- "moves": [
1478
- {
1479
- "signature": "moves.transfer.internal",
1480
- "source": "moves[0]"
1481
- }
1482
- ],
1483
- "reads": [
1484
- {
1485
- "signature": "reads.requires_refs",
1486
- "source": "requiresRefs"
1487
- }
1488
- ]
1489
- },
1490
- "moves": [
1491
- {
1492
- "bind": {
1493
- "amount": {
1494
- "from": "instance",
1495
- "path": "fields.contributionAmount"
1496
- },
1497
- "currency": {
1498
- "from": "const",
1499
- "value": "SAR"
1500
- },
1501
- "destinationAccountId": {
1502
- "from": "instance",
1503
- "path": "fields.memberCAccountId"
1504
- },
1505
- "metadata.instrumentId": {
1506
- "from": "const",
1507
- "value": "pool_member_a_contribution"
1508
- },
1509
- "metadata.instrumentInstanceId": {
1510
- "from": "instance",
1511
- "path": "instrumentInstanceId"
1512
- },
1513
- "metadata.phase": {
1514
- "from": "const",
1515
- "value": "pay_guaranteed_cycle_2"
1516
- },
1517
- "productId": {
1518
- "from": "instance",
1519
- "path": "productId"
1520
- },
1521
- "sourceAccountId": {
1522
- "from": "instance",
1523
- "path": "refs.escrowAccountId"
1524
- }
1525
- },
1526
- "capture": {
1527
- "payGuaranteedCycle2PayoutTransferId": "transferId"
1528
- },
1529
- "key": "payout",
1530
- "operation": "internal_transfer.create"
1531
- }
1532
- ],
1533
- "publicAction": "payGuaranteedCycle2PoolMemberAContribution",
1534
- "requiresRefs": [
1535
- {
1536
- "field": "poolId",
1537
- "statuses": [
1538
- "cycle_2_ready"
1539
- ]
1540
- }
1541
- ],
1542
- "steps": [],
1543
- "summary": "Pay the funded default into cycle 2's stored recipient"
1544
- },
1545
- "pay_guaranteed_cycle_3": {
1546
- "agentDescription": "Pay this row's guarantor-funded cycle 3 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
1547
- "effects": {
1548
- "moves": [
1549
- {
1550
- "signature": "moves.transfer.internal",
1551
- "source": "moves[0]"
1552
- }
1553
- ],
1554
- "reads": [
1555
- {
1556
- "signature": "reads.requires_refs",
1557
- "source": "requiresRefs"
1558
- }
1559
- ]
1560
- },
1561
- "moves": [
1562
- {
1563
- "bind": {
1564
- "amount": {
1565
- "from": "instance",
1566
- "path": "fields.contributionAmount"
1567
- },
1568
- "currency": {
1569
- "from": "const",
1570
- "value": "SAR"
1571
- },
1572
- "destinationAccountId": {
1573
- "from": "instance",
1574
- "path": "fields.memberAAccountId"
1575
- },
1576
- "metadata.instrumentId": {
1577
- "from": "const",
1578
- "value": "pool_member_a_contribution"
1579
- },
1580
- "metadata.instrumentInstanceId": {
1581
- "from": "instance",
1582
- "path": "instrumentInstanceId"
1583
- },
1584
- "metadata.phase": {
1585
- "from": "const",
1586
- "value": "pay_guaranteed_cycle_3"
1587
- },
1588
- "productId": {
1589
- "from": "instance",
1590
- "path": "productId"
1591
- },
1592
- "sourceAccountId": {
1593
- "from": "instance",
1594
- "path": "refs.escrowAccountId"
1595
- }
1596
- },
1597
- "capture": {
1598
- "payGuaranteedCycle3PayoutTransferId": "transferId"
1599
- },
1600
- "key": "payout",
1601
- "operation": "internal_transfer.create"
1602
- }
1603
- ],
1604
- "publicAction": "payGuaranteedCycle3PoolMemberAContribution",
1605
- "requiresRefs": [
1606
- {
1607
- "field": "poolId",
1608
- "statuses": [
1609
- "cycle_3_ready"
1610
- ]
1611
- }
1612
- ],
1613
- "steps": [],
1614
- "summary": "Pay the funded default into cycle 3's stored recipient"
1615
- }
1616
- },
1617
- "agentDescription": "One seat in the pool. The member a pays the same contribution every cycle and takes the whole pot on their turn. Every contribution, default, guarantee, and payout for that member happens on this row, never on the pool itself.",
1618
- "description": "Fixed contribution row for member a",
1619
- "fields": {
1620
- "contributionAmount": {
1621
- "description": "Exact contribution amount shared by every cycle",
1622
- "pattern": "^[1-9][0-9]{0,17}$",
1623
- "type": "string",
1624
- "x-hyperscale-currency": "SAR"
1625
- },
1626
- "currency": {
1627
- "description": "ISO 4217 currency code",
1628
- "maxLength": 3,
1629
- "minLength": 3,
1630
- "pattern": "^[A-Z]{3}$",
1631
- "type": "string"
1632
- },
1633
- "firstContributionAt": {
1634
- "description": "First due anchor derived from the pool",
1635
- "format": "hyperscale-date-time",
1636
- "type": "string"
1637
- },
1638
- "guarantorAccountId": {
1639
- "description": "The guarantor account",
1640
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1641
- "type": "string",
1642
- "x-hyperscale-reference-filter": {
1643
- "column": "role",
1644
- "values": [
1645
- "customer_balance"
1646
- ]
1647
- }
1648
- },
1649
- "memberAAccountId": {
1650
- "description": "The member a account",
1651
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1652
- "type": "string",
1653
- "x-hyperscale-reference-filter": {
1654
- "column": "role",
1655
- "values": [
1656
- "customer_balance"
1657
- ]
1658
- }
1659
- },
1660
- "memberBAccountId": {
1661
- "description": "The member b account",
1662
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1663
- "type": "string",
1664
- "x-hyperscale-reference-filter": {
1665
- "column": "role",
1666
- "values": [
1667
- "customer_balance"
1668
- ]
1669
- }
1670
- },
1671
- "memberCAccountId": {
1672
- "description": "The member c account",
1673
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1674
- "type": "string",
1675
- "x-hyperscale-reference-filter": {
1676
- "column": "role",
1677
- "values": [
1678
- "customer_balance"
1679
- ]
1680
- }
1681
- },
1682
- "poolId": {
1683
- "description": "The exact pool",
1684
- "pattern": "^pool_(sandbox|live)_[a-z0-9]{8,64}$",
1685
- "type": "string"
1686
- }
1687
- },
1688
- "id": "pool_member_a_contribution",
1689
- "idPrefix": "zzaa",
1690
- "lifecycle": {
1691
- "initial": "cycle_1_due",
1692
- "states": [
1693
- "cycle_1_due",
1694
- "cycle_1_funded",
1695
- "cycle_1_defaulted",
1696
- "cycle_1_guaranteed",
1697
- "cycle_2_due",
1698
- "cycle_2_funded",
1699
- "cycle_2_defaulted",
1700
- "cycle_2_guaranteed",
1701
- "cycle_3_due",
1702
- "cycle_3_funded",
1703
- "cycle_3_defaulted",
1704
- "cycle_3_guaranteed",
1705
- "final_paid",
1706
- "completed"
1707
- ],
1708
- "transitions": {
1709
- "close": {
1710
- "from": [
1711
- "final_paid"
1712
- ],
1713
- "to": "completed"
1714
- },
1715
- "contribute_cycle_1": {
1716
- "from": [
1717
- "cycle_1_due"
1718
- ],
1719
- "to": "cycle_1_funded"
1720
- },
1721
- "contribute_cycle_2": {
1722
- "from": [
1723
- "cycle_2_due"
1724
- ],
1725
- "to": "cycle_2_funded"
1726
- },
1727
- "contribute_cycle_3": {
1728
- "from": [
1729
- "cycle_3_due"
1730
- ],
1731
- "to": "cycle_3_funded"
1732
- },
1733
- "guarantee_cycle_1": {
1734
- "from": [
1735
- "cycle_1_defaulted"
1736
- ],
1737
- "to": "cycle_1_guaranteed"
1738
- },
1739
- "guarantee_cycle_2": {
1740
- "from": [
1741
- "cycle_2_defaulted"
1742
- ],
1743
- "to": "cycle_2_guaranteed"
1744
- },
1745
- "guarantee_cycle_3": {
1746
- "from": [
1747
- "cycle_3_defaulted"
1748
- ],
1749
- "to": "cycle_3_guaranteed"
1750
- },
1751
- "mark_default_cycle_1": {
1752
- "from": [
1753
- "cycle_1_due"
1754
- ],
1755
- "to": "cycle_1_defaulted"
1756
- },
1757
- "mark_default_cycle_2": {
1758
- "from": [
1759
- "cycle_2_due"
1760
- ],
1761
- "to": "cycle_2_defaulted"
1762
- },
1763
- "mark_default_cycle_3": {
1764
- "from": [
1765
- "cycle_3_due"
1766
- ],
1767
- "to": "cycle_3_defaulted"
1768
- },
1769
- "pay_cycle_1": {
1770
- "from": [
1771
- "cycle_1_funded"
1772
- ],
1773
- "to": "cycle_2_due"
1774
- },
1775
- "pay_cycle_2": {
1776
- "from": [
1777
- "cycle_2_funded"
1778
- ],
1779
- "to": "cycle_3_due"
1780
- },
1781
- "pay_cycle_3": {
1782
- "from": [
1783
- "cycle_3_funded"
1784
- ],
1785
- "to": "final_paid"
1786
- },
1787
- "pay_guaranteed_cycle_1": {
1788
- "from": [
1789
- "cycle_1_guaranteed"
1790
- ],
1791
- "to": "cycle_2_due"
1792
- },
1793
- "pay_guaranteed_cycle_2": {
1794
- "from": [
1795
- "cycle_2_guaranteed"
1796
- ],
1797
- "to": "cycle_3_due"
1798
- },
1799
- "pay_guaranteed_cycle_3": {
1800
- "from": [
1801
- "cycle_3_guaranteed"
1802
- ],
1803
- "to": "final_paid"
1804
- }
1805
- }
1806
- },
1807
- "parties": {
1808
- "beneficiary": "memberAAccountId",
1809
- "payer": "guarantorAccountId"
1810
- },
1811
- "required": [
1812
- "memberAAccountId",
1813
- "guarantorAccountId",
1814
- "memberBAccountId",
1815
- "memberCAccountId",
1816
- "contributionAmount",
1817
- "currency",
1818
- "firstContributionAt",
1819
- "poolId"
1820
- ],
1821
- "summary": "member a contribution row",
1822
- "title": "Pool Member a Contribution"
1823
- },
1824
- {
1825
- "actionOrder": [
1826
- "create",
1827
- "contribute_cycle_1",
1828
- "mark_default_cycle_1",
1829
- "guarantee_cycle_1",
1830
- "pay_cycle_1",
1831
- "pay_guaranteed_cycle_1",
1832
- "contribute_cycle_2",
1833
- "mark_default_cycle_2",
1834
- "guarantee_cycle_2",
1835
- "pay_cycle_2",
1836
- "pay_guaranteed_cycle_2",
1837
- "contribute_cycle_3",
1838
- "mark_default_cycle_3",
1839
- "guarantee_cycle_3",
1840
- "pay_cycle_3",
1841
- "pay_guaranteed_cycle_3",
1842
- "close"
1843
- ],
1844
- "actions": {
1845
- "close": {
1846
- "agentDescription": "Retire this member row after its final payout. Refused while the row escrow account still holds anything, so a row can never close over stranded money. No money moves.",
1847
- "moves": [],
1848
- "publicAction": "closePoolMemberBContribution",
1849
- "requiresDrainedAccount": {
1850
- "path": "refs.escrowAccountId"
1851
- },
1852
- "steps": [],
1853
- "summary": "Complete after the final payout drains this member custody"
1854
- },
1855
- "contribute_cycle_1": {
1856
- "due": {
1857
- "field": "firstContributionAt"
1858
- },
1859
- "effects": {
1860
- "moves": [
1861
- {
1862
- "signature": "moves.collection.pay_in",
1863
- "source": "moves[0]"
1864
- }
1865
- ],
1866
- "reads": [
1867
- {
1868
- "signature": "reads.requires_refs",
1869
- "source": "requiresRefs"
1870
- }
1871
- ],
1872
- "schedules": [
1873
- {
1874
- "signature": "schedules.due",
1875
- "source": "due"
1876
- }
1877
- ]
1878
- },
1879
- "moves": [
1880
- {
1881
- "bind": {
1882
- "amount": {
1883
- "from": "instance",
1884
- "path": "fields.contributionAmount"
1885
- },
1886
- "currency": {
1887
- "from": "const",
1888
- "value": "SAR"
1889
- },
1890
- "destinationAccountId": {
1891
- "from": "instance",
1892
- "path": "refs.escrowAccountId"
1893
- },
1894
- "metadata.instrumentId": {
1895
- "from": "const",
1896
- "value": "pool_member_b_contribution"
1897
- },
1898
- "metadata.instrumentInstanceId": {
1899
- "from": "instance",
1900
- "path": "instrumentInstanceId"
1901
- },
1902
- "metadata.phase": {
1903
- "from": "const",
1904
- "value": "contribute_cycle_1"
1905
- },
1906
- "productId": {
1907
- "from": "instance",
1908
- "path": "productId"
1909
- },
1910
- "sourceAccountId": {
1911
- "from": "instance",
1912
- "path": "fields.memberBAccountId"
1913
- }
1914
- },
1915
- "capture": {
1916
- "contributeCycle1ContributionTransferId": "transferId"
1917
- },
1918
- "key": "contribution",
1919
- "operation": "internal_transfer.create"
1920
- }
1921
- ],
1922
- "requiresRefs": [
1923
- {
1924
- "field": "poolId",
1925
- "statuses": [
1926
- "active_cycle_1"
1927
- ]
1928
- }
1929
- ],
1930
- "sandboxFailurePoint": "funding",
1931
- "steps": [],
1932
- "summary": "Fund member b's cycle 1 contribution"
1933
- },
1934
- "contribute_cycle_2": {
1935
- "due": {
1936
- "field": "firstContributionAt",
1937
- "offset": "P30D"
1938
- },
1939
- "effects": {
1940
- "moves": [
1941
- {
1942
- "signature": "moves.collection.pay_in",
1943
- "source": "moves[0]"
1944
- }
1945
- ],
1946
- "reads": [
1947
- {
1948
- "signature": "reads.requires_refs",
1949
- "source": "requiresRefs"
1950
- }
1951
- ],
1952
- "schedules": [
1953
- {
1954
- "signature": "schedules.due",
1955
- "source": "due"
1956
- }
1957
- ]
1958
- },
1959
- "moves": [
1960
- {
1961
- "bind": {
1962
- "amount": {
1963
- "from": "instance",
1964
- "path": "fields.contributionAmount"
1965
- },
1966
- "currency": {
1967
- "from": "const",
1968
- "value": "SAR"
1969
- },
1970
- "destinationAccountId": {
1971
- "from": "instance",
1972
- "path": "refs.escrowAccountId"
1973
- },
1974
- "metadata.instrumentId": {
1975
- "from": "const",
1976
- "value": "pool_member_b_contribution"
1977
- },
1978
- "metadata.instrumentInstanceId": {
1979
- "from": "instance",
1980
- "path": "instrumentInstanceId"
1981
- },
1982
- "metadata.phase": {
1983
- "from": "const",
1984
- "value": "contribute_cycle_2"
1985
- },
1986
- "productId": {
1987
- "from": "instance",
1988
- "path": "productId"
1989
- },
1990
- "sourceAccountId": {
1991
- "from": "instance",
1992
- "path": "fields.memberBAccountId"
1993
- }
1994
- },
1995
- "capture": {
1996
- "contributeCycle2ContributionTransferId": "transferId"
1997
- },
1998
- "key": "contribution",
1999
- "operation": "internal_transfer.create"
2000
- }
2001
- ],
2002
- "requiresRefs": [
2003
- {
2004
- "field": "poolId",
2005
- "statuses": [
2006
- "active_cycle_2"
2007
- ]
2008
- }
2009
- ],
2010
- "steps": [],
2011
- "summary": "Fund member b's cycle 2 contribution"
2012
- },
2013
- "contribute_cycle_3": {
2014
- "due": {
2015
- "field": "firstContributionAt",
2016
- "offset": "P60D"
2017
- },
2018
- "effects": {
2019
- "moves": [
2020
- {
2021
- "signature": "moves.collection.pay_in",
2022
- "source": "moves[0]"
2023
- }
2024
- ],
2025
- "reads": [
2026
- {
2027
- "signature": "reads.requires_refs",
2028
- "source": "requiresRefs"
2029
- }
2030
- ],
2031
- "schedules": [
2032
- {
2033
- "signature": "schedules.due",
2034
- "source": "due"
2035
- }
2036
- ]
2037
- },
2038
- "moves": [
2039
- {
2040
- "bind": {
2041
- "amount": {
2042
- "from": "instance",
2043
- "path": "fields.contributionAmount"
2044
- },
2045
- "currency": {
2046
- "from": "const",
2047
- "value": "SAR"
2048
- },
2049
- "destinationAccountId": {
2050
- "from": "instance",
2051
- "path": "refs.escrowAccountId"
2052
- },
2053
- "metadata.instrumentId": {
2054
- "from": "const",
2055
- "value": "pool_member_b_contribution"
2056
- },
2057
- "metadata.instrumentInstanceId": {
2058
- "from": "instance",
2059
- "path": "instrumentInstanceId"
2060
- },
2061
- "metadata.phase": {
2062
- "from": "const",
2063
- "value": "contribute_cycle_3"
2064
- },
2065
- "productId": {
2066
- "from": "instance",
2067
- "path": "productId"
2068
- },
2069
- "sourceAccountId": {
2070
- "from": "instance",
2071
- "path": "fields.memberBAccountId"
2072
- }
2073
- },
2074
- "capture": {
2075
- "contributeCycle3ContributionTransferId": "transferId"
2076
- },
2077
- "key": "contribution",
2078
- "operation": "internal_transfer.create"
2079
- }
2080
- ],
2081
- "requiresRefs": [
2082
- {
2083
- "field": "poolId",
2084
- "statuses": [
2085
- "active_cycle_3"
2086
- ]
2087
- }
2088
- ],
2089
- "steps": [],
2090
- "summary": "Fund member b's cycle 3 contribution"
2091
- },
2092
- "create": {
2093
- "agentDescription": "Create the contribution row for the member b and provision its escrow account. The pool must still be forming, and every member needs exactly one row before the pool can activate. No money moves.",
2094
- "effects": {
2095
- "reads": [
2096
- {
2097
- "signature": "reads.requires_refs",
2098
- "source": "requiresRefs"
2099
- }
2100
- ]
2101
- },
2102
- "moves": [],
2103
- "publicAction": "createPoolMemberBContribution",
2104
- "requiresRefs": [
2105
- {
2106
- "bind": {
2107
- "contributionAmount": "fields.contributionAmount",
2108
- "currency": "fields.currency",
2109
- "firstContributionAt": "fields.firstContributionAt",
2110
- "guarantorAccountId": "fields.guarantorAccountId",
2111
- "memberAAccountId": "fields.memberAAccountId",
2112
- "memberBAccountId": "fields.memberBAccountId",
2113
- "memberCAccountId": "fields.memberCAccountId"
2114
- },
2115
- "field": "poolId",
2116
- "statuses": [
2117
- "forming"
2118
- ],
2119
- "unique": true
2120
- }
2121
- ],
2122
- "steps": [
2123
- {
2124
- "bind": {
2125
- "currency": {
2126
- "from": "const",
2127
- "value": "SAR"
2128
- },
2129
- "owner.id": {
2130
- "from": "instance",
2131
- "path": "productId"
2132
- },
2133
- "owner.type": {
2134
- "from": "const",
2135
- "value": "product"
2136
- },
2137
- "productId": {
2138
- "from": "instance",
2139
- "path": "productId"
2140
- },
2141
- "role": {
2142
- "from": "const",
2143
- "value": "product_escrow"
2144
- }
2145
- },
2146
- "capture": {
2147
- "escrowAccountId": "accountId"
2148
- },
2149
- "operation": "account.escrow.provision"
2150
- }
2151
- ],
2152
- "summary": "Create the fixed contribution row for member b"
2153
- },
2154
- "guarantee_cycle_1": {
2155
- "agentDescription": "Have the guarantor fund cycle 1 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
2156
- "effects": {
2157
- "moves": [
2158
- {
2159
- "signature": "moves.collection.pay_in",
2160
- "source": "moves[0]"
2161
- }
2162
- ],
2163
- "reads": [
2164
- {
2165
- "signature": "reads.requires_refs",
2166
- "source": "requiresRefs"
2167
- }
2168
- ]
2169
- },
2170
- "moves": [
2171
- {
2172
- "bind": {
2173
- "amount": {
2174
- "from": "instance",
2175
- "path": "fields.contributionAmount"
2176
- },
2177
- "currency": {
2178
- "from": "const",
2179
- "value": "SAR"
2180
- },
2181
- "destinationAccountId": {
2182
- "from": "instance",
2183
- "path": "refs.escrowAccountId"
2184
- },
2185
- "metadata.instrumentId": {
2186
- "from": "const",
2187
- "value": "pool_member_b_contribution"
2188
- },
2189
- "metadata.instrumentInstanceId": {
2190
- "from": "instance",
2191
- "path": "instrumentInstanceId"
2192
- },
2193
- "metadata.phase": {
2194
- "from": "const",
2195
- "value": "guarantee_cycle_1"
2196
- },
2197
- "productId": {
2198
- "from": "instance",
2199
- "path": "productId"
2200
- },
2201
- "sourceAccountId": {
2202
- "from": "instance",
2203
- "path": "fields.guarantorAccountId"
2204
- }
2205
- },
2206
- "capture": {
2207
- "guaranteeCycle1GuaranteeTransferId": "transferId"
2208
- },
2209
- "key": "guarantee",
2210
- "operation": "internal_transfer.create"
2211
- }
2212
- ],
2213
- "publicAction": "guaranteeCycle1PoolMemberBContribution",
2214
- "requiresRefs": [
2215
- {
2216
- "field": "poolId",
2217
- "statuses": [
2218
- "active_cycle_1"
2219
- ]
2220
- }
2221
- ],
2222
- "steps": [],
2223
- "summary": "Fund the defaulted cycle 1 amount before payout"
2224
- },
2225
- "guarantee_cycle_2": {
2226
- "agentDescription": "Have the guarantor fund cycle 2 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
2227
- "effects": {
2228
- "moves": [
2229
- {
2230
- "signature": "moves.collection.pay_in",
2231
- "source": "moves[0]"
2232
- }
2233
- ],
2234
- "reads": [
2235
- {
2236
- "signature": "reads.requires_refs",
2237
- "source": "requiresRefs"
2238
- }
2239
- ]
2240
- },
2241
- "moves": [
2242
- {
2243
- "bind": {
2244
- "amount": {
2245
- "from": "instance",
2246
- "path": "fields.contributionAmount"
2247
- },
2248
- "currency": {
2249
- "from": "const",
2250
- "value": "SAR"
2251
- },
2252
- "destinationAccountId": {
2253
- "from": "instance",
2254
- "path": "refs.escrowAccountId"
2255
- },
2256
- "metadata.instrumentId": {
2257
- "from": "const",
2258
- "value": "pool_member_b_contribution"
2259
- },
2260
- "metadata.instrumentInstanceId": {
2261
- "from": "instance",
2262
- "path": "instrumentInstanceId"
2263
- },
2264
- "metadata.phase": {
2265
- "from": "const",
2266
- "value": "guarantee_cycle_2"
2267
- },
2268
- "productId": {
2269
- "from": "instance",
2270
- "path": "productId"
2271
- },
2272
- "sourceAccountId": {
2273
- "from": "instance",
2274
- "path": "fields.guarantorAccountId"
2275
- }
2276
- },
2277
- "capture": {
2278
- "guaranteeCycle2GuaranteeTransferId": "transferId"
2279
- },
2280
- "key": "guarantee",
2281
- "operation": "internal_transfer.create"
2282
- }
2283
- ],
2284
- "publicAction": "guaranteeCycle2PoolMemberBContribution",
2285
- "requiresRefs": [
2286
- {
2287
- "field": "poolId",
2288
- "statuses": [
2289
- "active_cycle_2"
2290
- ]
2291
- }
2292
- ],
2293
- "steps": [],
2294
- "summary": "Fund the defaulted cycle 2 amount before payout"
2295
- },
2296
- "guarantee_cycle_3": {
2297
- "agentDescription": "Have the guarantor fund cycle 3 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
2298
- "effects": {
2299
- "moves": [
2300
- {
2301
- "signature": "moves.collection.pay_in",
2302
- "source": "moves[0]"
2303
- }
2304
- ],
2305
- "reads": [
2306
- {
2307
- "signature": "reads.requires_refs",
2308
- "source": "requiresRefs"
2309
- }
2310
- ]
2311
- },
2312
- "moves": [
2313
- {
2314
- "bind": {
2315
- "amount": {
2316
- "from": "instance",
2317
- "path": "fields.contributionAmount"
2318
- },
2319
- "currency": {
2320
- "from": "const",
2321
- "value": "SAR"
2322
- },
2323
- "destinationAccountId": {
2324
- "from": "instance",
2325
- "path": "refs.escrowAccountId"
2326
- },
2327
- "metadata.instrumentId": {
2328
- "from": "const",
2329
- "value": "pool_member_b_contribution"
2330
- },
2331
- "metadata.instrumentInstanceId": {
2332
- "from": "instance",
2333
- "path": "instrumentInstanceId"
2334
- },
2335
- "metadata.phase": {
2336
- "from": "const",
2337
- "value": "guarantee_cycle_3"
2338
- },
2339
- "productId": {
2340
- "from": "instance",
2341
- "path": "productId"
2342
- },
2343
- "sourceAccountId": {
2344
- "from": "instance",
2345
- "path": "fields.guarantorAccountId"
2346
- }
2347
- },
2348
- "capture": {
2349
- "guaranteeCycle3GuaranteeTransferId": "transferId"
2350
- },
2351
- "key": "guarantee",
2352
- "operation": "internal_transfer.create"
2353
- }
2354
- ],
2355
- "publicAction": "guaranteeCycle3PoolMemberBContribution",
2356
- "requiresRefs": [
2357
- {
2358
- "field": "poolId",
2359
- "statuses": [
2360
- "active_cycle_3"
2361
- ]
2362
- }
2363
- ],
2364
- "steps": [],
2365
- "summary": "Fund the defaulted cycle 3 amount before payout"
2366
- },
2367
- "mark_default_cycle_1": {
2368
- "due": {
2369
- "field": "firstContributionAt"
2370
- },
2371
- "effects": {
2372
- "reads": [
2373
- {
2374
- "signature": "reads.requires_refs",
2375
- "source": "requiresRefs"
2376
- }
2377
- ],
2378
- "schedules": [
2379
- {
2380
- "signature": "schedules.due",
2381
- "source": "due"
2382
- }
2383
- ]
2384
- },
2385
- "moves": [],
2386
- "requiresRefs": [
2387
- {
2388
- "field": "poolId",
2389
- "statuses": [
2390
- "active_cycle_1"
2391
- ]
2392
- }
2393
- ],
2394
- "steps": [],
2395
- "summary": "Mark the stored cycle 1 due condition"
2396
- },
2397
- "mark_default_cycle_2": {
2398
- "due": {
2399
- "field": "firstContributionAt",
2400
- "offset": "P30D"
2401
- },
2402
- "effects": {
2403
- "reads": [
2404
- {
2405
- "signature": "reads.requires_refs",
2406
- "source": "requiresRefs"
2407
- }
2408
- ],
2409
- "schedules": [
2410
- {
2411
- "signature": "schedules.due",
2412
- "source": "due"
2413
- }
2414
- ]
2415
- },
2416
- "moves": [],
2417
- "requiresRefs": [
2418
- {
2419
- "field": "poolId",
2420
- "statuses": [
2421
- "active_cycle_2"
2422
- ]
2423
- }
2424
- ],
2425
- "steps": [],
2426
- "summary": "Mark the stored cycle 2 due condition"
2427
- },
2428
- "mark_default_cycle_3": {
2429
- "due": {
2430
- "field": "firstContributionAt",
2431
- "offset": "P60D"
2432
- },
2433
- "effects": {
2434
- "reads": [
2435
- {
2436
- "signature": "reads.requires_refs",
2437
- "source": "requiresRefs"
2438
- }
2439
- ],
2440
- "schedules": [
2441
- {
2442
- "signature": "schedules.due",
2443
- "source": "due"
2444
- }
2445
- ]
2446
- },
2447
- "moves": [],
2448
- "requiresRefs": [
2449
- {
2450
- "field": "poolId",
2451
- "statuses": [
2452
- "active_cycle_3"
2453
- ]
2454
- }
2455
- ],
2456
- "steps": [],
2457
- "summary": "Mark the stored cycle 3 due condition"
2458
- },
2459
- "pay_cycle_1": {
2460
- "agentDescription": "Pay this row's funded cycle 1 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
2461
- "effects": {
2462
- "moves": [
2463
- {
2464
- "signature": "moves.transfer.internal",
2465
- "source": "moves[0]"
2466
- }
2467
- ],
2468
- "reads": [
2469
- {
2470
- "signature": "reads.requires_refs",
2471
- "source": "requiresRefs"
2472
- }
2473
- ]
2474
- },
2475
- "moves": [
2476
- {
2477
- "bind": {
2478
- "amount": {
2479
- "from": "instance",
2480
- "path": "fields.contributionAmount"
2481
- },
2482
- "currency": {
2483
- "from": "const",
2484
- "value": "SAR"
2485
- },
2486
- "destinationAccountId": {
2487
- "from": "instance",
2488
- "path": "fields.memberBAccountId"
2489
- },
2490
- "metadata.instrumentId": {
2491
- "from": "const",
2492
- "value": "pool_member_b_contribution"
2493
- },
2494
- "metadata.instrumentInstanceId": {
2495
- "from": "instance",
2496
- "path": "instrumentInstanceId"
2497
- },
2498
- "metadata.phase": {
2499
- "from": "const",
2500
- "value": "pay_cycle_1"
2501
- },
2502
- "productId": {
2503
- "from": "instance",
2504
- "path": "productId"
2505
- },
2506
- "sourceAccountId": {
2507
- "from": "instance",
2508
- "path": "refs.escrowAccountId"
2509
- }
2510
- },
2511
- "capture": {
2512
- "payCycle1PayoutTransferId": "transferId"
2513
- },
2514
- "key": "payout",
2515
- "operation": "internal_transfer.create"
2516
- }
2517
- ],
2518
- "publicAction": "payCycle1PoolMemberBContribution",
2519
- "requiresRefs": [
2520
- {
2521
- "field": "poolId",
2522
- "statuses": [
2523
- "cycle_1_ready"
2524
- ]
2525
- }
2526
- ],
2527
- "sandboxFailurePoint": "release",
2528
- "steps": [],
2529
- "summary": "Pay this member's stored contribution into cycle 1's shared pot recipient"
2530
- },
2531
- "pay_cycle_2": {
2532
- "agentDescription": "Pay this row's funded cycle 2 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
2533
- "effects": {
2534
- "moves": [
2535
- {
2536
- "signature": "moves.transfer.internal",
2537
- "source": "moves[0]"
2538
- }
2539
- ],
2540
- "reads": [
2541
- {
2542
- "signature": "reads.requires_refs",
2543
- "source": "requiresRefs"
2544
- }
2545
- ]
2546
- },
2547
- "moves": [
2548
- {
2549
- "bind": {
2550
- "amount": {
2551
- "from": "instance",
2552
- "path": "fields.contributionAmount"
2553
- },
2554
- "currency": {
2555
- "from": "const",
2556
- "value": "SAR"
2557
- },
2558
- "destinationAccountId": {
2559
- "from": "instance",
2560
- "path": "fields.memberCAccountId"
2561
- },
2562
- "metadata.instrumentId": {
2563
- "from": "const",
2564
- "value": "pool_member_b_contribution"
2565
- },
2566
- "metadata.instrumentInstanceId": {
2567
- "from": "instance",
2568
- "path": "instrumentInstanceId"
2569
- },
2570
- "metadata.phase": {
2571
- "from": "const",
2572
- "value": "pay_cycle_2"
2573
- },
2574
- "productId": {
2575
- "from": "instance",
2576
- "path": "productId"
2577
- },
2578
- "sourceAccountId": {
2579
- "from": "instance",
2580
- "path": "refs.escrowAccountId"
2581
- }
2582
- },
2583
- "capture": {
2584
- "payCycle2PayoutTransferId": "transferId"
2585
- },
2586
- "key": "payout",
2587
- "operation": "internal_transfer.create"
2588
- }
2589
- ],
2590
- "publicAction": "payCycle2PoolMemberBContribution",
2591
- "requiresRefs": [
2592
- {
2593
- "field": "poolId",
2594
- "statuses": [
2595
- "cycle_2_ready"
2596
- ]
2597
- }
2598
- ],
2599
- "steps": [],
2600
- "summary": "Pay this member's stored contribution into cycle 2's shared pot recipient"
2601
- },
2602
- "pay_cycle_3": {
2603
- "agentDescription": "Pay this row's funded cycle 3 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
2604
- "effects": {
2605
- "moves": [
2606
- {
2607
- "signature": "moves.transfer.internal",
2608
- "source": "moves[0]"
2609
- }
2610
- ],
2611
- "reads": [
2612
- {
2613
- "signature": "reads.requires_refs",
2614
- "source": "requiresRefs"
2615
- }
2616
- ]
2617
- },
2618
- "moves": [
2619
- {
2620
- "bind": {
2621
- "amount": {
2622
- "from": "instance",
2623
- "path": "fields.contributionAmount"
2624
- },
2625
- "currency": {
2626
- "from": "const",
2627
- "value": "SAR"
2628
- },
2629
- "destinationAccountId": {
2630
- "from": "instance",
2631
- "path": "fields.memberAAccountId"
2632
- },
2633
- "metadata.instrumentId": {
2634
- "from": "const",
2635
- "value": "pool_member_b_contribution"
2636
- },
2637
- "metadata.instrumentInstanceId": {
2638
- "from": "instance",
2639
- "path": "instrumentInstanceId"
2640
- },
2641
- "metadata.phase": {
2642
- "from": "const",
2643
- "value": "pay_cycle_3"
2644
- },
2645
- "productId": {
2646
- "from": "instance",
2647
- "path": "productId"
2648
- },
2649
- "sourceAccountId": {
2650
- "from": "instance",
2651
- "path": "refs.escrowAccountId"
2652
- }
2653
- },
2654
- "capture": {
2655
- "payCycle3PayoutTransferId": "transferId"
2656
- },
2657
- "key": "payout",
2658
- "operation": "internal_transfer.create"
2659
- }
2660
- ],
2661
- "publicAction": "payCycle3PoolMemberBContribution",
2662
- "requiresRefs": [
2663
- {
2664
- "field": "poolId",
2665
- "statuses": [
2666
- "cycle_3_ready"
2667
- ]
2668
- }
2669
- ],
2670
- "steps": [],
2671
- "summary": "Pay this member's stored contribution into cycle 3's shared pot recipient"
2672
- },
2673
- "pay_guaranteed_cycle_1": {
2674
- "agentDescription": "Pay this row's guarantor-funded cycle 1 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
2675
- "effects": {
2676
- "moves": [
2677
- {
2678
- "signature": "moves.transfer.internal",
2679
- "source": "moves[0]"
2680
- }
2681
- ],
2682
- "reads": [
2683
- {
2684
- "signature": "reads.requires_refs",
2685
- "source": "requiresRefs"
2686
- }
2687
- ]
2688
- },
2689
- "moves": [
2690
- {
2691
- "bind": {
2692
- "amount": {
2693
- "from": "instance",
2694
- "path": "fields.contributionAmount"
2695
- },
2696
- "currency": {
2697
- "from": "const",
2698
- "value": "SAR"
2699
- },
2700
- "destinationAccountId": {
2701
- "from": "instance",
2702
- "path": "fields.memberBAccountId"
2703
- },
2704
- "metadata.instrumentId": {
2705
- "from": "const",
2706
- "value": "pool_member_b_contribution"
2707
- },
2708
- "metadata.instrumentInstanceId": {
2709
- "from": "instance",
2710
- "path": "instrumentInstanceId"
2711
- },
2712
- "metadata.phase": {
2713
- "from": "const",
2714
- "value": "pay_guaranteed_cycle_1"
2715
- },
2716
- "productId": {
2717
- "from": "instance",
2718
- "path": "productId"
2719
- },
2720
- "sourceAccountId": {
2721
- "from": "instance",
2722
- "path": "refs.escrowAccountId"
2723
- }
2724
- },
2725
- "capture": {
2726
- "payGuaranteedCycle1PayoutTransferId": "transferId"
2727
- },
2728
- "key": "payout",
2729
- "operation": "internal_transfer.create"
2730
- }
2731
- ],
2732
- "publicAction": "payGuaranteedCycle1PoolMemberBContribution",
2733
- "requiresRefs": [
2734
- {
2735
- "field": "poolId",
2736
- "statuses": [
2737
- "cycle_1_ready"
2738
- ]
2739
- }
2740
- ],
2741
- "steps": [],
2742
- "summary": "Pay the funded default into cycle 1's stored recipient"
2743
- },
2744
- "pay_guaranteed_cycle_2": {
2745
- "agentDescription": "Pay this row's guarantor-funded cycle 2 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
2746
- "effects": {
2747
- "moves": [
2748
- {
2749
- "signature": "moves.transfer.internal",
2750
- "source": "moves[0]"
2751
- }
2752
- ],
2753
- "reads": [
2754
- {
2755
- "signature": "reads.requires_refs",
2756
- "source": "requiresRefs"
2757
- }
2758
- ]
2759
- },
2760
- "moves": [
2761
- {
2762
- "bind": {
2763
- "amount": {
2764
- "from": "instance",
2765
- "path": "fields.contributionAmount"
2766
- },
2767
- "currency": {
2768
- "from": "const",
2769
- "value": "SAR"
2770
- },
2771
- "destinationAccountId": {
2772
- "from": "instance",
2773
- "path": "fields.memberCAccountId"
2774
- },
2775
- "metadata.instrumentId": {
2776
- "from": "const",
2777
- "value": "pool_member_b_contribution"
2778
- },
2779
- "metadata.instrumentInstanceId": {
2780
- "from": "instance",
2781
- "path": "instrumentInstanceId"
2782
- },
2783
- "metadata.phase": {
2784
- "from": "const",
2785
- "value": "pay_guaranteed_cycle_2"
2786
- },
2787
- "productId": {
2788
- "from": "instance",
2789
- "path": "productId"
2790
- },
2791
- "sourceAccountId": {
2792
- "from": "instance",
2793
- "path": "refs.escrowAccountId"
2794
- }
2795
- },
2796
- "capture": {
2797
- "payGuaranteedCycle2PayoutTransferId": "transferId"
2798
- },
2799
- "key": "payout",
2800
- "operation": "internal_transfer.create"
2801
- }
2802
- ],
2803
- "publicAction": "payGuaranteedCycle2PoolMemberBContribution",
2804
- "requiresRefs": [
2805
- {
2806
- "field": "poolId",
2807
- "statuses": [
2808
- "cycle_2_ready"
2809
- ]
2810
- }
2811
- ],
2812
- "steps": [],
2813
- "summary": "Pay the funded default into cycle 2's stored recipient"
2814
- },
2815
- "pay_guaranteed_cycle_3": {
2816
- "agentDescription": "Pay this row's guarantor-funded cycle 3 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
2817
- "effects": {
2818
- "moves": [
2819
- {
2820
- "signature": "moves.transfer.internal",
2821
- "source": "moves[0]"
2822
- }
2823
- ],
2824
- "reads": [
2825
- {
2826
- "signature": "reads.requires_refs",
2827
- "source": "requiresRefs"
2828
- }
2829
- ]
2830
- },
2831
- "moves": [
2832
- {
2833
- "bind": {
2834
- "amount": {
2835
- "from": "instance",
2836
- "path": "fields.contributionAmount"
2837
- },
2838
- "currency": {
2839
- "from": "const",
2840
- "value": "SAR"
2841
- },
2842
- "destinationAccountId": {
2843
- "from": "instance",
2844
- "path": "fields.memberAAccountId"
2845
- },
2846
- "metadata.instrumentId": {
2847
- "from": "const",
2848
- "value": "pool_member_b_contribution"
2849
- },
2850
- "metadata.instrumentInstanceId": {
2851
- "from": "instance",
2852
- "path": "instrumentInstanceId"
2853
- },
2854
- "metadata.phase": {
2855
- "from": "const",
2856
- "value": "pay_guaranteed_cycle_3"
2857
- },
2858
- "productId": {
2859
- "from": "instance",
2860
- "path": "productId"
2861
- },
2862
- "sourceAccountId": {
2863
- "from": "instance",
2864
- "path": "refs.escrowAccountId"
2865
- }
2866
- },
2867
- "capture": {
2868
- "payGuaranteedCycle3PayoutTransferId": "transferId"
2869
- },
2870
- "key": "payout",
2871
- "operation": "internal_transfer.create"
2872
- }
2873
- ],
2874
- "publicAction": "payGuaranteedCycle3PoolMemberBContribution",
2875
- "requiresRefs": [
2876
- {
2877
- "field": "poolId",
2878
- "statuses": [
2879
- "cycle_3_ready"
2880
- ]
2881
- }
2882
- ],
2883
- "steps": [],
2884
- "summary": "Pay the funded default into cycle 3's stored recipient"
2885
- }
2886
- },
2887
- "agentDescription": "One seat in the pool. The member b pays the same contribution every cycle and takes the whole pot on their turn. Every contribution, default, guarantee, and payout for that member happens on this row, never on the pool itself.",
2888
- "description": "Fixed contribution row for member b",
2889
- "fields": {
2890
- "contributionAmount": {
2891
- "description": "Exact contribution amount shared by every cycle",
2892
- "pattern": "^[1-9][0-9]{0,17}$",
2893
- "type": "string",
2894
- "x-hyperscale-currency": "SAR"
2895
- },
2896
- "currency": {
2897
- "description": "ISO 4217 currency code",
2898
- "maxLength": 3,
2899
- "minLength": 3,
2900
- "pattern": "^[A-Z]{3}$",
2901
- "type": "string"
2902
- },
2903
- "firstContributionAt": {
2904
- "description": "First due anchor derived from the pool",
2905
- "format": "hyperscale-date-time",
2906
- "type": "string"
2907
- },
2908
- "guarantorAccountId": {
2909
- "description": "The guarantor account",
2910
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
2911
- "type": "string",
2912
- "x-hyperscale-reference-filter": {
2913
- "column": "role",
2914
- "values": [
2915
- "customer_balance"
2916
- ]
2917
- }
2918
- },
2919
- "memberAAccountId": {
2920
- "description": "The member a account",
2921
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
2922
- "type": "string",
2923
- "x-hyperscale-reference-filter": {
2924
- "column": "role",
2925
- "values": [
2926
- "customer_balance"
2927
- ]
2928
- }
2929
- },
2930
- "memberBAccountId": {
2931
- "description": "The member b account",
2932
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
2933
- "type": "string",
2934
- "x-hyperscale-reference-filter": {
2935
- "column": "role",
2936
- "values": [
2937
- "customer_balance"
2938
- ]
2939
- }
2940
- },
2941
- "memberCAccountId": {
2942
- "description": "The member c account",
2943
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
2944
- "type": "string",
2945
- "x-hyperscale-reference-filter": {
2946
- "column": "role",
2947
- "values": [
2948
- "customer_balance"
2949
- ]
2950
- }
2951
- },
2952
- "poolId": {
2953
- "description": "The exact pool",
2954
- "pattern": "^pool_(sandbox|live)_[a-z0-9]{8,64}$",
2955
- "type": "string"
2956
- }
2957
- },
2958
- "id": "pool_member_b_contribution",
2959
- "idPrefix": "zzab",
2960
- "lifecycle": {
2961
- "initial": "cycle_1_due",
2962
- "states": [
2963
- "cycle_1_due",
2964
- "cycle_1_funded",
2965
- "cycle_1_defaulted",
2966
- "cycle_1_guaranteed",
2967
- "cycle_2_due",
2968
- "cycle_2_funded",
2969
- "cycle_2_defaulted",
2970
- "cycle_2_guaranteed",
2971
- "cycle_3_due",
2972
- "cycle_3_funded",
2973
- "cycle_3_defaulted",
2974
- "cycle_3_guaranteed",
2975
- "final_paid",
2976
- "completed"
2977
- ],
2978
- "transitions": {
2979
- "close": {
2980
- "from": [
2981
- "final_paid"
2982
- ],
2983
- "to": "completed"
2984
- },
2985
- "contribute_cycle_1": {
2986
- "from": [
2987
- "cycle_1_due"
2988
- ],
2989
- "to": "cycle_1_funded"
2990
- },
2991
- "contribute_cycle_2": {
2992
- "from": [
2993
- "cycle_2_due"
2994
- ],
2995
- "to": "cycle_2_funded"
2996
- },
2997
- "contribute_cycle_3": {
2998
- "from": [
2999
- "cycle_3_due"
3000
- ],
3001
- "to": "cycle_3_funded"
3002
- },
3003
- "guarantee_cycle_1": {
3004
- "from": [
3005
- "cycle_1_defaulted"
3006
- ],
3007
- "to": "cycle_1_guaranteed"
3008
- },
3009
- "guarantee_cycle_2": {
3010
- "from": [
3011
- "cycle_2_defaulted"
3012
- ],
3013
- "to": "cycle_2_guaranteed"
3014
- },
3015
- "guarantee_cycle_3": {
3016
- "from": [
3017
- "cycle_3_defaulted"
3018
- ],
3019
- "to": "cycle_3_guaranteed"
3020
- },
3021
- "mark_default_cycle_1": {
3022
- "from": [
3023
- "cycle_1_due"
3024
- ],
3025
- "to": "cycle_1_defaulted"
3026
- },
3027
- "mark_default_cycle_2": {
3028
- "from": [
3029
- "cycle_2_due"
3030
- ],
3031
- "to": "cycle_2_defaulted"
3032
- },
3033
- "mark_default_cycle_3": {
3034
- "from": [
3035
- "cycle_3_due"
3036
- ],
3037
- "to": "cycle_3_defaulted"
3038
- },
3039
- "pay_cycle_1": {
3040
- "from": [
3041
- "cycle_1_funded"
3042
- ],
3043
- "to": "cycle_2_due"
3044
- },
3045
- "pay_cycle_2": {
3046
- "from": [
3047
- "cycle_2_funded"
3048
- ],
3049
- "to": "cycle_3_due"
3050
- },
3051
- "pay_cycle_3": {
3052
- "from": [
3053
- "cycle_3_funded"
3054
- ],
3055
- "to": "final_paid"
3056
- },
3057
- "pay_guaranteed_cycle_1": {
3058
- "from": [
3059
- "cycle_1_guaranteed"
3060
- ],
3061
- "to": "cycle_2_due"
3062
- },
3063
- "pay_guaranteed_cycle_2": {
3064
- "from": [
3065
- "cycle_2_guaranteed"
3066
- ],
3067
- "to": "cycle_3_due"
3068
- },
3069
- "pay_guaranteed_cycle_3": {
3070
- "from": [
3071
- "cycle_3_guaranteed"
3072
- ],
3073
- "to": "final_paid"
3074
- }
3075
- }
3076
- },
3077
- "parties": {
3078
- "beneficiary": "memberBAccountId",
3079
- "payer": "guarantorAccountId"
3080
- },
3081
- "required": [
3082
- "memberBAccountId",
3083
- "guarantorAccountId",
3084
- "memberCAccountId",
3085
- "memberAAccountId",
3086
- "contributionAmount",
3087
- "currency",
3088
- "firstContributionAt",
3089
- "poolId"
3090
- ],
3091
- "summary": "member b contribution row",
3092
- "title": "Pool Member b Contribution"
3093
- },
3094
- {
3095
- "actionOrder": [
3096
- "create",
3097
- "contribute_cycle_1",
3098
- "mark_default_cycle_1",
3099
- "guarantee_cycle_1",
3100
- "pay_cycle_1",
3101
- "pay_guaranteed_cycle_1",
3102
- "contribute_cycle_2",
3103
- "mark_default_cycle_2",
3104
- "guarantee_cycle_2",
3105
- "pay_cycle_2",
3106
- "pay_guaranteed_cycle_2",
3107
- "contribute_cycle_3",
3108
- "mark_default_cycle_3",
3109
- "guarantee_cycle_3",
3110
- "pay_cycle_3",
3111
- "pay_guaranteed_cycle_3",
3112
- "close"
3113
- ],
3114
- "actions": {
3115
- "close": {
3116
- "agentDescription": "Retire this member row after its final payout. Refused while the row escrow account still holds anything, so a row can never close over stranded money. No money moves.",
3117
- "moves": [],
3118
- "publicAction": "closePoolMemberCContribution",
3119
- "requiresDrainedAccount": {
3120
- "path": "refs.escrowAccountId"
3121
- },
3122
- "steps": [],
3123
- "summary": "Complete after the final payout drains this member custody"
3124
- },
3125
- "contribute_cycle_1": {
3126
- "due": {
3127
- "field": "firstContributionAt"
3128
- },
3129
- "effects": {
3130
- "moves": [
3131
- {
3132
- "signature": "moves.collection.pay_in",
3133
- "source": "moves[0]"
3134
- }
3135
- ],
3136
- "reads": [
3137
- {
3138
- "signature": "reads.requires_refs",
3139
- "source": "requiresRefs"
3140
- }
3141
- ],
3142
- "schedules": [
3143
- {
3144
- "signature": "schedules.due",
3145
- "source": "due"
3146
- }
3147
- ]
3148
- },
3149
- "moves": [
3150
- {
3151
- "bind": {
3152
- "amount": {
3153
- "from": "instance",
3154
- "path": "fields.contributionAmount"
3155
- },
3156
- "currency": {
3157
- "from": "const",
3158
- "value": "SAR"
3159
- },
3160
- "destinationAccountId": {
3161
- "from": "instance",
3162
- "path": "refs.escrowAccountId"
3163
- },
3164
- "metadata.instrumentId": {
3165
- "from": "const",
3166
- "value": "pool_member_c_contribution"
3167
- },
3168
- "metadata.instrumentInstanceId": {
3169
- "from": "instance",
3170
- "path": "instrumentInstanceId"
3171
- },
3172
- "metadata.phase": {
3173
- "from": "const",
3174
- "value": "contribute_cycle_1"
3175
- },
3176
- "productId": {
3177
- "from": "instance",
3178
- "path": "productId"
3179
- },
3180
- "sourceAccountId": {
3181
- "from": "instance",
3182
- "path": "fields.memberCAccountId"
3183
- }
3184
- },
3185
- "capture": {
3186
- "contributeCycle1ContributionTransferId": "transferId"
3187
- },
3188
- "key": "contribution",
3189
- "operation": "internal_transfer.create"
3190
- }
3191
- ],
3192
- "requiresRefs": [
3193
- {
3194
- "field": "poolId",
3195
- "statuses": [
3196
- "active_cycle_1"
3197
- ]
3198
- }
3199
- ],
3200
- "sandboxFailurePoint": "funding",
3201
- "steps": [],
3202
- "summary": "Fund member c's cycle 1 contribution"
3203
- },
3204
- "contribute_cycle_2": {
3205
- "due": {
3206
- "field": "firstContributionAt",
3207
- "offset": "P30D"
3208
- },
3209
- "effects": {
3210
- "moves": [
3211
- {
3212
- "signature": "moves.collection.pay_in",
3213
- "source": "moves[0]"
3214
- }
3215
- ],
3216
- "reads": [
3217
- {
3218
- "signature": "reads.requires_refs",
3219
- "source": "requiresRefs"
3220
- }
3221
- ],
3222
- "schedules": [
3223
- {
3224
- "signature": "schedules.due",
3225
- "source": "due"
3226
- }
3227
- ]
3228
- },
3229
- "moves": [
3230
- {
3231
- "bind": {
3232
- "amount": {
3233
- "from": "instance",
3234
- "path": "fields.contributionAmount"
3235
- },
3236
- "currency": {
3237
- "from": "const",
3238
- "value": "SAR"
3239
- },
3240
- "destinationAccountId": {
3241
- "from": "instance",
3242
- "path": "refs.escrowAccountId"
3243
- },
3244
- "metadata.instrumentId": {
3245
- "from": "const",
3246
- "value": "pool_member_c_contribution"
3247
- },
3248
- "metadata.instrumentInstanceId": {
3249
- "from": "instance",
3250
- "path": "instrumentInstanceId"
3251
- },
3252
- "metadata.phase": {
3253
- "from": "const",
3254
- "value": "contribute_cycle_2"
3255
- },
3256
- "productId": {
3257
- "from": "instance",
3258
- "path": "productId"
3259
- },
3260
- "sourceAccountId": {
3261
- "from": "instance",
3262
- "path": "fields.memberCAccountId"
3263
- }
3264
- },
3265
- "capture": {
3266
- "contributeCycle2ContributionTransferId": "transferId"
3267
- },
3268
- "key": "contribution",
3269
- "operation": "internal_transfer.create"
3270
- }
3271
- ],
3272
- "requiresRefs": [
3273
- {
3274
- "field": "poolId",
3275
- "statuses": [
3276
- "active_cycle_2"
3277
- ]
3278
- }
3279
- ],
3280
- "steps": [],
3281
- "summary": "Fund member c's cycle 2 contribution"
3282
- },
3283
- "contribute_cycle_3": {
3284
- "due": {
3285
- "field": "firstContributionAt",
3286
- "offset": "P60D"
3287
- },
3288
- "effects": {
3289
- "moves": [
3290
- {
3291
- "signature": "moves.collection.pay_in",
3292
- "source": "moves[0]"
3293
- }
3294
- ],
3295
- "reads": [
3296
- {
3297
- "signature": "reads.requires_refs",
3298
- "source": "requiresRefs"
3299
- }
3300
- ],
3301
- "schedules": [
3302
- {
3303
- "signature": "schedules.due",
3304
- "source": "due"
3305
- }
3306
- ]
3307
- },
3308
- "moves": [
3309
- {
3310
- "bind": {
3311
- "amount": {
3312
- "from": "instance",
3313
- "path": "fields.contributionAmount"
3314
- },
3315
- "currency": {
3316
- "from": "const",
3317
- "value": "SAR"
3318
- },
3319
- "destinationAccountId": {
3320
- "from": "instance",
3321
- "path": "refs.escrowAccountId"
3322
- },
3323
- "metadata.instrumentId": {
3324
- "from": "const",
3325
- "value": "pool_member_c_contribution"
3326
- },
3327
- "metadata.instrumentInstanceId": {
3328
- "from": "instance",
3329
- "path": "instrumentInstanceId"
3330
- },
3331
- "metadata.phase": {
3332
- "from": "const",
3333
- "value": "contribute_cycle_3"
3334
- },
3335
- "productId": {
3336
- "from": "instance",
3337
- "path": "productId"
3338
- },
3339
- "sourceAccountId": {
3340
- "from": "instance",
3341
- "path": "fields.memberCAccountId"
3342
- }
3343
- },
3344
- "capture": {
3345
- "contributeCycle3ContributionTransferId": "transferId"
3346
- },
3347
- "key": "contribution",
3348
- "operation": "internal_transfer.create"
3349
- }
3350
- ],
3351
- "requiresRefs": [
3352
- {
3353
- "field": "poolId",
3354
- "statuses": [
3355
- "active_cycle_3"
3356
- ]
3357
- }
3358
- ],
3359
- "steps": [],
3360
- "summary": "Fund member c's cycle 3 contribution"
3361
- },
3362
- "create": {
3363
- "agentDescription": "Create the contribution row for the member c and provision its escrow account. The pool must still be forming, and every member needs exactly one row before the pool can activate. No money moves.",
3364
- "effects": {
3365
- "reads": [
3366
- {
3367
- "signature": "reads.requires_refs",
3368
- "source": "requiresRefs"
3369
- }
3370
- ]
3371
- },
3372
- "moves": [],
3373
- "publicAction": "createPoolMemberCContribution",
3374
- "requiresRefs": [
3375
- {
3376
- "bind": {
3377
- "contributionAmount": "fields.contributionAmount",
3378
- "currency": "fields.currency",
3379
- "firstContributionAt": "fields.firstContributionAt",
3380
- "guarantorAccountId": "fields.guarantorAccountId",
3381
- "memberAAccountId": "fields.memberAAccountId",
3382
- "memberBAccountId": "fields.memberBAccountId",
3383
- "memberCAccountId": "fields.memberCAccountId"
3384
- },
3385
- "field": "poolId",
3386
- "statuses": [
3387
- "forming"
3388
- ],
3389
- "unique": true
3390
- }
3391
- ],
3392
- "steps": [
3393
- {
3394
- "bind": {
3395
- "currency": {
3396
- "from": "const",
3397
- "value": "SAR"
3398
- },
3399
- "owner.id": {
3400
- "from": "instance",
3401
- "path": "productId"
3402
- },
3403
- "owner.type": {
3404
- "from": "const",
3405
- "value": "product"
3406
- },
3407
- "productId": {
3408
- "from": "instance",
3409
- "path": "productId"
3410
- },
3411
- "role": {
3412
- "from": "const",
3413
- "value": "product_escrow"
3414
- }
3415
- },
3416
- "capture": {
3417
- "escrowAccountId": "accountId"
3418
- },
3419
- "operation": "account.escrow.provision"
3420
- }
3421
- ],
3422
- "summary": "Create the fixed contribution row for member c"
3423
- },
3424
- "guarantee_cycle_1": {
3425
- "agentDescription": "Have the guarantor fund cycle 1 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
3426
- "effects": {
3427
- "moves": [
3428
- {
3429
- "signature": "moves.collection.pay_in",
3430
- "source": "moves[0]"
3431
- }
3432
- ],
3433
- "reads": [
3434
- {
3435
- "signature": "reads.requires_refs",
3436
- "source": "requiresRefs"
3437
- }
3438
- ]
3439
- },
3440
- "moves": [
3441
- {
3442
- "bind": {
3443
- "amount": {
3444
- "from": "instance",
3445
- "path": "fields.contributionAmount"
3446
- },
3447
- "currency": {
3448
- "from": "const",
3449
- "value": "SAR"
3450
- },
3451
- "destinationAccountId": {
3452
- "from": "instance",
3453
- "path": "refs.escrowAccountId"
3454
- },
3455
- "metadata.instrumentId": {
3456
- "from": "const",
3457
- "value": "pool_member_c_contribution"
3458
- },
3459
- "metadata.instrumentInstanceId": {
3460
- "from": "instance",
3461
- "path": "instrumentInstanceId"
3462
- },
3463
- "metadata.phase": {
3464
- "from": "const",
3465
- "value": "guarantee_cycle_1"
3466
- },
3467
- "productId": {
3468
- "from": "instance",
3469
- "path": "productId"
3470
- },
3471
- "sourceAccountId": {
3472
- "from": "instance",
3473
- "path": "fields.guarantorAccountId"
3474
- }
3475
- },
3476
- "capture": {
3477
- "guaranteeCycle1GuaranteeTransferId": "transferId"
3478
- },
3479
- "key": "guarantee",
3480
- "operation": "internal_transfer.create"
3481
- }
3482
- ],
3483
- "publicAction": "guaranteeCycle1PoolMemberCContribution",
3484
- "requiresRefs": [
3485
- {
3486
- "field": "poolId",
3487
- "statuses": [
3488
- "active_cycle_1"
3489
- ]
3490
- }
3491
- ],
3492
- "steps": [],
3493
- "summary": "Fund the defaulted cycle 1 amount before payout"
3494
- },
3495
- "guarantee_cycle_2": {
3496
- "agentDescription": "Have the guarantor fund cycle 2 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
3497
- "effects": {
3498
- "moves": [
3499
- {
3500
- "signature": "moves.collection.pay_in",
3501
- "source": "moves[0]"
3502
- }
3503
- ],
3504
- "reads": [
3505
- {
3506
- "signature": "reads.requires_refs",
3507
- "source": "requiresRefs"
3508
- }
3509
- ]
3510
- },
3511
- "moves": [
3512
- {
3513
- "bind": {
3514
- "amount": {
3515
- "from": "instance",
3516
- "path": "fields.contributionAmount"
3517
- },
3518
- "currency": {
3519
- "from": "const",
3520
- "value": "SAR"
3521
- },
3522
- "destinationAccountId": {
3523
- "from": "instance",
3524
- "path": "refs.escrowAccountId"
3525
- },
3526
- "metadata.instrumentId": {
3527
- "from": "const",
3528
- "value": "pool_member_c_contribution"
3529
- },
3530
- "metadata.instrumentInstanceId": {
3531
- "from": "instance",
3532
- "path": "instrumentInstanceId"
3533
- },
3534
- "metadata.phase": {
3535
- "from": "const",
3536
- "value": "guarantee_cycle_2"
3537
- },
3538
- "productId": {
3539
- "from": "instance",
3540
- "path": "productId"
3541
- },
3542
- "sourceAccountId": {
3543
- "from": "instance",
3544
- "path": "fields.guarantorAccountId"
3545
- }
3546
- },
3547
- "capture": {
3548
- "guaranteeCycle2GuaranteeTransferId": "transferId"
3549
- },
3550
- "key": "guarantee",
3551
- "operation": "internal_transfer.create"
3552
- }
3553
- ],
3554
- "publicAction": "guaranteeCycle2PoolMemberCContribution",
3555
- "requiresRefs": [
3556
- {
3557
- "field": "poolId",
3558
- "statuses": [
3559
- "active_cycle_2"
3560
- ]
3561
- }
3562
- ],
3563
- "steps": [],
3564
- "summary": "Fund the defaulted cycle 2 amount before payout"
3565
- },
3566
- "guarantee_cycle_3": {
3567
- "agentDescription": "Have the guarantor fund cycle 3 for this member after the row defaulted. The row must be marked defaulted for that cycle. This moves the guarantor's money into the row escrow so the pot still pays in full.",
3568
- "effects": {
3569
- "moves": [
3570
- {
3571
- "signature": "moves.collection.pay_in",
3572
- "source": "moves[0]"
3573
- }
3574
- ],
3575
- "reads": [
3576
- {
3577
- "signature": "reads.requires_refs",
3578
- "source": "requiresRefs"
3579
- }
3580
- ]
3581
- },
3582
- "moves": [
3583
- {
3584
- "bind": {
3585
- "amount": {
3586
- "from": "instance",
3587
- "path": "fields.contributionAmount"
3588
- },
3589
- "currency": {
3590
- "from": "const",
3591
- "value": "SAR"
3592
- },
3593
- "destinationAccountId": {
3594
- "from": "instance",
3595
- "path": "refs.escrowAccountId"
3596
- },
3597
- "metadata.instrumentId": {
3598
- "from": "const",
3599
- "value": "pool_member_c_contribution"
3600
- },
3601
- "metadata.instrumentInstanceId": {
3602
- "from": "instance",
3603
- "path": "instrumentInstanceId"
3604
- },
3605
- "metadata.phase": {
3606
- "from": "const",
3607
- "value": "guarantee_cycle_3"
3608
- },
3609
- "productId": {
3610
- "from": "instance",
3611
- "path": "productId"
3612
- },
3613
- "sourceAccountId": {
3614
- "from": "instance",
3615
- "path": "fields.guarantorAccountId"
3616
- }
3617
- },
3618
- "capture": {
3619
- "guaranteeCycle3GuaranteeTransferId": "transferId"
3620
- },
3621
- "key": "guarantee",
3622
- "operation": "internal_transfer.create"
3623
- }
3624
- ],
3625
- "publicAction": "guaranteeCycle3PoolMemberCContribution",
3626
- "requiresRefs": [
3627
- {
3628
- "field": "poolId",
3629
- "statuses": [
3630
- "active_cycle_3"
3631
- ]
3632
- }
3633
- ],
3634
- "steps": [],
3635
- "summary": "Fund the defaulted cycle 3 amount before payout"
3636
- },
3637
- "mark_default_cycle_1": {
3638
- "due": {
3639
- "field": "firstContributionAt"
3640
- },
3641
- "effects": {
3642
- "reads": [
3643
- {
3644
- "signature": "reads.requires_refs",
3645
- "source": "requiresRefs"
3646
- }
3647
- ],
3648
- "schedules": [
3649
- {
3650
- "signature": "schedules.due",
3651
- "source": "due"
3652
- }
3653
- ]
3654
- },
3655
- "moves": [],
3656
- "requiresRefs": [
3657
- {
3658
- "field": "poolId",
3659
- "statuses": [
3660
- "active_cycle_1"
3661
- ]
3662
- }
3663
- ],
3664
- "steps": [],
3665
- "summary": "Mark the stored cycle 1 due condition"
3666
- },
3667
- "mark_default_cycle_2": {
3668
- "due": {
3669
- "field": "firstContributionAt",
3670
- "offset": "P30D"
3671
- },
3672
- "effects": {
3673
- "reads": [
3674
- {
3675
- "signature": "reads.requires_refs",
3676
- "source": "requiresRefs"
3677
- }
3678
- ],
3679
- "schedules": [
3680
- {
3681
- "signature": "schedules.due",
3682
- "source": "due"
3683
- }
3684
- ]
3685
- },
3686
- "moves": [],
3687
- "requiresRefs": [
3688
- {
3689
- "field": "poolId",
3690
- "statuses": [
3691
- "active_cycle_2"
3692
- ]
3693
- }
3694
- ],
3695
- "steps": [],
3696
- "summary": "Mark the stored cycle 2 due condition"
3697
- },
3698
- "mark_default_cycle_3": {
3699
- "due": {
3700
- "field": "firstContributionAt",
3701
- "offset": "P60D"
3702
- },
3703
- "effects": {
3704
- "reads": [
3705
- {
3706
- "signature": "reads.requires_refs",
3707
- "source": "requiresRefs"
3708
- }
3709
- ],
3710
- "schedules": [
3711
- {
3712
- "signature": "schedules.due",
3713
- "source": "due"
3714
- }
3715
- ]
3716
- },
3717
- "moves": [],
3718
- "requiresRefs": [
3719
- {
3720
- "field": "poolId",
3721
- "statuses": [
3722
- "active_cycle_3"
3723
- ]
3724
- }
3725
- ],
3726
- "steps": [],
3727
- "summary": "Mark the stored cycle 3 due condition"
3728
- },
3729
- "pay_cycle_1": {
3730
- "agentDescription": "Pay this row's funded cycle 1 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
3731
- "effects": {
3732
- "moves": [
3733
- {
3734
- "signature": "moves.transfer.internal",
3735
- "source": "moves[0]"
3736
- }
3737
- ],
3738
- "reads": [
3739
- {
3740
- "signature": "reads.requires_refs",
3741
- "source": "requiresRefs"
3742
- }
3743
- ]
3744
- },
3745
- "moves": [
3746
- {
3747
- "bind": {
3748
- "amount": {
3749
- "from": "instance",
3750
- "path": "fields.contributionAmount"
3751
- },
3752
- "currency": {
3753
- "from": "const",
3754
- "value": "SAR"
3755
- },
3756
- "destinationAccountId": {
3757
- "from": "instance",
3758
- "path": "fields.memberBAccountId"
3759
- },
3760
- "metadata.instrumentId": {
3761
- "from": "const",
3762
- "value": "pool_member_c_contribution"
3763
- },
3764
- "metadata.instrumentInstanceId": {
3765
- "from": "instance",
3766
- "path": "instrumentInstanceId"
3767
- },
3768
- "metadata.phase": {
3769
- "from": "const",
3770
- "value": "pay_cycle_1"
3771
- },
3772
- "productId": {
3773
- "from": "instance",
3774
- "path": "productId"
3775
- },
3776
- "sourceAccountId": {
3777
- "from": "instance",
3778
- "path": "refs.escrowAccountId"
3779
- }
3780
- },
3781
- "capture": {
3782
- "payCycle1PayoutTransferId": "transferId"
3783
- },
3784
- "key": "payout",
3785
- "operation": "internal_transfer.create"
3786
- }
3787
- ],
3788
- "publicAction": "payCycle1PoolMemberCContribution",
3789
- "requiresRefs": [
3790
- {
3791
- "field": "poolId",
3792
- "statuses": [
3793
- "cycle_1_ready"
3794
- ]
3795
- }
3796
- ],
3797
- "sandboxFailurePoint": "release",
3798
- "steps": [],
3799
- "summary": "Pay this member's stored contribution into cycle 1's shared pot recipient"
3800
- },
3801
- "pay_cycle_2": {
3802
- "agentDescription": "Pay this row's funded cycle 2 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
3803
- "effects": {
3804
- "moves": [
3805
- {
3806
- "signature": "moves.transfer.internal",
3807
- "source": "moves[0]"
3808
- }
3809
- ],
3810
- "reads": [
3811
- {
3812
- "signature": "reads.requires_refs",
3813
- "source": "requiresRefs"
3814
- }
3815
- ]
3816
- },
3817
- "moves": [
3818
- {
3819
- "bind": {
3820
- "amount": {
3821
- "from": "instance",
3822
- "path": "fields.contributionAmount"
3823
- },
3824
- "currency": {
3825
- "from": "const",
3826
- "value": "SAR"
3827
- },
3828
- "destinationAccountId": {
3829
- "from": "instance",
3830
- "path": "fields.memberCAccountId"
3831
- },
3832
- "metadata.instrumentId": {
3833
- "from": "const",
3834
- "value": "pool_member_c_contribution"
3835
- },
3836
- "metadata.instrumentInstanceId": {
3837
- "from": "instance",
3838
- "path": "instrumentInstanceId"
3839
- },
3840
- "metadata.phase": {
3841
- "from": "const",
3842
- "value": "pay_cycle_2"
3843
- },
3844
- "productId": {
3845
- "from": "instance",
3846
- "path": "productId"
3847
- },
3848
- "sourceAccountId": {
3849
- "from": "instance",
3850
- "path": "refs.escrowAccountId"
3851
- }
3852
- },
3853
- "capture": {
3854
- "payCycle2PayoutTransferId": "transferId"
3855
- },
3856
- "key": "payout",
3857
- "operation": "internal_transfer.create"
3858
- }
3859
- ],
3860
- "publicAction": "payCycle2PoolMemberCContribution",
3861
- "requiresRefs": [
3862
- {
3863
- "field": "poolId",
3864
- "statuses": [
3865
- "cycle_2_ready"
3866
- ]
3867
- }
3868
- ],
3869
- "steps": [],
3870
- "summary": "Pay this member's stored contribution into cycle 2's shared pot recipient"
3871
- },
3872
- "pay_cycle_3": {
3873
- "agentDescription": "Pay this row's funded cycle 3 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be funded rather than guaranteed. This moves money and does not reverse.",
3874
- "effects": {
3875
- "moves": [
3876
- {
3877
- "signature": "moves.transfer.internal",
3878
- "source": "moves[0]"
3879
- }
3880
- ],
3881
- "reads": [
3882
- {
3883
- "signature": "reads.requires_refs",
3884
- "source": "requiresRefs"
3885
- }
3886
- ]
3887
- },
3888
- "moves": [
3889
- {
3890
- "bind": {
3891
- "amount": {
3892
- "from": "instance",
3893
- "path": "fields.contributionAmount"
3894
- },
3895
- "currency": {
3896
- "from": "const",
3897
- "value": "SAR"
3898
- },
3899
- "destinationAccountId": {
3900
- "from": "instance",
3901
- "path": "fields.memberAAccountId"
3902
- },
3903
- "metadata.instrumentId": {
3904
- "from": "const",
3905
- "value": "pool_member_c_contribution"
3906
- },
3907
- "metadata.instrumentInstanceId": {
3908
- "from": "instance",
3909
- "path": "instrumentInstanceId"
3910
- },
3911
- "metadata.phase": {
3912
- "from": "const",
3913
- "value": "pay_cycle_3"
3914
- },
3915
- "productId": {
3916
- "from": "instance",
3917
- "path": "productId"
3918
- },
3919
- "sourceAccountId": {
3920
- "from": "instance",
3921
- "path": "refs.escrowAccountId"
3922
- }
3923
- },
3924
- "capture": {
3925
- "payCycle3PayoutTransferId": "transferId"
3926
- },
3927
- "key": "payout",
3928
- "operation": "internal_transfer.create"
3929
- }
3930
- ],
3931
- "publicAction": "payCycle3PoolMemberCContribution",
3932
- "requiresRefs": [
3933
- {
3934
- "field": "poolId",
3935
- "statuses": [
3936
- "cycle_3_ready"
3937
- ]
3938
- }
3939
- ],
3940
- "steps": [],
3941
- "summary": "Pay this member's stored contribution into cycle 3's shared pot recipient"
3942
- },
3943
- "pay_guaranteed_cycle_1": {
3944
- "agentDescription": "Pay this row's guarantor-funded cycle 1 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
3945
- "effects": {
3946
- "moves": [
3947
- {
3948
- "signature": "moves.transfer.internal",
3949
- "source": "moves[0]"
3950
- }
3951
- ],
3952
- "reads": [
3953
- {
3954
- "signature": "reads.requires_refs",
3955
- "source": "requiresRefs"
3956
- }
3957
- ]
3958
- },
3959
- "moves": [
3960
- {
3961
- "bind": {
3962
- "amount": {
3963
- "from": "instance",
3964
- "path": "fields.contributionAmount"
3965
- },
3966
- "currency": {
3967
- "from": "const",
3968
- "value": "SAR"
3969
- },
3970
- "destinationAccountId": {
3971
- "from": "instance",
3972
- "path": "fields.memberBAccountId"
3973
- },
3974
- "metadata.instrumentId": {
3975
- "from": "const",
3976
- "value": "pool_member_c_contribution"
3977
- },
3978
- "metadata.instrumentInstanceId": {
3979
- "from": "instance",
3980
- "path": "instrumentInstanceId"
3981
- },
3982
- "metadata.phase": {
3983
- "from": "const",
3984
- "value": "pay_guaranteed_cycle_1"
3985
- },
3986
- "productId": {
3987
- "from": "instance",
3988
- "path": "productId"
3989
- },
3990
- "sourceAccountId": {
3991
- "from": "instance",
3992
- "path": "refs.escrowAccountId"
3993
- }
3994
- },
3995
- "capture": {
3996
- "payGuaranteedCycle1PayoutTransferId": "transferId"
3997
- },
3998
- "key": "payout",
3999
- "operation": "internal_transfer.create"
4000
- }
4001
- ],
4002
- "publicAction": "payGuaranteedCycle1PoolMemberCContribution",
4003
- "requiresRefs": [
4004
- {
4005
- "field": "poolId",
4006
- "statuses": [
4007
- "cycle_1_ready"
4008
- ]
4009
- }
4010
- ],
4011
- "steps": [],
4012
- "summary": "Pay the funded default into cycle 1's stored recipient"
4013
- },
4014
- "pay_guaranteed_cycle_2": {
4015
- "agentDescription": "Pay this row's guarantor-funded cycle 2 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
4016
- "effects": {
4017
- "moves": [
4018
- {
4019
- "signature": "moves.transfer.internal",
4020
- "source": "moves[0]"
4021
- }
4022
- ],
4023
- "reads": [
4024
- {
4025
- "signature": "reads.requires_refs",
4026
- "source": "requiresRefs"
4027
- }
4028
- ]
4029
- },
4030
- "moves": [
4031
- {
4032
- "bind": {
4033
- "amount": {
4034
- "from": "instance",
4035
- "path": "fields.contributionAmount"
4036
- },
4037
- "currency": {
4038
- "from": "const",
4039
- "value": "SAR"
4040
- },
4041
- "destinationAccountId": {
4042
- "from": "instance",
4043
- "path": "fields.memberCAccountId"
4044
- },
4045
- "metadata.instrumentId": {
4046
- "from": "const",
4047
- "value": "pool_member_c_contribution"
4048
- },
4049
- "metadata.instrumentInstanceId": {
4050
- "from": "instance",
4051
- "path": "instrumentInstanceId"
4052
- },
4053
- "metadata.phase": {
4054
- "from": "const",
4055
- "value": "pay_guaranteed_cycle_2"
4056
- },
4057
- "productId": {
4058
- "from": "instance",
4059
- "path": "productId"
4060
- },
4061
- "sourceAccountId": {
4062
- "from": "instance",
4063
- "path": "refs.escrowAccountId"
4064
- }
4065
- },
4066
- "capture": {
4067
- "payGuaranteedCycle2PayoutTransferId": "transferId"
4068
- },
4069
- "key": "payout",
4070
- "operation": "internal_transfer.create"
4071
- }
4072
- ],
4073
- "publicAction": "payGuaranteedCycle2PoolMemberCContribution",
4074
- "requiresRefs": [
4075
- {
4076
- "field": "poolId",
4077
- "statuses": [
4078
- "cycle_2_ready"
4079
- ]
4080
- }
4081
- ],
4082
- "steps": [],
4083
- "summary": "Pay the funded default into cycle 2's stored recipient"
4084
- },
4085
- "pay_guaranteed_cycle_3": {
4086
- "agentDescription": "Pay this row's guarantor-funded cycle 3 contribution out of escrow to whoever holds the pot that cycle. The cycle must be locked first and the row must be guaranteed rather than funded. This moves money and does not reverse.",
4087
- "effects": {
4088
- "moves": [
4089
- {
4090
- "signature": "moves.transfer.internal",
4091
- "source": "moves[0]"
4092
- }
4093
- ],
4094
- "reads": [
4095
- {
4096
- "signature": "reads.requires_refs",
4097
- "source": "requiresRefs"
4098
- }
4099
- ]
4100
- },
4101
- "moves": [
4102
- {
4103
- "bind": {
4104
- "amount": {
4105
- "from": "instance",
4106
- "path": "fields.contributionAmount"
4107
- },
4108
- "currency": {
4109
- "from": "const",
4110
- "value": "SAR"
4111
- },
4112
- "destinationAccountId": {
4113
- "from": "instance",
4114
- "path": "fields.memberAAccountId"
4115
- },
4116
- "metadata.instrumentId": {
4117
- "from": "const",
4118
- "value": "pool_member_c_contribution"
4119
- },
4120
- "metadata.instrumentInstanceId": {
4121
- "from": "instance",
4122
- "path": "instrumentInstanceId"
4123
- },
4124
- "metadata.phase": {
4125
- "from": "const",
4126
- "value": "pay_guaranteed_cycle_3"
4127
- },
4128
- "productId": {
4129
- "from": "instance",
4130
- "path": "productId"
4131
- },
4132
- "sourceAccountId": {
4133
- "from": "instance",
4134
- "path": "refs.escrowAccountId"
4135
- }
4136
- },
4137
- "capture": {
4138
- "payGuaranteedCycle3PayoutTransferId": "transferId"
4139
- },
4140
- "key": "payout",
4141
- "operation": "internal_transfer.create"
4142
- }
4143
- ],
4144
- "publicAction": "payGuaranteedCycle3PoolMemberCContribution",
4145
- "requiresRefs": [
4146
- {
4147
- "field": "poolId",
4148
- "statuses": [
4149
- "cycle_3_ready"
4150
- ]
4151
- }
4152
- ],
4153
- "steps": [],
4154
- "summary": "Pay the funded default into cycle 3's stored recipient"
4155
- }
4156
- },
4157
- "agentDescription": "One seat in the pool. The member c pays the same contribution every cycle and takes the whole pot on their turn. Every contribution, default, guarantee, and payout for that member happens on this row, never on the pool itself.",
4158
- "description": "Fixed contribution row for member c",
4159
- "fields": {
4160
- "contributionAmount": {
4161
- "description": "Exact contribution amount shared by every cycle",
4162
- "pattern": "^[1-9][0-9]{0,17}$",
4163
- "type": "string",
4164
- "x-hyperscale-currency": "SAR"
4165
- },
4166
- "currency": {
4167
- "description": "ISO 4217 currency code",
4168
- "maxLength": 3,
4169
- "minLength": 3,
4170
- "pattern": "^[A-Z]{3}$",
4171
- "type": "string"
4172
- },
4173
- "firstContributionAt": {
4174
- "description": "First due anchor derived from the pool",
4175
- "format": "hyperscale-date-time",
4176
- "type": "string"
4177
- },
4178
- "guarantorAccountId": {
4179
- "description": "The guarantor account",
4180
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
4181
- "type": "string",
4182
- "x-hyperscale-reference-filter": {
4183
- "column": "role",
4184
- "values": [
4185
- "customer_balance"
4186
- ]
4187
- }
4188
- },
4189
- "memberAAccountId": {
4190
- "description": "The member a account",
4191
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
4192
- "type": "string",
4193
- "x-hyperscale-reference-filter": {
4194
- "column": "role",
4195
- "values": [
4196
- "customer_balance"
4197
- ]
4198
- }
4199
- },
4200
- "memberBAccountId": {
4201
- "description": "The member b account",
4202
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
4203
- "type": "string",
4204
- "x-hyperscale-reference-filter": {
4205
- "column": "role",
4206
- "values": [
4207
- "customer_balance"
4208
- ]
4209
- }
4210
- },
4211
- "memberCAccountId": {
4212
- "description": "The member c account",
4213
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
4214
- "type": "string",
4215
- "x-hyperscale-reference-filter": {
4216
- "column": "role",
4217
- "values": [
4218
- "customer_balance"
4219
- ]
4220
- }
4221
- },
4222
- "poolId": {
4223
- "description": "The exact pool",
4224
- "pattern": "^pool_(sandbox|live)_[a-z0-9]{8,64}$",
4225
- "type": "string"
4226
- }
4227
- },
4228
- "id": "pool_member_c_contribution",
4229
- "idPrefix": "zzac",
4230
- "lifecycle": {
4231
- "initial": "cycle_1_due",
4232
- "states": [
4233
- "cycle_1_due",
4234
- "cycle_1_funded",
4235
- "cycle_1_defaulted",
4236
- "cycle_1_guaranteed",
4237
- "cycle_2_due",
4238
- "cycle_2_funded",
4239
- "cycle_2_defaulted",
4240
- "cycle_2_guaranteed",
4241
- "cycle_3_due",
4242
- "cycle_3_funded",
4243
- "cycle_3_defaulted",
4244
- "cycle_3_guaranteed",
4245
- "final_paid",
4246
- "completed"
4247
- ],
4248
- "transitions": {
4249
- "close": {
4250
- "from": [
4251
- "final_paid"
4252
- ],
4253
- "to": "completed"
4254
- },
4255
- "contribute_cycle_1": {
4256
- "from": [
4257
- "cycle_1_due"
4258
- ],
4259
- "to": "cycle_1_funded"
4260
- },
4261
- "contribute_cycle_2": {
4262
- "from": [
4263
- "cycle_2_due"
4264
- ],
4265
- "to": "cycle_2_funded"
4266
- },
4267
- "contribute_cycle_3": {
4268
- "from": [
4269
- "cycle_3_due"
4270
- ],
4271
- "to": "cycle_3_funded"
4272
- },
4273
- "guarantee_cycle_1": {
4274
- "from": [
4275
- "cycle_1_defaulted"
4276
- ],
4277
- "to": "cycle_1_guaranteed"
4278
- },
4279
- "guarantee_cycle_2": {
4280
- "from": [
4281
- "cycle_2_defaulted"
4282
- ],
4283
- "to": "cycle_2_guaranteed"
4284
- },
4285
- "guarantee_cycle_3": {
4286
- "from": [
4287
- "cycle_3_defaulted"
4288
- ],
4289
- "to": "cycle_3_guaranteed"
4290
- },
4291
- "mark_default_cycle_1": {
4292
- "from": [
4293
- "cycle_1_due"
4294
- ],
4295
- "to": "cycle_1_defaulted"
4296
- },
4297
- "mark_default_cycle_2": {
4298
- "from": [
4299
- "cycle_2_due"
4300
- ],
4301
- "to": "cycle_2_defaulted"
4302
- },
4303
- "mark_default_cycle_3": {
4304
- "from": [
4305
- "cycle_3_due"
4306
- ],
4307
- "to": "cycle_3_defaulted"
4308
- },
4309
- "pay_cycle_1": {
4310
- "from": [
4311
- "cycle_1_funded"
4312
- ],
4313
- "to": "cycle_2_due"
4314
- },
4315
- "pay_cycle_2": {
4316
- "from": [
4317
- "cycle_2_funded"
4318
- ],
4319
- "to": "cycle_3_due"
4320
- },
4321
- "pay_cycle_3": {
4322
- "from": [
4323
- "cycle_3_funded"
4324
- ],
4325
- "to": "final_paid"
4326
- },
4327
- "pay_guaranteed_cycle_1": {
4328
- "from": [
4329
- "cycle_1_guaranteed"
4330
- ],
4331
- "to": "cycle_2_due"
4332
- },
4333
- "pay_guaranteed_cycle_2": {
4334
- "from": [
4335
- "cycle_2_guaranteed"
4336
- ],
4337
- "to": "cycle_3_due"
4338
- },
4339
- "pay_guaranteed_cycle_3": {
4340
- "from": [
4341
- "cycle_3_guaranteed"
4342
- ],
4343
- "to": "final_paid"
4344
- }
4345
- }
4346
- },
4347
- "parties": {
4348
- "beneficiary": "memberCAccountId",
4349
- "payer": "guarantorAccountId"
4350
- },
4351
- "required": [
4352
- "memberCAccountId",
4353
- "guarantorAccountId",
4354
- "memberBAccountId",
4355
- "memberAAccountId",
4356
- "contributionAmount",
4357
- "currency",
4358
- "firstContributionAt",
4359
- "poolId"
4360
- ],
4361
- "summary": "member c contribution row",
4362
- "title": "Pool Member c Contribution"
4363
- }
4364
- ],
4365
- "product": "rotating_pool_example",
4366
- "subjects": [],
4367
- "title": "Rotating pool example",
4368
- "udl": 1,
4369
- "version": 1
4370
- }