Users

Placing Trades with placeTaker()

To initiate a stablecoin swap, users call the placeTaker() function on the deployed smart contract. This function takes four primary arguments:

  • sell_token: The address of the stablecoin you wish to sell (e.g., USDC on Ethereum).

  • buy_token: The address of the stablecoin you wish to acquire (e.g., USDT on Arbitrum).

  • destination_chain: The chain ID where the acquired stablecoin will be sent (e.g., Arbitrum).

  • order_amount: The amount of the stablecoin you're trading.

Example

For instance, if you want to swap USDC on Ethereum for USDT on Arbitrum, a user would submit the below transaction to the deployed contract on ethereum.

  • placeTaker(usdc_address_on_eth, usdt_address_on_arbitrum, arbitrum_chain_id, order_amount)

Trade Outcomes

Order Filled: If a matching order is found, USDT will be sent to the specified address on the Arbitrum chain.

Order Unmatched: If the order doesn't find a match within a certain number of epochs, the originally deposited USDC is refunded.

Taker orders have priority over maker orders in the matching process. Matching is loosely FIFO: First-In-First-Out.

Last updated