Task Types Reference

This documentation is automatically generated from the job_schemas.protoarrow-up-right source file.

An OracleJob is a collection of tasks that are chained together to arrive at a single numerical value. Tasks execute sequentially, with each task's output feeding into the next.

Some tasks do not consume the running input (such as HttpTask and WebsocketTask), effectively resetting the running result. Others transform the current value through mathematical operations or parsing.

Data Fetching

AnchorFetchTask

Load a parse an Anchor based solana account.

Field
Type
Description

program_id

string

Owning program of the account to parse.

account_address

string

The account to parse.


HttpTask

The adapter will report the text body of a successful HTTP request to the specified url, or return an error if the response status code is greater than or equal to 400.

Input: None

Returns: String representation of the http response.

Example: Basic HttpTask

{
  "httpTask": {
    "url": "https://mywebsite.org/path"
  }
}

Example: HttpTask example with headers

Field
Type
Description

url

string

A string containing the URL to direct this HTTP request to.

method

Method

The type of HTTP request to make.

headers

Header

A list of headers to add to this HttpTask.

body

string

A stringified body (if any) to add to this HttpTask.


SolanaAccountDataFetchTask

Fetch the account data in a stringified buffer format.

Field
Type
Description

pubkey

string

The on-chain account to fetch the account data from.


SolanaToken2022ExtensionTask

Apply Solana Token 2022 extension modifiers to a feed. Input: Token address and extension type. Returns: The value associated with the token2022 extension.

Field
Type
Description

mint

string

The base58 encoded publicKey of the token mint address.


SplTokenParseTask

Fetch the JSON representation of an SPL token mint.


WebsocketTask

Opens and maintains a websocket for light speed data retrieval.

Input: None

Returns: String representation of the websocket subscription message.

Example: Opens a coinbase websocket

Field
Type
Description

url

string

The websocket url.

subscription

string

The websocket message to notify of a new subscription.

max_data_age_seconds

int32

Minimum amount of time required between when the horses are taking out.

filter

string

Example: "$[?(@.channel == 'ticker' && @.market == 'BTC/USD')]"


Parsing

BufferLayoutParseTask

Return the deserialized value from a stringified buffer.

Field
Type
Description

offset

uint32

The buffer offset to start deserializing from.

endian

Endian

The endianness of the stored value.

type

BufferParseType

The type of value to deserialize.


CronParseTask

Return a timestamp from a crontab instruction.

Input: None

Returns: A timestamp

Example: Return the unix timestamp for the on-chain SYSCLOCK

Example: Return the unix timestamp for next friday at 5pm UTC

Field
Type
Description

cron_pattern

string

The cron pattern to parse.

clock_offset

int32

The timestamp offset to calculate the next run.

clock

ClockType

Use the TaskRunner's clock or the on-chain SYSCLOCK.


JsonParseTask

The adapter walks the path specified and returns the value found at that result. If returning JSON data from the HttpGet or HttpPost adapters, you must use this adapter to parse the response.

Input: String representation of a JSON object.

Returns: A numerical result.

Example: Parses the price field from a JSON object

Field
Type
Description

path

string

https://www.npmjs.com/package/jsonpath-plus

aggregation_method

AggregationMethod

The technique that will be used to aggregate the results if walking the specified path returns multiple numerical results.


RegexExtractTask

Find and extract text using regular expressions from the previous task's output.

Input: String output from previous task

Returns: The matched string based on the regex pattern and group number

Example: Extract the first number from a string

Example: Extract text between quotes

Example: Extract the first JSON object from a stream

Field
Type
Description

pattern

string

Uses the fancy-regex Rust crate syntax.

group_number

int32

Defaults to 0 if not specified.


StringMapTask

Map a string input to a predefined output value using exact string matching.

Input: String from previous task output or specified value

Returns: The mapped value as a string if a match is found, or the default value if no match is found.

Example: Map "yes" to "1", "no" to "2", "maybe" to "3" (case-insensitive)

Example: Map HTTP response status with case-sensitive matching

Field
Type
Description

mappings

Mapping

The list of key-value mappings.

default_value

string

