Questions about market system



  • I already went to the documentation but couldn't find my answers.

    What is the difference between amout and remainingAmount ? What about when it's buy, and when it's sell ? I thought I could think of a meaning, but remainingAmount is not even the lesser one when the values are different, as I would expect.

    Also :

    Can you buy X and sell Y in the same tick ?

    Can you buy X and sell X in the same tick ?



  • Hello neighbor,

    An order amount is effective amount available in the current tick. Remaining amount represents the total amount leftover on the order.

    This is relevant because you can create an order for more then you currently have available. If I create an order to sell 10k L but only have 1k in the terminal right now. Then amount will be 1k and remaining amount will be 10k.

    In your second set of questions, what is X and Y? If they represent resources then yes. Game.market.deal can be used multiple times in the same tick with different resources or the same resources. With as many orderIds as you wish. Or at least that is my experience so far.

    Kind regards,

    Atavus



  • Thanks for your answer, it helps a lot.

     

    For X and Y, I was talking about minerals, energy, or subscription tokens.

    Also, in your example, do you confirm remaining amount is 10k, and not 9k (since it's the 'leftover') ? Does that value change when someone buys some ?

     

    What about when I place a buy order ? I guess remainingAmount is how many I want to buy, but for amount (or the other way around), surely it can't mean the same thing as before, as I can't "only have 1k in the terminal right now". I'm buying some, doesn't matter what I have. Is it the credits I have ? Or how many I could afford, based on the credits I have and the price I propose ? Or maybe how much space is left in the terminal ? Something else entirely ?

    Seems to me the documentation could use an update and a bit more accuracy.


  • SUN

    A short update:

    > Can you buy X and sell Y in the same tick ?
    > Can you buy X and sell X in the same tick ?

    According to docs, you can execute up to 10 deals during one tick.



  • The remaining amount includes the order amount.

    So the number would be 10k not 9k.

    When a part of the order is completed both amount and remainingAmount will update accordingly. Amount will represent the amount of the resource available in the terminal up to the remainingAmount.