@marketmotion/sdk
v1.0.0
Published
Market Motion SDK — TypeScript client for the Market Motion intelligence API. Search 25K+ entities, scan cross-venue arbitrage, monitor alerts, and access the entity graph programmatically.
Maintainers
Readme
@marketmotion/sdk
TypeScript SDK for the Market Motion intelligence API. Search 25K+ entities, scan cross-venue arbitrage, monitor alerts, and access the entity graph programmatically.
Install
npm install @marketmotion/sdkQuick Start
import { MotionClient } from '@marketmotion/sdk';
const client = new MotionClient({ apiKey: 'your-api-key' });
// Search entities
const results = await client.searchEntities('bitcoin');
// Get entity details + market exposure
const entity = await client.getEntity('bitcoin');
// Cross-venue mispricings
const arbs = await client.getMispricings({ minSpread: 5 });
// Signal feed (injuries, political changes, earnings, etc.)
const signals = await client.getSignalFeed({ limit: 20 });Configuration
// Option 1: Pass directly
const client = new MotionClient({
apiKey: 'mk_...',
baseUrl: 'https://api.marketmotion.xyz', // default
});
// Option 2: Environment variables
// MOTION_API_KEY=mk_...
// MOTION_API_URL=https://api.marketmotion.xyz
const client = new MotionClient();API Coverage
Entities
searchEntities(query, opts?)— Full-text entity searchgetEntity(slug)— Entity details with markets, attributes, relationshipsgetEntityAttributes(slug)— Key-value attributes from 22 source connectorsgetEntityGraph(slug, opts?)— Relationship graph traversalgetEntityRelated(slug, opts?)— Related entitiesgetEntityNeighborhood(slug, opts?)— Graph neighborhood
Markets
getCuratedMarkets()— Staff-curated market pickssearchMarkets(query, opts?)— Market searchfilterMarkets(opts?)— Filter by venue, category, statusgetPredictionMarkets(opts?)— Polymarket/Kalshi listingsgetHyperliquidMarkets(opts?)— Hyperliquid perpetualsgetPriceHistory(identifier, opts?)— OHLCV price history
Intelligence
getEntityISQ(slug, opts?)— Information Sentiment Quotient scoresgetEntitySentiment(slug, opts?)— Sentiment analysis windowsgetIntelligenceBrief(slug, opts?)— AI-generated intelligence briefsgetEntityRumors(slug, opts?)— Rumor detectiongetForecastHistory(slug, opts?)— AI forecast track recordgetForecastAccuracy()— System-wide forecast accuracy
Cross-Venue
getMispricings(opts?)— Cross-venue spread detectiongetCrossVenueMarkets(opts?)— Matched markets across venuesgetMovers(opts?)— Biggest price movers
Alerts & Signals
getAlerts(opts?)— Alert inboxgetSignalFeed(opts?)— Real-time signal feed
News
getTrendingNews(limit?)— Trending newsgetEntityNews(slug, opts?)— Entity-specific newsgetMarketNews(marketId, opts?)— Market-specific newsgetNewsByCategory(category, opts?)— News by category
Trading (Polymarket)
getPolymarketStatus()— Account statusgetPolymarketBalance()— USDC balancegetPolymarketPositions()— Open positionsplacePolymarketOrder(params)— Place ordercancelPolymarketOrder(orderId)— Cancel ordergetPolymarketOrderbook(tokenId)— Order book
Trading (Hyperliquid)
placeHyperliquidOrder(params)— Place perp ordercloseHyperliquidPosition(orderId)— Close position
Webhooks
listWebhooks()— List registered webhookscreateWebhook(params)— Register webhook endpointdeleteWebhook(id)— Remove webhookgetWebhookDeliveries(id, opts?)— Delivery history
Account
validateKey()— Validate API keygetUserProfile()— User profilegetWatchlist()— Watchlist itemsaddToWatchlist(type, id, venue?)— Add to watchlistremoveFromWatchlist(type, id)— Remove from watchlist
Error Handling
import { MotionClient, ApiError } from '@marketmotion/sdk';
try {
const entity = await client.getEntity('nonexistent');
} catch (error) {
if (error instanceof ApiError) {
console.log(error.status); // 404
console.log(error.message); // "Not found"
}
}Requirements
- Node.js >= 18 (uses native
fetch) - Zero runtime dependencies
