๐Ÿ”€Inputs/Outputs

Learn about Inputs/Outputs

What are Inputs?

Automations use inputs and outputs to transfer data between steps, such as "Triggers" and "Actions".

Take a two-step scenario as an example:

  1. Action 1 ("Get Collection Floor"): The input is the Doodles Collection, and the output is the Floor price of this collection.

  2. Action 2 ("List an NFT for Sale"): The input is the Floor price (output from Action 1) and the output is a new NFT listed at this price.

In this way, the output of one action becomes the input for the next, ensuring the new NFT is listed at the current market price.

How to Add Inputs to an Action

Inputs are fed into the input fields of an action, as shown in the screenshot above.

Tip: Input fields can be either required or optional.

You can either manually enter inputs, for example, setting a list price of 0.32 eth, or you can utilize an output from a preceding action/trigger by clicking on 'Use Variable'.

Tip: A variable is a placeholder that symbolizes data.

Note: The 'Use Variable' button is often displayed as {}.

Once you've clicked on 'Add Variable', you can see the outputs from all previous Triggers and Actions. These can be used as inputs in the selected Action. You can expand/collapse the Actions to view their outputs. The 'Recommended' inputs are suggested based on their type.

Tip: If an input field is orange, it means the input is not a recognised as a valid output from a previous step.

You can also see the outputs of Individual actions by adding the Action to your Automation and clicking on Outputs.

Performing Mathematical Operations with Inputs

You can perform various mathematical functions with your inputs, such as multiplying an input by a number or adding two inputs together.

Here are a few examples:

  • Automatically Outbidding: Fetch the top bid and place a new bid at the โ€˜Top Bid + 0.0001โ€™.

  • Setting a Stop Loss: Fetch the Floor price and your purchase price, then list when โ€˜Floor - Last purchase price < 0'.

  • Alert on a Fat Finger Listing: Receive a notification when 'Listing Price is < Floor price * 0.5โ€™.

Here are the steps to perform mathematical operations with inputs:

  1. Click on an input field and select an output from a previous step.

  2. Click on the blue input you've just selected and choose one of the available mathematical functions.

  3. Either manually add a number or click on {} to add another variable to your mathematical logic.

  4. You can add as many mathematical functions as you'd like.

Tip: You can test the mathematical formula you've created by clicking on 'Test Variable' and entering a value for each one of your inputs.

The screenshot below illustrates how to add '0.0001' to an input or combine two inputs.

Note: Compass uses standard LiquidJS formulas for mathematical functions. Learn about all supported LiquidJS functions here.

Tip: Click on 'Advanced' to see and edit a variable directly in LiquidJS.

Tip: You can view the outputs of an action by adding it to your automation and clicking 'Outputs' at the bottom. Learn what the symbols mean below.

Input/Output Types

Input/output types are generally set automatically and you won't need to worry about them. The only time you'll need to manually set them is when you're adding inputs to an automation itself instead of just passing inputs between actions.

Depending on the specific input field, inputs can be numbers (like 4, 24), a text string (like 0x5aAeb6...), a Boolean value (yes/no), or an array (a list of items).

String (Text) Input (Green 'A' icon)

String inputs are the default and most versatile type of inputs. They allow you to enter a variety of values. For example, a collection or wallet address would be entered as a string input.

Array (List) Input (Purple 'List' icon)

Array (or list) inputs allow you to enter multiple lines into a list. This is particularly useful with Notification Channels, where you might want to specify more than one channel.

Number Input (Yellow '#' icon)

Number inputs accept both whole numbers and decimal values. Use a period (.) as the decimal separator in these inputs. For example, enter 0.52 instead of .52.

Boolean True/False Input (Blue 'Toggle' icon)

Boolean inputs only have two possible values: 'true' and 'false'. These can also be represented with the values '0' for false, or '1' for true. This type of input is great for turning alerts on and off, especially when used in conjunction with groups and 'only continue if' actions.

Automation Inputs

Automation inputs simplify the process of adjusting and repurposing automations. By using automation inputs, you can set a parameter like a collection address just once at the top of the automation, rather than having to manually input it in every action that requires it.

This functionality is particularly useful when using automations from the Automation Marketplace. You can set all necessary inputs in one place at the top of your automation, and these values will then be passed on to all the steps within the automation.

How to Add an Input to an Automation?

  1. Open your automation and click on 'Inputs' at the top.

  2. Click on 'Setup' then 'Add' to create a new input.

  3. Name your automation input, for example 'collectionAddress'. Spaces are not supported.

Tip: If you use camelCase when naming your automation inputs, the name will be displayed as 'Camel Case'.

  1. Select the Type.

  2. Add a description. This is especially helpful if you're sharing your automation with others or publishing it on the marketplace.

  3. Choose 'Acting as'.

  4. Untick 'Required' if you want to set a default value for this input.

Tip: Default values are useful when you rarely want to change that value. For instance, an Outbid value of 0.0001 is a good candidate for a default value.

  1. Click 'Add' to finalize.

What is 'Acting as' in Automation Inputs?

The 'Acting as' feature in automation inputs enhances user convenience when setting specific types of values. For instance, if you set the 'Acting as' to 'Collection', you get a collection search bar and collection picker instead of having to manually copy and paste the collection address each time you want to change it.

Available 'Acting as' Options for Each Value Type:

Number Input Type Options:

  • 'Duration': Adds a day/minute selector and converts the input number into seconds.

  • 'Marketplace': Adds a Marketplace picker where you can choose from options like Opensea, Looksrare, X2Y2, or Blur.

  • 'Collection Watchlist': Adds a dropdown menu allowing you to select a watchlist from your collection watchlists. Learn more about collection watchlists here.

String (Text) Input Type Options:

  • 'Collection': Adds a Collection search bar and a dropdown collection picker.

  • 'Wallet': Adds a Wallet search bar and a dropdown wallet picker, enabling you to search for and select any Ethereum wallet.

  • 'Token': Adds a greyed out suggested format into the input text box that shows the long-form format of a token ID (for example, '0ร—0000000000000000000000000000000000000000_321').

  • 'Trading Wallet': Adds a dropdown wallet picker, letting you select from the trading wallets you have created in Compass Automations.

  • 'Period': Adds a period selector and passes on the chosen period as a string (e.g., '5m').

  • 'Trait': Adds a trait picker. The trait picker checks the other Automation inputs for one named 'collection'. If it finds one, it automatically shows the traits of that collection.

Array (List) Input Type Options:

  • 'Notification Channels': Adds a Notification channel picker. When using this 'Acting as' option, choose 'Array' as the type and set the array to include one number.

Last updated