Trading example
An example of how the net PnL gets settled between the traders on Polysynth
  • Initial parameters of ETH (x), USDC (y) and Invariant (k) are set algorithmically in the VMM. Price determined by y/x is equal to the reference price of ETH/USDC at initialisation which in our example is equal to USDC 4,000.
  • Alice longs ETH at 2x leverage with 2,000 USDC as collateral. The USDC in the pool goes up from 400,000 to 404,000. How much ETH will she receive in exchange? - The new value of ETH in the pool goes from 100 to 99.01 (using x*y = k; 100*400,000/404,000). Therefore, Alice receives 0.99 ETH in exchange for USDC 4,000, equalling an average trading price of USDC 4,040.4.
  • Bob now longs ETH at 4x leverage with 2,000 USDC as collateral. The USDC in the pool goes up from 404,000 to 412,000. How much ETH will he receive in exchange? - The new value of ETH in the pool goes from 99.01 to 97.09 (using x*y = k; 99.01 * 404,000/412,000). Therefore, Bob receives 1.92 ETH in exchange for USDC 8,000, equalling an average trading price of USDC 4,161.2.
Alice now closes her position of 0.99 ETH. Returning back 0.99 ETH to the pool, therefore ETH in the pool goes up from 97.09 to 98.08. How much profit does she make? - USDC in the pool changes from 412,000 to 407,841 (using x*y = k; 97.09 * 412,000/98.08), i.e. 4,159 is paid out to Alice in exchange for closing her position. PnL for Alice = 4,159 - 4,000 = USDC 159.
Bob now closes his position of 1.92 ETH. Returning back 1.92 ETH to the pool, therefore ETH in the pool goes up from 98.08 to 100. The VMM now goes back to its initial state. How much profit does he make? - USDC in the pool changes from 407,841 to 400,000, i.e. 7,841 is paid out to Bob in exchange for closing his position. PnL for Bob = 7,841 - 8,000 = - USDC 159.
  • Net PnL was settled between the traders.
Last modified 6mo ago
Copy link