Optional default value to return if no mapping matches. If not provided and no match is found, the task will fail.

case_sensitive

bool

Whether the string matching should be case-sensitive. Defaults to true.

input

string

Optional input value to map. If not provided, will use the previous task output.


Mathematical Operations

AddTask

This task will add a numerical input by a scalar value from a job of subtasks, an aggregator, or a big.

Input: The current running numerical result output from a scalar value, an aggregator, a job of subtasks or a big.

Returns: A numerical result.

Example: Returns the numerical result by adding by a job of subtasks.

Example: Returns the numerical result by multiplying by an aggregator.

Example: Returns the numerical result by multiplying by a big.


BoundTask

Bound the running result to an upper/lower bound. This is typically the last task in an OracleJob.

Input: The current running numerical result.

Returns: The running result bounded to an upper or lower bound if it exceeds a given threshold.

Example: Bound the running result to a value between 0.90 and 1.10

Field
Type
Description

lower_bound

OracleJob

The OracleJob to execute for the lower bound value.

lower_bound_value

string

The value to use for the lower bound. Can be set to a ${CACHE_KEY}.

upper_bound

OracleJob

The OracleJob to execute for the upper bound value.

upper_bound_value

string

The value to use for the upper bound. Can be set to a ${CACHE_KEY}.

on_exceeds_upper_bound

OracleJob

The OracleJob to execute if the upper bound is exceeded.

on_exceeds_upper_bound_value

string

The value to use if the upper bound is exceeded. Can be set to a ${CACHE_KEY}.

on_exceeds_lower_bound

OracleJob

The OracleJob to execute if the lower bound is exceeded.

on_exceeds_lower_bound_value

string

The value to use if the lower bound is exceeded. Can be set to a ${CACHE_KEY}.


DivideTask

This task will divide a numerical input by a scalar value from a job of subtasks, an aggregator, or a big.

Input: The current running numerical result output from a scalar value, an aggregator, a job of subtasks or a big.

Returns: A numerical result.

Example: Returns the numerical result by dividing by a job of subtasks.

Example: Returns the numerical result by dividing by an aggregator.

Example: Returns the numerical result by dividing by a big.


MaxTask

Returns the maximum value of all the results returned by the provided subtasks and subjobs. Nested tasks or jobs must return a Number.

Input: None

Returns: A numerical result.

Example: Returns the maximum numerical result from 3 tasks.

Example: Returns the maximum numerical result from 3 jobs.

Field
Type
Description

tasks

Task

A list of subtasks to process and produce a list of result values.

jobs

OracleJob

A list of subjobs to process and produce a list of result values.


MeanTask

Returns the mean (average) of all the results returned by the provided subtasks and subjobs. Nested tasks or jobs must return a Number.

Input: None

Returns: A numerical result.

Example: Returns the mean numerical result of 3 tasks.

Example: Returns the mean numerical result of 3 jobs.

Field
Type
Description

tasks

Task

A list of subtasks to process and produce a list of result values.

jobs

OracleJob

A list of subjobs to process and produce a list of result values.


MedianTask

Returns the median (middle) of all the results returned by the provided subtasks and subjobs. Nested tasks must return a Number.

Input: None

Returns: A numerical result.

Example: Returns the median numerical result of 3 tasks.

Example: Returns the median numerical result of 3 jobs.

Field
Type
Description

tasks

Task

A list of subtasks to process and produce a list of result values.

jobs

OracleJob

A list of subjobs to process and produce a list of result values.

min_successful_required

int32

The minimum number of values before a successful median can be yielded.

max_range_percent

string

The maximum range between the minimum and maximum values before a successful median can be yielded.


MinTask

Returns the minimum value of all the results returned by the provided subtasks and subjobs. Nested tasks or jobs must return a Number.

Input: None

Returns: A numerical result.

Example: Returns the minimum numerical result from 3 tasks.

Example: Returns the minimum numerical result from 3 jobs.

Field
Type
Description

tasks

Task

A list of subtasks to process and produce a list of result values.

jobs

OracleJob

A list of subjobs to process and produce a list of result values.


MultiplyTask

