In the example above, one could split Step 1 into 3 steps, one for material type. Parhaps it’s easier to code then.
One could follow the following principle for the exchange contracts. There would be one or several steps. Each step needs one of the contractors do deliver something to the other one, credits or materials. If it’s materials, then a planet has to be specified. The planet can change from step to step. Each step may or not require several of the preceding steps to be fullfilled. Each step has a time limit. Time is counted either from the closure of the contract if there are no prerequisites, or from the moment the prerequisites have been met.
In the example above it could be:
Step 1: Alice has to deliver to Bob 120 AL on Deimos. Duration: 2 days from the start of the contract.
Step 2: Alice has to deliver to Bob 10 HE on Deimos. Duration: 2 days from the start of the contract.
Step 3: Alice has to deliver to Bob 10 STL on Deimos. Duration : 2 days from the start of the contract.
Here steps 1,2 and 3 are independent and can be completed in any order.
Step 4: Bob has to deliver 40 BHP to Alice on Deimos. Prerequisites: steps 1,2 and 3. Duration: 6 days counted from the moment the steps 1,2 and 3 have been fullfilled.
Step 5: Alice gives Bob 24 000 AIC. Prerequisite: step 4. Duration: 2 days from the moment step 4 has been fullfilled.
This kind of systems allows a lot of flexibility and can encompass many situation. I will give some examples below.
Example 2: One step contract. Step 1: Alice has to give Bob 100 000 AIC. Duration: 3 days.
This is just a donation.
Example 3: Step 1: Alice has to give Bob 127 569 AIC. Duration: 3 days.
Step 2: Alice has to deliver to Bob 27 FE on Phobos. Duration: 3 days.
Step 3: Alice has to deliver to Bob 11 O on Deimos. Duration: 3 days.
In this example Alice is about to leave the game and gives to her friend Bob some of her assets.
Example 4: Step 1: Alice has to deliver to Bob 100 SIO on Phobos. Duration: 3 days.
Step 2: Bob has to give to Alice 5 000 AIC. Duration: 3 days.
This is a usual trade contract, like on LM.
Example 5: Step 1: Alice has to deliver to Bob 100 SIO on Phobos. Duration: 3 days.
Step 2: Bob has to give to Alice 5 000 AIC. Prerequisite: step 1. Duration: 3 days after step 1.
This is almost the same trade contract, but merchandise first. There is also the variant with money first.
Example 6: Step 1: Alice has to deliver to Bob 183 LST on Nike. Duration 3 days.
Step 2: Bob has to deliver to Alice 200 RAT on Deimos. Duration 3 days.
This is a barter contract. But there are 2 different planets involved. Alice has her LST on Nike, but needs the RAT on Deimos, not Nike. Here step 1 and 2 are interchangeable.
Example 7: Step 1: Alice has to give to Bob 10 000 AIC. Duration 3 days.
Step 2: Bob has to give to Alice 10 272 NCC. Duration 3 days.
This is actually a currency exchange contract.
Example 8: Step 1: Alice has to give to Bob 100 000 AIC. Duration 2 days.
Step 2: Bob has to give to Alice 120 000 AIC. Prerequisite: step 1. Duration: 20 days after step 1.
This is a loan. Bob borrows 100 000 AIC from Alice and has to return it with interests 20 days later.
Example 9: Step 1: Alice has to deliver to Bob 1000 MCG on Nike. Duration 2 days.
Step 2: Alice has to give to Bob 500 AIC. Duration 5 days.
Step 3: Bob has to deliver to Alice 1000 MCG on Harmonia. Prerequisite: step 1. Duration: 3 days after step 1.
This is actually a shipping contract in disguise. Alice wants Bob to ship her 1000 MCG from Nike to Harmonia in 3 days, and pays him 500 AIC for that. But it allows more flexibility for Bob than a usual shipping contract. For instance, it can happen that Bob already has his own 1000 MCG on Harmonia. So he could deliver the MCG on Harmonia to Alice from his own reserve, and come for the MCG that Alice gave to him on Nike much later.
Example 10: Step 1:Alice has to give to Bob 20 000 AIC. Duration 2 days.
Step 2: Bob has to deliver to Alice 1000 TUB on Phobos. Prerequisite: step 1. Duration 15 days after step 1.
Step 3: Alice has to give 80 000 AIC to Bob. Prerequisite: step 2. Duration : 2 days after step 2.
In this example, Alice, who is also the governor on Phobos, orders 1000 TUB to Bob, who has several glass furnances. The TUB are needed for POPI. The total cost for Alice is 100 000 AIC. But Bob wants part of this sum to be paid in advance. Because you know, 1000 TUB is a large quantity that would take a lot of time to produce, and it would not be easy to sell on the CX if Alice breaks the contract.
Example 11: Step 1: Alice has to give to Bob 5 000 AIC. Duration 2 days.
Step 2: Bob has to deliver to Alice 100 LST on Deimos. Prerequsitite: step 1. Duration: 2 days after step 1.
Step 3: Alice has to Deliver to Bob 50 BSE on Deimos: Prerequisite: step 2. Duration: 6 days after step 2.
Step 4: Bob has to give to Alice 40 000 AIC. Prerequisite: step 2. Duration: 6 days after step 2.
This is a manufacturing contract. Alice runs some PP2 on Deimos. Bob want to order her 50 BSE.
Alice has the AL for that, she’s on Deimos after all. But she does not have enough LST, and Bob has to provide her with his own LST. However, Bob does not trust Alice enough, and wants a collateral for his LST. Thus step 1.
As one can see, a layered contract system as described here can cover almost all kind of situations.