πŸ”€Conduit

Here you can learn how to interact with the WasabiConduit.

WasabiConduit is a smart contract that allows users to interact with all WasabiPools simultaneously while only giving NFT and token permissions once (to the conduit).

Check this Twitter thread which explains the Conduit purpose: https://twitter.com/wasabi_dev/status/1614026446321729538arrow-up-right

Buying Options

Buy Single Option

function buyOption(
        WasabiStructs.PoolAsk calldata _request,
        bytes calldata _signature
) external payable returns (uint256)

You can buy a single option given the PoolAsk and it's signature signed by the owner or admin of the pool issuing the option.

  • If the pool is an ETH pool, then ETH equaling the premium of the ask needs to be supplied in the function call.

  • If the pool is an ERC20 pool, then you'll need to give ERC20 approval equaling the premium before this function is called.

Accept Ask

function acceptAsk(
        WasabiStructs.Ask calldata _ask,
        bytes calldata _signature
) external payable returns (uint256)

You can buy a single option given an Ask. This will allow you to buy a WasabiOption from another user instead of a pool.

  • If the ask.tokenAddress is 0x00..000 then ETH equaling the price of the ask needs to be supplied in the function call.

  • Otherwise, you'll need to give ERC20 approval equaling the price of the ask before this function is called.

Buy Multiple Options

You can buy multiple options by providing a list of PoolAsks and Asks. This function will call buyOption and acceptAsk functions in a loop to buy all the specified options. If a purchase of any option fails, the whole transaction will revert.

circle-info

The provided signatures need to be in the order of all the pool asks and asks provided respectively.

Example:

Selling Options

Accepting Bids

You can sell your existing options for a bid that matches the parameters of the option. You'll need to own the option and supply

  • the id of the option

  • the address of the pool which issued the option originally

  • the bid data

  • the signature for the bid signed by the potential buyer

Canceling Orders

You can cancel an ask by calling the cancelAsk function. Only the signer can cancel the ask.

You can cancel a bid by calling the cancelBid function. Only the signer can cancel the bid.

Last updated