This task will multiply a numerical input by a scalar value from a job of subtasks, an aggregator, or a big.

Input: The current running numerical result output from a scalar value, an aggregator, a job of subtasks or a big.

Returns: A numerical result.

Example: Returns the numerical result by multiplying by a job of subtasks.

Example: Returns the numerical result by multiplying by an aggregator.

Example: Returns the numerical result by multiplying by a big.


PowTask

Round the current running result to an exponential power.

Input: The current running numerical result.

Returns: The input raised to an exponential power.

Example: Raise 2 to the power of 3, 2^3


RoundTask

Round the current running result to a set number of decimal places.

Input: The current running numerical result.

Returns: The running result rounded to a set number of decimal places.

Example: Round down the running resul to 8 decimal places

Field
Type
Description

method

Method

The rounding method to use.

decimals

int32

The number of decimals to round to.


SubtractTask

This task will subtract a numerical input by a scalar value from a job of subtasks, an aggregator, or a big.

Input: The current running numerical result output from a scalar value, an aggregator, a job of subtasks or a big.

Returns: A numerical result.

Example: Returns the numerical result by subtracting by a job of subtasks.

Example: Returns the numerical result by multiplying by an aggregator.

Example: Returns the numerical result by multiplying by a big.


DeFi & DEX

CurveFinanceTask

Fetch pricing information from Curve Finance pools.

Input: None

Returns: The current price/exchange rate from the specified Curve pool.

Example: Fetch the price from a Curve pool on Ethereum

Example: Fetch the price using a custom RPC provider

Field
Type
Description

chain

Chain

Required. Specifies which blockchain to use when reading information from Curve Finance.

provider

string

Optional. The RPC endpoint to use for blockchain requests. If not specified, a default RPC will be used which may have rate limits.

pool_address

string

The on-chain address of the Curve Finance pool to fetch pricing data from.

out_decimals

uint32

The number of decimal places to include in the returned price value.


HyloTask

Hylo Protocol task for converting 1 hyUSD to jitoSOL. hyUSD is a stablecoin with NAV pegged to $1.00 USD. Converts exactly 1 hyUSD token to jitoSOL.

Field
Type
Description

token

Token

The Hylo token to convert from (defaults to hyUSD)


JupiterSwapTask

Fetch the simulated price for a swap on JupiterSwap.

Input: None

Returns: The swap price on Jupiter for a given input and output token mint address.

Example: Fetch the JupiterSwap price for exchanging 1 SOL into USDC.

Example: Fetch the JupiterSwap price for exchanging 1000 SOL into USDC.

Field
Type
Description

in_token_address

string

The input token address.

out_token_address

string

The output token address.

slippage

double

The allowable slippage on the swap in decimal form (e.g. 0.5 is 0.5% slippage)

api_key

string

Optional API key for authenticated requests


KuruTask

Fetch a swap quote from Kuru API for best path routing on EVM chains.

Input: None

Returns: The expected output amount for swapping tokens via Kuru.

Example: Fetch a quote for swapping 1 WETH to USDC.

Example: Fetch a quote with custom slippage tolerance.

Field
Type
Description

user_address

string

The Ethereum address of the user making the swap (default: zero address).

token_in

string

The input token contract address (EVM address format).

token_out

string

The output token contract address (EVM address format).

amount

string

The amount to swap in wei (e.g., "1000000000000000000" for 1 token with 18 decimals).

auto_slippage

bool

Whether to automatically calculate slippage tolerance (default: true).

slippage_tolerance

uint32

Slippage tolerance in basis points (1-10000, e.g., 50 = 0.5%). Only used when auto_slippage is false.

referrer_address

string

Optional referrer address for fee sharing.

referrer_fee_bps

uint32

Optional referrer fee in basis points (0-10000).

input_decimals

uint32

Number of decimals for the input token (default: 18).

output_decimals

uint32

Number of decimals for the output token (default: 18).

api_key

string

Optional API key for authentication (X-API-Key header).

bearer_token

string

Optional bearer token for authentication (Authorization header).

api_endpoint

string

Optional API endpoint override (defaults to ws.staging.kuru.io/api/quote).


