Ariel Money
Search
⌃K

Trading Flow

Let’s go through the process with an example:
  1. 1.
    Trader 'A' wants to speculate on Luna-Perp. Trader deposits UST100 as the initial margin to the clearinghouse and opens a 5x long position.
  2. 2.
    The clearinghouse then deposits the collateral asset in the Vault. Based on the margin amount, leverage and direction, the price is updated in the vAMM.
  3. 3.
    Assuming the vAMM contained 100 Luna and 10000 UST in the initial state
  4. 4.
    'A' has deposited UST 100 with 5x leverage and this increases the amount of UST in the pool to 10000+500=10500. As we’re using a constant product function, the amount of Luna will be 95.24 (1000000/10500). This means the position opened by 'A' is 4.76 long (100-95.24)
Action
Luna Reserve
UST Reserve
Calculation
Luna Price
Initial State
100
10000
$100.00
'A' open 5x long position with $100 (4.76 long position)
95.24
10500
1000000/10500
$110.25
5. Trader 'B' also opens a 5x long Luna position with the same UST 100 initial margin. B’s position would then be 4.32 long.
Action
Luna Reserve
UST Reserve
Calculation
Luna Price
Initial State
100
10000
$100.00
'A' open 5x long position with $100 (4.76 long position)
95.24
10500
1000000/10500
$110.25
'B' opens 5x long position with $100 (4.32 long position)
90.91
11000
1000000/11000
$121.00
6. 'A' realizes he can get out with a profit and closes his position with UST 47.51 profit.(11000-(1000000/95.67)-500)
Action
Luna Reserve
UST Reserve
Calculation
Luna Price
Initial State
100
10000
$100.00
'A' open 5x long position with $100 (4.76 long position)
95.24
10500
1000000/10500
$110.25
'B' opens 5x long position with $100 (4.32 long position)
90.91
11000
1000000/11000
$121.00
'A' closes position
95.67
10452.49
1000000/95.67
$109.25
7. 'B' closes her position realizing a loss of UST 47.51
Action
Luna Reserve
UST Reserve
Calculation
Luna Price
Initial State
100
10000
$100.00
'A' open 5x long position with $100 (4.76 long position)
95.24
10500
1000000/10500
$110.25
'B' opens 5x long position with $100 (4.32 long position)
90.91
11000
1000000/11000
$121.00
'A' closes position
95.67
10452.49
1000000/95.67
$109.25
'B' Closes Position
100.00
10000.00
1000000/100
$100.00
Key Takeaways
  • You can observe in the above example that one trader’s gain is another’s loss. It’s akin to p2p future trading.
  • This mechanism doesn’t need any liquidity providers because profit/loss is paid out with the trader’s collateral only.