feeds-dsl-functions
Feeds DSL Functions
Feeds use algorithm DSL to return hydrated rows, then Feed Configs decide how those saved algorithms are served.
Feed algorithm functions
| Function | Meaning |
|---|---|
new StudioV1({ apiKey }) | Creates the Studio DSL client. |
.search() | Starts candidate retrieval. |
.index(name) | Selects the feed source index. |
.include() | Hydrates result rows. |
.term(...), .terms(...), .match(...), .numeric(...), .date(...), .isNull(...), .notNull(...) | Filter candidates before output. |
.sortBy(field, direction) | Orders the feed output. |
.size(n) | Caps feed length. |
.execute() | Runs the query. |
Working feed algorithm
import { StudioV1 } from "algo-dsl";
export default async function algo({ apiKey }) {
const mbd = new StudioV1({ apiKey });
return mbd
.search()
.index("token-items")
.include()
.numeric("zora_market_cap", 10000)
.notNull("name")
.sortBy("zora_market_cap_delta_24h", "desc")
.size(30)
.execute();
}Feed Config relationship
Feed Configs are not a separate feature/scoring/ranking DSL step. They select saved algorithms, define how those algorithms are combined, and make output available through serving endpoints.
Use the algorithm DSL for candidate selection and ordering. Use Feed Configs for deployment and serving.
// Algorithm code returns rows.
const rows = await mbd
.search()
.index("polymarket-items")
.include()
.sortBy("volume_24hr", "desc")
.size(25)
.execute();
return rows;