LpExchangeRateTask

Fetch the current swap price for a given liquidity pool

Input: None

Returns: The swap price for a given AMM pool.

Example: Fetch the exchange rate from the Orca SOL/USDC pool

Example: Fetch the exchange rate from the Raydium SOL/USDC pool

Field
Type
Description

in_token_address

string

Used alongside mercurial_pool_address to specify the input token for a swap.

out_token_address

string

Used alongside mercurial_pool_address to specify the output token for a swap.


LpTokenPriceTask

Fetch LP token price info from a number of supported exchanges.

See our blog post on Fair LP Token Oraclesarrow-up-right NOTE*: This is not the swap price but the price of the underlying LP token.

Input: None

Returns: The price of an LP token for a given AMM pool.

Example: Fetch the Orca LP token price of the SOL/USDC pool

Example: Fetch the fair price Orca LP token price of the SOL/USDC pool

Example: Fetch the fair price Raydium LP token price of the SOL/USDC pool

Field
Type
Description

price_feed_addresses

string

A list of Switchboard aggregator accounts used to calculate the fair LP price. This ensures the price is based on the previous round to mitigate flash loan price manipulation.

price_feed_jobs

OracleJob

A list of OracleJobs to execute in order to yield the price feed jobs to use for the fair price formula.

use_fair_price

bool

If enabled and price_feed_addresses provided, the oracle will calculate the fair LP price based on the liquidity pool reserves. See our blog post for more information: https://switchboardxyz.medium.com/fair-lp-token-oracles-94a457c50239


MaceTask

Fetch a swap quote from MACE (M.A.C.E.) aggregator for best path routing on EVM chains. MACE is a Multi-DEX EVM trade solver that uses simulated transactions for optimal routing.

Input: None

Returns: The expected output amount for swapping tokens via MACE aggregator.

Example: Fetch a quote for swapping 1 WETH to USDC on Ethereum.

Example: Fetch a quote with custom slippage and gas price.

Field
Type
Description

from_address

string

The Ethereum address of the user making the swap (default: zero address).

token_in

string

Examples: "native", "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701"

token_out

string

The output token identifier (EVM address, "native", or ERC1155 format).

amount

string

The amount to swap in wei (e.g., "1000000000000000000" for 1 token with 18 decimals).

slippage_tolerance_bps

uint32

Slippage tolerance in basis points (1-10000, e.g., 100 = 1%). Default: 10000 (100%).

gas_price_wei

string

Default: "1000000000" (1 Gwei).

max_routes

uint32

Maximum number of routes to return (default: 1). Routes range from most valuable to most stable.

input_decimals

uint32

Number of decimals for the input token (default: 18).

output_decimals

uint32

Number of decimals for the output token (default: 18).

api_key

string

Optional API key for authentication.

api_endpoint

string

Optional API endpoint override (defaults to testnet.api.beta.mace.ag for testnet).


MeteoraSwapTask

Grab the swap price from a Meteora pool.

Field
Type
Description

pool

string

The address of the pool.

type

Type

The pool type.


PancakeswapExchangeRateTask

Fetch the swap price from PancakeSwap.

Field
Type
Description

in_token_address

string

The input token address.

out_token_address

string

The output token address.

in_token_amount

double

The amount of tokens to swap.

slippage

double

The allowable slippage in percent for the swap.

provider

string

The RPC provider to use for the swap.


PumpAmmLpTokenPriceTask

Derive the fair LP token price for a given Pump AMM liquidity pool. Input: Pool address, X token price job, Y token price job. Returns: The fair LP token price for the given Pump AMM liquidity pool. Example: Derive the fair LP token price for a given Pump AMM liquidity pool.

Example: Fetch the Titan price for exchanging 1000 SOL into USDC with slippage.

Field
Type
Description

in_token_address

string

The input token mint address (base58 encoded).

out_token_address

string

The output token mint address (base58 encoded).

amount

string

The amount of tokens to swap (raw atoms, not scaled by decimals).

user_public_key

string

Optional user public key for transaction generation (base58 encoded).

swap_mode

SwapMode

