Flashnet AMM enables native swaps by computing LP state and executing in the Flashnet intent based execution layer. The trust is distributed against the set of validators, and minimally incurred for anyone swapping against the pool. LPs incur more trust due to the long-ended nature of their position.
The LP is a pool controlled by a set of validators, coordinating in a TEE. Flashnet’s distributed validator network ensures the AMM fairness and execution, whilst Spark’s validator network ensures the swap finality and settlement.1. Creating a pool
To swap, a pool must exist. Creation happens by signing an intent payload with information like:
Pool type
Assets in the pool
Fee rates
Misc pool details (e.g., virtual reserve parameters and graduation threshold for single‑sided)
The signed payload is then given to the execution stack, that generates a distributed LP wallet for the pool. This is returned to the user in the form of an address.2. Adding Liquidity
For single-sided pools, the creator must deposit the declared Asset A amount. The SDK transfers funds and confirms the deposit automatically.
For constant product pools, deposit both assets in the current pool ratio. Excess amounts are atomically refunded.
Provide assetAMinAmountIn and assetBMinAmountIn to protect against price movement during deposit.
Validators validate the intent and claim funds into the LP.
The pool becomes live after a valid deposit.
3. Swapping
The user can now swap against the pool. First, simulate to preview expected output and price impact. Then sign a swap intent with maxSlippageBps and minAmountOut, transfer funds, and submit the signed intent. The validators validate and execute the swap atomically.
The swap settles instantly, and funds are swapped directly to the users non-custodial wallet.
Host and integrator fees are taken exclusively in Asset B of the pool. LP fees are taken as asset in.