Welcome to the TON Perpetual Futures SDK! This TypeScript-based software development kit (SDK) is designed to help developers build applications that interact with perpetual futures decentralized exchange (DEX) contracts on the TON blockchain. With this SDK, you'll be able to fetch data from these smart contracts and send transactions to the TON blockchain.
Note: Typescript usage is strongly recommended.
- TypeScript SDK: Leverage TypeScript for type safety and robustness in your development process.
- Perpetual Futures DEX Interaction: Connect with perpetual futures DEX contracts on the TON blockchain to fetch real-time market data and place trades.
- Transaction Packing and Sending: Prepare and broadcast transactions to the TON network, ensuring a seamless interaction experience.
Using NPM:
npm install @ton/core @ton/crypto @ton/ton @storm-trade/sdk
Using Yarn:
yarn add @ton/core @ton/crypto @ton/ton @storm-trade/sdk
Check out the following examples in the examples repo:
-
increase-position.ts
: Init sdk and prepare an increase (open) position tx. -
close-position.ts
: Init sdk, fetch actual position data and prepare a close position tx. -
create-limit-order.ts
: Set up SDK and prepare a limit or stop-limit order for sending to the blockchain. -
increase-position-sync.ts
: More performant sdk usage with a synchronous tx preparation. -
market.ts
: Fetching an actual market's data, funding, prices. -
position-manager.ts
: Getting trader's position data: long/short positions, orders, pnl, marginRatio etc. -
send-with-mnemonic.ts
: Prepare increase position tx, set up sdk and wallet with mnemonic, sing and send tx to the blockchain. -
ton-connect.ts
: Prepare increase position tx, and send tx to the blockchain via TON Connect.
The TON Perpetual Futures SDK is open-source software released under the MIT License. For more information, see the LICENSE file.
Happy coding! 💻✨