Whether the amount is in terms of input or output token. Defaults to ExactIn.

slippage_bps

uint32

Allowed slippage in basis points (e.g., 50 = 0.5%).

dexes

FilterList

If set, constrain quotes to the given set of DEXes.

exclude_dexes

FilterList

If set, exclude the following DEXes when determining routes.

only_direct_routes

bool

If set to true, only direct routes between the input and output mint will be considered.

providers

string

If set, limit quotes to the given set of provider IDs.

access_token

string

Optional API access token for authenticated requests

api_endpoint

string

Optional API endpoint override (defaults to partners.api.titan.exchange)


UniswapExchangeRateTask

Fetch the swap price from UniSwap.

Field
Type
Description

in_token_address

string

The input token address.

out_token_address

string

The output token address.

in_token_amount

double

The amount of tokens to swap.

slippage

double

The allowable slippage in percent for the swap.

provider

string

The RPC provider to use for the swap.

version

Version

The version of the Uniswap exchange to use.


LST & Staking

LstHistoricalYieldTask

Query historical yield data for a given Liquid Staking Token (LST) and perform a statistical reduction operation over the dataset.

Input: LST mint address, reduction operation type, and number of epochs to sample.

Returns: The computed yield value based on the specified operation.

Example: Compute the median APY for an LST over the last 100 epochs


SplStakePoolTask

Fetch the JSON representation of an SPL Stake Pool account.

Field
Type
Description

pubkey

string

The pubkey of the SPL Stake Pool.


SuiLstPriceTask

Get the exchange rate for Sui Liquid Staking Tokens (LSTs) relative to SUI.

All configuration is passed as parameters, allowing support for any LST without code changes.

Input: None

Returns: The exchange rate (e.g., 1.068 means 1 LST = 1.068 SUI)

Example: haSUI (simple - 1 shared object):

Example: vSUI (2 shared objects - StakePool + Metadata):

Field
Type
Description

package_id

string

The package ID containing the exchange rate function.

module

string

The module name containing the exchange rate function.

function

string

The function name to call (e.g., "get_sui_by_stsui", "from_shares", "get_exchange_rate").

shared_objects

string

These will be resolved to SharedObject arguments with their initial_shared_version.

provide_lst_amount

bool

Set to false for functions like "get_exchange_rate(staking)" that return the rate directly.

rpc_url

string

If not specified, uses the default mainnet RPC.


VsuiPriceTask

Get the vSUI/SUI exchange rate on Sui mainnet. No inputs required - uses hardcoded vSUI pool addresses. @deprecated Use SuiLstPriceTask with lst_type = LST_VSUI instead.

Field
Type
Description

rpc_url

string

If not specified, uses the default mainnet RPC.


Oracle Integration

EwmaTask

No description available.


OracleTask

Fetch the current price of a Solana oracle protocol.

Input: None

Returns: The current price of an on-chain oracle.

Example: The Switchboard SOL/USD oracle price.

Example: The Pyth SOL/USD oracle price.

Example: The Chainlink SOL/USD oracle price.

Field
Type
Description

pyth_allowed_confidence_interval

double

represent 10%, enter the value as 10, not 0.1.


SurgeTwapTask

Compute TWAP from local candle database using AUTO-resolved source.

Uses the AUTO source cache to resolve the best (exchange, pair) for a canonical USD pair, then queries local candle storage and computes TWAP.

Field
Type
Description

symbol

string

Canonical USD trading pair (e.g., "BTC/USD", "ETH/USD", "SOL/USD")

time_interval

TimeInterval

Time interval for TWAP calculation (default: ONE_HOUR)


SwitchboardSurgeTask

Fetch a live spot price straight out of the global Surge websocket cache – the same cache that powers our high-speed on-chain oracles. Input • symbol – the trading-pair symbol as it appears on the exchange • source – which exchange's stream to read from • BINANCE (weight 3) • BYBIT (weight 2) • OKX (weight 2) • COINBASE (weight 3, disabled) • BITGET (weight 2) • PYTH (weight 1) – Pyth oracle network • TITAN (weight 1) – Titan DEX aggregator on Solana • WEIGHTED (default) – use the weighted median of all fresh quotes with the weights shown above. • AUTO – automatically select the best source based on volume, spread, and data quality metrics. Returns The most recent price available from the chosen source. The task fails if the cached tick is older than 5 s. Example: Pull the Binance price for BTC / USDT

