New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@epsilon-exchange/sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epsilon-exchange/sdk

TypeScript SDK for Epsilon on Robinhood Chain — /v1 API client and non-custodial EIP-712 order signing (limit, stop-loss, DCA)

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@epsilon-exchange/sdk

TypeScript SDK for Epsilon on Robinhood Chain (id 4663): a thin client for the /v1 REST API plus non-custodial EIP-712 order signing for limit, stop-loss, and DCA orders.

Orders are signed locally with your wallet and executed on-chain by keepers — funds stay in the wallet until fill. The API key is attribution and rate limiting; authorization is the maker's signature.

npm install @epsilon-exchange/sdk viem

Quickstart: place a limit order

import { privateKeyToAccount } from 'viem/accounts'
import {
  apiPost, fetchOrderRoute, buildAndSignOrder,
  calculateTriggerPrice, parseUnits, makePublicClient, tokenMeta,
  DEFAULT_RPC_URL, type ApiConfig,
} from '@epsilon-exchange/sdk'

const cfg: ApiConfig = {
  baseUrl: 'https://api.epsilon.exchange',
  apiKey: process.env.EPSILON_API_KEY!, // eps_… — developers.epsilon.exchange
}
const account = privateKeyToAccount(process.env.WALLET_KEY as `0x${string}`)
const pub = makePublicClient(DEFAULT_RPC_URL)

const tokenIn = '0x5fc5360d0400a0fd4f2af552add042d716f1d168' // USDG
const tokenOut = '0x0bd7d308f8e1639fab988df18a8011f41eacad73' // WETH
const inMeta = await tokenMeta(pub, tokenIn)
const outMeta = await tokenMeta(pub, tokenOut)
const amountIn = parseUnits('25', inMeta.decimals)

// 1. Fetch the route — it carries the fee legs the order MUST embed.
const route = await fetchOrderRoute(cfg, {
  tokenIn, tokenOut,
  amountIn: amountIn.toString(),
  slippagePpm: 10_000, // 1%
  wallet: account.address,
})

// 2. Sign locally (EIP-712, domain EpsilonRouter v7).
const signed = await buildAndSignOrder({
  account, tokenIn, tokenOut, amountIn,
  triggerPrice: calculateTriggerPrice('0.0004', outMeta.decimals),
  tokenInDecimals: inMeta.decimals,
  deadline: Math.floor(Date.now() / 1000) + 7 * 24 * 3600,
  slippagePpm: 10_000,
  kind: 'limit',
  feeLegs: route.feeLegs,
})

// 3. Submit the signed payload.
const res = await apiPost<{ orderHash: string }>(cfg, '/v1/orders', {
  orderType: 'limit',
  ...signed,
})
console.log('placed:', res.orderHash)

Remember the one-time ERC-20 approval of the router for tokenIn (approveRouter in this package) before the first order.

What's inside

  • api.ts — /v1 client (apiGet/apiPost/apiDelete, fetchOrderRoute)
  • order.ts — buildAndSignOrder, signCancel, trigger-price math, unit helpers
  • makerTraits.ts — the v7 makerTraits bit layout encoder
  • wallet.ts — viem chain definition, token metadata/balances/allowance, router approval
  • chain.ts — chain id, router address, EIP-712 domain and types

The signing implementation is cross-verified byte-for-byte against the Go indexer via a shared fixture — the same code path the @epsilon-exchange/mcp server uses.

Docs

MIT

Keywords

epsilon

FAQs

Package last updated on 28 Aug 2026

Related posts