Invisium
  • Invisium: INTRODUCTION
    • Introduction: Unleashing the Power of Web3 Infrastructure
  • Invisium: TECHNICAL DOCUMENTATION
    • Invisium: Integration Flow
      • Who can integrate?
    • The List of Features
    • Trading API
      • Uniswap V2 Reserves Extraction
      • Curve Finance: Amount Out After Trade
      • Uniswap V3: Amount Out After Trade
      • Complex Path Trade Simulation
    • Custom Node RPC
      • State Override
    • Simulations
      • Block Estimation State
      • Simulate Transaction - cgp_simulateTransaction
      • Simulate Single Transaction With Override
      • Bundle Simulation - cgp_simulateTransactionsBundle
    • Supported Chains List
  • Invisium: Pricing & Roadmap
    • Pricing: The Canvas Of Possibility
      • Compute Units Table: The Art of Efficiency
  • Invisium: SLAs & Limits
    • SLAs
    • API Limits
Powered by GitBook
On this page
Export as PDF
  1. Invisium: TECHNICAL DOCUMENTATION
  2. Trading API

Complex Path Trade Simulation

Simulate Complex Path (Ethereum only ATM). Performs trade using real swap method inside the liquidity pool, sets real balanceOf of the startAsset for the trade.

The Request limit is 100,000,000 gas units per request. Supported Exchanges: uniswapV2, uniswapV3, curvePool.

Request Example:

curl --location 'https://api.invisium.com/compute-complex-path' \
--header 'Content-Type: application/json' \
--data '{
    "startAsset": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "startAmount": 1000000000000000000,
    "steps": [
        {
            "uniswapV3": {
                "pool": "88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640",
                "token_in": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "token_out": "A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
            }
        },
        {
            "uniswapV2": {
                "pool": "b4e16d0168e52d35cacd2c6185b44281ec28c9dc",
                "token_in": "A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                "token_out": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
            }
        }
    ]
}'

Response Example:

{
    "amountOut": "997913322637794544",
    "amountOutHops": [
        "2311389439",
        "997913322637794544"
    ],
    "totalGasUsed": "182971"
}
PreviousUniswap V3: Amount Out After TradeNextCustom Node RPC

Last updated 6 months ago