Example: Use the weighted-median oracle for BTC / USDT

Example: Pull the Pyth oracle price for PYUSD / USD

Example: Pull the Titan DEX aggregator price for SOL / USDC

Notes • Symbols are auto-normalised (case-insensitive, punctuation removed). • If a venue’s price is stale (> 5 s) it is ignored in the WEIGHTED calculation. The task errors if no fresh price remains. • The weighted-median algorithm uses cumulative weights based on each exchange's data quality and volume. Currently active sources: Binance (3), Bybit (2), OKX (2), Bitget (2), Pyth (1), Titan (1).


TwapTask

Takes a twap over a set period for a certain aggregator. Aggregators have an optional history buffer account storing the last N accepted results. The TwapTask will iterate over an aggregators history buffer and calculate the time weighted average of the samples within a given time period.

Input: None

Returns: The time weighted average of an aggregator over a given time period.

Example: The 1hr Twap of the SOL/USD Aggregator, requiring at least 60 samples.

Field
Type
Description

aggregator_pubkey

string

The target aggregator for the TWAP.

period

int32

Period, in seconds, the twap should account for

weight_by_propagation_time

bool

Weight samples by their propagation time

min_samples

uint32

Minimum number of samples in the history to calculate a valid result

ending_unix_timestamp

int32

Ending unix timestamp to collect values up to

ending_unix_timestamp_task

CronParseTask

Execute the task to get the ending unix timestamp


Specialized Finance

ExponentPTLinearPricingTask

No description available.


ExponentTask

Get the exchange rate between and Exponent vault pricipal token and underlying token. Input: Vault address Returns: The exchange rate between the vault principal token and underlying token. Example: Get the exchange rate between the vault principal token and underlying token.

Field
Type
Description

method

Method

The specific method to use for this task.


OndoUsdyTask

OndoUsdyTask represents a task that computes the price of USDY relative to USD using a specified strategy.

Field
Type
Description

strategy

Strategy

The strategy used to determine the price of USDY.


PerpMarketTask

Fetch the current price of a perpetual market.


TurboEthRedemptionRateTask

Fetches tETH/WETH redemption rate


Utilities

Blake2b128Task

Compute the BLAKE2b-128 hash of the input data and convert it to a numeric Decimal value.

This task follows cryptographic standard hash truncation practices used in:

  • SHA-224: SHA-256 truncated to leftmost 224 bits

  • BLAKE2s-128: BLAKE2s-256 truncated to leftmost 128 bits

  • BLAKE2b-256: BLAKE2b-512 truncated to leftmost 256 bits

