Skip to content

Genmin/forecast-leverage-sdk

Repository files navigation

Forecast Protocol SDK

TypeScript SDK for integrating leveraged prediction market trading via Forecast Protocol.

Installation

npm install @forecast-protocol/sdk

Usage

import { ForecastLeverageSDK } from '@forecast-protocol/sdk';

const sdk = new ForecastLeverageSDK(
  rpcUrl,
  privateKey,
  protocolAddress,
  usdcAddress,
  ctfAddress,
  polymarketFunderAddress
);

await sdk.setupPolymarket();

const position = await sdk.openTargetPosition({
  marketConditionId: '0x...',
  longYes: true,
  currentPrice: 0.40,
  targetPrice: 0.44,
  timeframeSeconds: 3600,
  capitalUSDC: 1000,
  maxSlippageBps: 100
});

Documentation

See INTEGRATION_GUIDE.md for integration instructions.

Testing

npm test

License

MIT

About

Add leverage to Polymarket trading via Forecast Protocol

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •