LogoLogo
  • πŸ––Introduction
  • Products
    • πŸ’«Cross Chain Swaps
      • Core Solutions and Advantages
      • Single Chain Swaps/Meta-aggregation
    • πŸ‘ΎBridge
      • Direct Staking
      • Partnership Request
    • πŸš€Gas Transfer
    • πŸ’°Farm
      • Stablecoin Pools
      • ITP Farms
    • πŸŽ‡ITP Token
      • Contract Addresses
  • Learn More
    • 🀝Integrations
      • LayerZero
      • Circle CCTP
      • Chainlink CCIP
    • πŸͺScalability
      • Interchain Optimal Swaps
      • Automated Arbitrage Pool
      • Interchain Order Book
      • API SDK
      • Cross-Chain DEX Aggregator
    • πŸ‘½Socials and Community
    • πŸ”—Supported Chains
  • Rocket Science
    • πŸ›°οΈTechnical Implementation
      • Diagrams and Charts
      • Swaps
      • Cross-Chain Message
      • Slippage Optimization
      • Destination Chain
      • Stablecoin Liquidity
      • Variable Token and Variable Balance
      • Events
      • Swap on the Same Network
      • Fee Distribution
      • Manager Role
    • πŸ“ƒContracts
    • πŸ›‘οΈAudits
  • Guides
    • Cross-Chain Trading
    • Bridge
    • Gas Transfer
    • Assets Refund
    • Explorer
    • Testnet Bridge
  • TERMS & PRIVACY
    • Terms of Use
    • Privacy Policy
Powered by GitBook
On this page
  1. Rocket Science
  2. Technical Implementation

Swaps

The frontend calls the β€œexecute function” of the ActionExecutor contract, this: passes in the parameters and addresses of the tokens (source and destination), the address of the recipient on the second network (optional), the amount in the source token, and the parameters of the exchange route. If the recipient's address is not specified, it is defaulted to the sender's address.

The parameters also contain a list of possible transactions on the destination chain. These transactions differ in the input sum. The choice of input data for the transaction on the destination chain occurs after the exchange of the token through the DEX aggregator on the initiation chain has been completed. Depending on the real slippage the swap is conducted on the destination chain.

The ActionExecutor contract refers to the ActionExecutorRegistry contract to get more detailed parameters: DEX aggregator router address, cross-chain gateway address, fee amount, etc.

On the initiation chain, the user token is exchanged for a stablecoin. If the user's original token matches the stablecoin token, the exchange step is skipped.

The result is checked for entry into the allowable range of exchange amounts. The received stablecoin is sent to the vault, minus the commission.

PreviousDiagrams and ChartsNextCross-Chain Message

Last updated 1 year ago

πŸ›°οΈ