Input: String data to hash (can be from a previous task's output)

Returns: A positive Decimal number with 18 decimal places (scale 18)

  • Range: 0.000000000000000000 to 79228162514264.337593543950335 (2^96 - 1, scaled)

  • Example: 17512223723.299011049621773283


Hash-to-Decimal Conversion Algorithm

Step-by-Step Process

1. Compute BLAKE2b-128 hash* (produces 16 bytes / 128 bits)

2. Truncate to 96 bits (12 bytes)* - keep the most significant bits

This follows cryptographic standards where truncation keeps the leftmost/most significant bits. 3. Pad to 16 bytes* for u128 representation

4. Interpret as u128 using big-endian* byte order

Big-endian is the standard for cryptographic hash representations. 5. Convert to Decimal* with scale 18 (18 decimal places)

Scale 18 prevents precision loss when the protocol rescales values. Guaranteed to fit in Decimal's 96-bit mantissa (max: 2^96 - 1).


Reproducibility

To reproduce this conversion in any programming language:

Python Example

JavaScript Example

Rust Example


Why This Approach?

✅ Cryptographic Standard: Follows the same truncation method as SHA-224, BLAKE2s-128, etc. ✅ Preserves Entropy: Keeps the most significant/diverse bits of the hash ✅ Big-Endian: Standard convention for cryptographic hash representations ✅ Fits Decimal Range: 96 bits always fits within Decimal's mantissa (max 2^96-1) ✅ Scale 18: Prevents precision loss when protocol rescales values ✅ Reproducible: Simple algorithm implementable in any programming language ✅ Deterministic: Same input always produces same output


Example: Hash a static string

Example: Hash the output from a previous task (e.g., HTTP response)

Field
Type
Description

value

string

Optional value to hash. If not provided or empty, will use the previous task output.


CacheTask

Execute a job and store the result in a variable to reference later.

Input: None

Returns: The input

Example: CacheTask storing ${ONE} = 1

Field
Type
Description

cache_items

CacheItem

A list of cached variables to reference in the job with ${VARIABLE_NAME}.


ComparisonTask

No description available.

Field
Type
Description

op

Operation

The type of operator to use on the left (lhs) and right (rhs) operand.

on_true

OracleJob

The OracleJob to execute if the condition evaluates to true.

on_true_value

string

The result to use if the condition evaluates to true. Can be set to a ${CACHE_KEY}.

on_false

OracleJob

The OracleJob to execute if the condition evaluates to false.

on_false_value

string

The result to use if the condition evaluates to false. Can be set to a ${CACHE_KEY}.

on_failure

OracleJob

The OracleJob to execute if the condition fails to evaluate.

on_failure_value

string

The result to use if the condition fails to evaluate. Can be set to a ${CACHE_KEY}.


ConditionalTask

This task will run the attempt on the subtasks in an effort to produce a valid numerical result. If attempt. fails to produce an acceptable result, on_failure subtasks will be run instead.

Input: The current running numerical result output from a task.

Returns: A numerical result, else run on_failure subtasks.

Example: Returns the numerical result from the conditionalTask's subtasks, else on_failure returns the numerical result from its subtasks.

Field
Type
Description

attempt

Task

A list of subtasks to process in an attempt to produce a valid numerical result.

on_failure

Task

result.


SecretsTask

Securely request secrets from a Switchboard SecretsServer that are owned by a specific authority. Any secrets that are returned for the current feed will then be unwrapped into variables to be accessed later.

Input: None

Returns: The input

Example: SecretsTask

Field
Type
Description

authority

string

The authority of the secrets that are to be requested.

url

string

The url of the server to request secrets from. The default is https://api.secrets.switchboard.xyz.


SysclockOffsetTask

Return the difference between an oracle's clock and the current timestamp at SYSVAR_CLOCK_PUBKEY.


UnixTimeTask

Get current time in seconds since Unix epoch.

Field
Type
Description

offset

int32

The offset to subtract from the current time.


ValueTask

Returns a specified value.

Input: None

Returns: A numerical result.

Example: Returns the value 10

Example: Returns the currentRound result of an aggregator

Example: Returns the value stored in a CacheTask variable


Protocol-Specific

AftermathTask

No description available.


BitFluxTask

Fetch the current swap price from a BitFlux pool.

Input: None

Returns: The swap price between the specified input and output tokens.

Example: Fetch the swap price using a custom RPC provider

Field
Type
Description

provider

string

Optional. The RPC endpoint to use for requests. If not specified, a default RPC will be used.

pool_address

string

The address of the BitFlux pool.

in_token

string

The address of the input token.

out_token

string

The address of the output token.


CorexTask

No description available.


EtherfuseTask

No description available.


FragmetricTask

Fetch the current price for Fragmetric liquid restaking tokens.

Input: None

Returns: The current price of the specified Fragmetric token relative to SOL (1.0 = 1 SOL)

Example: Fetch the fragSOL token price

Field
Type
Description

token

Token

The Fragmetric token to fetch the price for


GlyphTask

No description available.


XStepPriceTask

No description available.


Other

HistoryFunctionTask

No description available.


LlmTask

Interacts with a Large Language Model (LLM) to generate a text response based on a user-provided prompt.

Input: None

Returns: Text generated by the LLM based on the provided prompt and configuration.

Example: Using OpenAI's GPT-4 model to generate a joke.

Last updated