Trading API
The Trading API is a simplified interface built on top of Invisium’s simulation engine. Its purpose is to allow developers to evaluate swap outcomes, pricing, and liquidity behavior without implementing their own routing logic or interacting directly with smart contracts. Instead of manually constructing paths, decoding contract ABI, or reproducing DEX formulae, the Trading API exposes endpoints that return the expected output amount, the internal path used during the calculation, and any relevant state modifications.
The Trading API performs its calculations through Invisium’s simulation layer, meaning that all results reflect real on-chain conditions: current pool reserves, fees, token mechanics, and execution rules of each DEX implementation. This avoids the common issue where external price estimators return optimistic outputs that diverge from real execution. If a protocol has modified the underlying AMM logic, introduced a different fee model, or forked an EVM DEX with altered formulas, the Trading API will still return results consistent with actual on-chain behavior.
This interface is useful for wallets, aggregators, and trading tools that require accurate swap previews but do not want to maintain their own routing or simulation engines. It helps verify expected output amounts, detect differences between DEX implementations, and prevent losses caused by incorrect price assumptions.
Last updated