Consume Inference
GOAT SDK

GOAT SDK Allora Plugin

GOAT (opens in a new tab) (Great On-chain Agent Toolkit) is an open-source library that lets AI agents interact with blockchain protocols and smart contracts through their own wallets. The Allora plugin, @goat-sdk/plugin-allora (opens in a new tab), gives GOAT-powered agents a tool for fetching future price predictions from the Allora Network.

Goal

Register the Allora plugin in a GOAT agent so the agent can fetch BTC and ETH price predictions from Allora.

Prerequisites

Steps

1. Install the plugin

npm install @goat-sdk/plugin-allora

yarn add and pnpm add work equally.

2. Register the plugin

import { allora } from '@goat-sdk/plugin-allora'
 
const plugin = allora({
    apiKey: process.env.ALLORA_API_KEY,
})

Pass the resulting plugin to your GOAT agent's plugin list the same way as any other GOAT plugin — see the GOAT examples (opens in a new tab) for complete agent setups.

The plugin accepts two options:

OptionRequiredDescription
apiKeyNo, but recommendedYour Allora API key from developer.allora.network (opens in a new tab).
apiRootNoOverride the Allora API root URL. Defaults to the public Allora API.

3. Use the price-prediction tool

The plugin exposes a single tool, getPricePrediction, which fetches a future price prediction for a crypto asset from the Allora Network. It takes:

ParameterAllowed valuesDescription
tickerBTC, ETHThe asset to fetch a price prediction for.
timeframe5m, 8hHow far into the future: 5 minutes or 8 hours.

Once the plugin is registered, your agent can call the tool in response to prompts such as "What will the ETH price be 5 minutes from now?".

Verify

Ask your agent for an ETH price prediction 5 minutes out. The agent should invoke the getPricePrediction tool and reply with a numeric network inference from Allora.

Troubleshoot

  • Unsupported asset or timeframe — the plugin currently supports only the BTC and ETH tickers and the 5m and 8h timeframes.
  • Authentication errors — check that ALLORA_API_KEY is set in your environment and passed to allora(). Free keys are available at developer.allora.network (opens in a new tab).

Next