@telaro/drift
v0.1.0
Published
Telaro adapter for Drift. Wrap a DriftClient to auto-record perp / spot / liq actions.
Maintainers
Readme
@telaro/drift
Drop-in Telaro adapter for Drift Protocol perp + spot trading. Wrap a
DriftClientto auto-record every order / fill / liquidation as a bonded action.
npm install @telaro/drift @telaro/sdk @drift-labs/sdkimport { DriftClient } from "@drift-labs/sdk";
import { withTelaro } from "@telaro/drift";
const drift = new DriftClient({ connection, wallet, env: "mainnet-beta", ... });
await drift.subscribe();
const bonded = withTelaro(drift, {
bondAmount: 5_000_000_000n, // $5k — perp bots are high-VAR
scorer: SCORER_PUBKEY,
});
await bonded.placePerpOrder({...});
await bonded.liquidatePerp({...}); // liquidator bots become bonded tooMethod → ActionKind mapping
| Drift method | ActionKind |
|---|---|
| placePerpOrder, cancelOrder, liquidatePerp, closePosition | Custom (perp) |
| placeSpotOrder, fillSpotOrder | Swap |
| deposit, withdraw, transferDeposit | Lend |
| settlePnl, settleFundingPayment | Custom |
Why bond a perp bot
Perp bots have the highest value_atomic per action of any DeFi vertical
(positions can be 10×+ leveraged). A liquidator bot can move $100k in a
single tx. Without a bond, users have no recourse if the bot misexecutes.
With Telaro, the bot puts up $5k+ collateral that pays out automatically
on disputed liquidations or fat-finger orders.
License
MIT
