@todayapp/avantis-sdk
Version:
Unofficial TypeScript SDK for Avantis DEX - Decentralized perpetual futures trading (BETA)
758 lines (592 loc) โข 26.6 kB
Markdown
# Avantis TypeScript SDK (Unofficial)
[](https://www.npmjs.com/package/@todayapp/avantis-sdk)
[](https://github.com/Today-Finance/avantis-sdk)
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://base.org)
**โ ๏ธ BETA SOFTWARE - This is an unofficial, community-developed SDK for Avantis. Use at your own risk.**
An unofficial TypeScript SDK for interacting with [Avantis](https://avantis.finance) - the decentralized perpetual futures DEX on Base network. Trade crypto, forex, commodities, and indices with up to 100x leverage.
> **Note**: This SDK is currently in beta and is not officially endorsed by Avantis. While it has been thoroughly tested, users should exercise caution when using it in production environments.
## โจ Features
- ๐ **Full Trading Suite**: Market orders, limit orders, stop orders, and position management
- ๐ฎ **Dynamic Price Feeds**: Automatically supports ALL current and future Avantis markets via Socket API integration
- ๐ฐ **Platform Fee System**: Built-in fee management with referral support and transaction bundling
- ๐ **Real-time Data**: WebSocket-based live price feeds and market data
- ๐ฑ **89+ Trading Pairs**: Crypto, forex, commodities, stocks, and metals - automatically updated
- ๐ **Socket API Integration**: Fast, cached access to all market metadata, open interest, and asset filtering
- ๐ **Type-Safe**: Full TypeScript with runtime validation using Zod
- ๐ฑ **Cross-Platform**: Works with Node.js, browsers, and React Native
- โก **Gas Optimized**: Multicall3 transaction bundling for 30-40% gas savings
- ๐ก๏ธ **Production Ready**: Comprehensive error handling and recovery
- ๐ **Viem-Powered**: Built with [viem](https://viem.sh) for modern blockchain interactions and account abstraction support
## ๐ฆ Installation
```bash
npm install @todayapp/avantis-sdk
# or
yarn add @todayapp/avantis-sdk
# or
pnpm add @todayapp/avantis-sdk
```
## ๐ Quick Start
### Basic Trading
```typescript
import { AvantisSDK, PositionSide, OrderType } from '@todayapp/avantis-sdk';
// Initialize SDK
const sdk = new AvantisSDK('base'); // 'base' for mainnet, 'base-sepolia' for testnet
// Set up signer
await sdk.setSigner({
type: 'privateKey',
privateKey: process.env.PRIVATE_KEY
});
// Open a position
const result = await sdk.trader.openPosition({
pair: 'ETH/USD',
side: PositionSide.LONG,
size: 1000, // $1000 position size
leverage: 10, // 10x leverage
orderType: OrderType.MARKET,
stopLoss: 2800, // Optional SL at $2800
takeProfit: 3500, // Optional TP at $3500
slippage: 0.5 // 0.5% slippage tolerance
});
console.log('Position opened:', result.transactionHash);
```
### With Platform Fees
```typescript
// Configure platform fees (for platforms/integrators)
sdk.trader.setPlatformFeeConfig({
platformWallet: '0xYourPlatformWallet',
baseFeePercent: 0.001, // 0.1% platform fee
referralSplitPercent: 30, // 30% goes to referrers
enabled: true
});
// Open position with fees
const result = await sdk.trader.openPositionWithFees({
pair: 'BTC/USD',
side: PositionSide.SHORT,
size: 5000,
leverage: 25,
platformFee: {
enabled: true,
discountPercent: 20, // 20% fee discount for this user
referralAddress: '0xReferrerWallet' // Optional referrer
}
});
```
### Real-time Price Feeds
> **Note**: Avantis does not provide a public REST API for price feeds, volume, or market statistics. Use Pyth Network for price data and Socket API for open interest.
The SDK now **dynamically fetches all markets** from the Socket API, meaning it automatically supports **all current and future trading pairs** without requiring updates.
```typescript
// โ
Method 1: Dynamic price fetching (recommended - supports ALL 89+ pairs)
// Works for ANY pair including new memecoins like TRUMP/USD, HYPE/USD, etc.
const trumpPrice = await sdk.pyth.getLatestPrice('TRUMP/USD');
const btcPrice = await sdk.pyth.getLatestPrice('BTC/USD');
const nvdaPrice = await sdk.pyth.getLatestPrice('NVDA/USD');
// Convert Pyth price format to readable price
const price = trumpPrice.expo < 0
? parseFloat(trumpPrice.price) / Math.pow(10, Math.abs(trumpPrice.expo))
: parseFloat(trumpPrice.price) * Math.pow(10, trumpPrice.expo);
console.log(`TRUMP/USD: $${price}`);
// โ
Method 2: Fetch from Socket API first (for additional metadata)
const markets = await sdk.getAllMarketsFromAPI();
const trump = markets.find(m => m.name === 'TRUMP/USD');
const priceData = await sdk.pyth.getLatestPriceByFeedId(trump.pythFeedId);
// โ
Method 3: Batch price fetching for multiple pairs
const markets = await sdk.getAllMarketsFromAPI();
const feedIds = markets.slice(0, 10).map(m => m.pythFeedId);
const prices = await sdk.pyth.getLatestPricesByFeedIds(feedIds);
// Access prices by feed ID
markets.slice(0, 10).forEach(market => {
const priceData = prices.get(market.pythFeedId);
if (priceData) {
const price = priceData.expo < 0
? parseFloat(priceData.price) / Math.pow(10, Math.abs(priceData.expo))
: parseFloat(priceData.price) * Math.pow(10, priceData.expo);
console.log(`${market.name}: $${price}`);
}
});
```
### Socket API - Market Discovery
The SDK uses the **Avantis Socket API** to fetch comprehensive market data for all 89+ trading pairs:
```typescript
// Get all markets from Socket API (fast, cached, complete)
const markets = await sdk.getAllMarketsFromAPI();
console.log(`Found ${markets.length} markets`); // 89+
// Each market includes:
markets.forEach(market => {
console.log({
pairIndex: market.pairIndex,
name: market.name, // e.g., "BTC/USD"
maxLeverage: market.maxLeverage, // e.g., 75
spreadPercent: market.spreadPercent, // Trading spread
pythFeedId: market.pythFeedId, // For price fetching
assetType: market.assetType // Crypto, FX, Equity, etc.
});
});
// Filter by asset type
const cryptos = await sdk.getMarketsByType('Crypto'); // 57 pairs
const forex = await sdk.getMarketsByType('FX'); // 17 pairs
const stocks = await sdk.getMarketsByType('Equity'); // 10 pairs
// Get specific market
const eth = await sdk.getMarketByIndex(0); // ETH/USD
console.log(`${eth.name}: ${eth.maxLeverage}x leverage`);
// Get total open interest
const oi = await sdk.getTotalOpenInterest();
console.log(`Long OI: $${oi.long}, Short OI: $${oi.short}`);
```
**Why Socket API?**
- โ
**Complete**: All 89+ pairs vs only 4 from on-chain
- โ
**Fast**: ~50-100ms with 5-minute cache
- โ
**Rich Metadata**: Names, asset types, leverage, spreads
- โ
**No RPC Costs**: Doesn't consume blockchain RPC quota
See [docs/SOCKET_API.md](docs/SOCKET_API.md) for full documentation.
### Pyth Network Oracle Integration
The SDK automatically fetches real-time price data from [Pyth Network](https://pyth.network) oracles, which is required by Avantis smart contracts:
```typescript
// Get prices for markets using Pyth feed IDs from Socket API
const markets = await sdk.getAllMarketsFromAPI();
const feedIds = markets.slice(0, 10).map(m => m.pythFeedId);
const prices = await sdk.pyth.getLatestPricesByFeedIds(feedIds);
markets.slice(0, 10).forEach(market => {
const priceData = prices.get(market.pythFeedId);
if (priceData) {
const expo = priceData.expo;
const price = expo < 0
? parseFloat(priceData.price) / Math.pow(10, Math.abs(expo))
: parseFloat(priceData.price) * Math.pow(10, expo);
console.log(`${market.name}: $${price}`);
}
});
// Get single market price
const btc = await sdk.getMarketByIndex(1); // BTC/USD
const btcPrice = await sdk.pyth.getLatestPriceByFeedId(btc.pythFeedId);
// Automatic price fetching in trades (default behavior)
const result = await sdk.trader.openPosition({
pair: 'BTC/USD',
side: PositionSide.LONG,
size: 1000,
leverage: 10
// Pyth prices automatically fetched and included!
});
// Manual control over price fetching
const result = await sdk.trader.openPosition({
pair: 'ETH/USD',
side: PositionSide.SHORT,
size: 500,
leverage: 5,
autofetchPrices: false, // Disable auto-fetch
priceUpdateData: customPriceData // Provide your own price data
});
```
**Why Pyth?** Avantis uses Pyth Network's decentralized oracle for accurate, low-latency price feeds. The SDK handles all the complexity of fetching and formatting price data automatically.
## ๐ฑ React Native Setup
For React Native/Expo apps, install the required polyfill:
```bash
npm install react-native-get-random-values
```
Add to your app's entry point:
```javascript
// index.js or App.tsx
import 'react-native-get-random-values';
// Your app code
import App from './App';
```
> **Note**: The SDK now uses [viem](https://viem.sh) which has better React Native compatibility than ethers.js
## ๐ Core Concepts
### Trading Pairs & Market Data
The SDK supports **89+ trading pairs** across different asset classes via the Socket API:
```typescript
// Get all 89+ markets with full metadata (recommended)
const markets = await sdk.getAllMarketsFromAPI();
console.log(`Total markets: ${markets.length}`);
markets.forEach(market => {
console.log(`${market.name}: ${market.maxLeverage}x leverage, ${market.spreadPercent}% spread`);
});
// Filter by asset type
const cryptoMarkets = await sdk.getMarketsByType('Crypto'); // 57 crypto pairs
const forexMarkets = await sdk.getMarketsByType('FX'); // 17 forex pairs
const stockMarkets = await sdk.getMarketsByType('Equity'); // 10 stock pairs
const metalMarkets = await sdk.getMarketsByType('Metal'); // 2 metal pairs
const commodities = await sdk.getMarketsByType('Commodities'); // 1 commodity
// Get available asset types
const assetTypes = await sdk.getAssetTypes();
// Returns: ['Crypto', 'FX', 'Equity', 'Metal', 'Commodities']
// Get specific market by index
const btc = await sdk.getMarketByIndex(1); // BTC/USD
console.log(`${btc.name}: Max leverage ${btc.maxLeverage}x`);
// Get markets with current Pyth prices
const feedIds = markets.slice(0, 10).map(m => m.pythFeedId);
const prices = await sdk.pyth.getLatestPricesByFeedIds(feedIds);
```
**Market Breakdown:**
- ๐ช **Crypto**: 57 pairs (ETH, BTC, SOL, BNB, ARB, DOGE, AVAX, OP, POL, TIA, SEI, SHIB, PEPE, BONK, WIF, and more)
- ๐ฑ **Forex**: 17 pairs (EUR/USD, GBP/USD, USD/JPY, and major currency pairs)
- ๐ **Stocks**: 10 pairs (SPY, QQQ, NVDA, AAPL, TSLA, GOOG, AMZN, META, MSFT, COIN)
- ๐ฅ **Metals**: 2 pairs (XAU/USD Gold, XAG/USD Silver)
- ๐ข๏ธ **Commodities**: 1 pair (USOILSPOT/USD)
#### Getting Pair Indices Dynamically
**Important:** Pair indices are fetched dynamically from the Socket API. Never hardcode pair indices as they may change.
```typescript
// Get pair index dynamically (recommended)
const ethIndex = await sdk.getPairIndexByName('ETH/USD'); // Returns: 0
const btcIndex = await sdk.getPairIndexByName('BTC/USD'); // Returns: 1
// Get pair name from index
const pairName = await sdk.getPairNameByIndex(1); // Returns: "BTC/USD"
// When trading, use pair names (indices are resolved automatically)
await sdk.trader.openPosition({
pair: 'ETH/USD', // โ
Use names, not indices
side: PositionSide.LONG,
size: 1000,
leverage: 10
});
```
### Position Management
```typescript
// Get all open positions
const positions = await sdk.trader.getPositions();
// Update stop loss and take profit
await sdk.trader.updatePosition({
positionId: '0-123', // Format: "pairIndex-positionIndex"
stopLoss: 2900,
takeProfit: 3200
});
// Close position (partial or full)
await sdk.trader.closePosition({
positionId: '0-123',
size: 500 // Optional: close only $500 (partial close)
});
```
### Account Information
```typescript
const account = await sdk.trader.getAccountInfo();
console.log('Address:', account.address);
console.log('USDC Balance:', account.usdcBalance.toFixed(2));
console.log('Free Collateral:', account.freeCollateral.toFixed(2));
console.log('Active Positions:', account.positions.length);
console.log('Unrealized PnL:', account.unrealizedPnl.toFixed(2));
console.log('Margin Level:', account.marginLevel, '%');
```
### Limit Orders
```typescript
// Place a limit order
const limitOrder = await sdk.trader.openPosition({
pair: 'ETH/USD',
side: PositionSide.LONG,
size: 2000,
leverage: 15,
orderType: OrderType.LIMIT,
openPrice: 2950, // Will execute when ETH reaches $2950
stopLoss: 2800,
takeProfit: 3200
});
// Update limit order
await sdk.trader.updateLimitOrder({
pairIndex: 1, // BTC/USD (get dynamically via sdk.getPairIndexByName('BTC/USD'))
orderIndex: 0,
price: 2940, // New limit price
takeProfit: 3250,
stopLoss: 2750
});
// Cancel limit order
await sdk.trader.cancelLimitOrder({
pairIndex: 1, // BTC/USD (get dynamically via sdk.getPairIndexByName('BTC/USD'))
orderIndex: 0
});
```
## ๐ฐ Platform Fee System
The SDK includes a comprehensive fee management system for platforms and integrators:
### Features
- **Transaction Bundling**: Uses Multicall3 for gas-efficient atomic transactions
- **Flexible Discounts**: Per-user percentage discounts (0-100%)
- **Referral Support**: Automatic fee splitting with referrers
- **Gas Optimized**: ~30-40% gas savings through bundling
### Implementation
```typescript
// Configure global platform fees
sdk.trader.setPlatformFeeConfig({
platformWallet: '0xYourPlatformWallet',
baseFeePercent: 0.002, // 0.2% fee
referralSplitPercent: 40, // 40% to referrers
enabled: true
});
// Calculate fees before trading
const feeBreakdown = sdk.trader.calculateFeeBreakdown(
1000, // Trade size
{
enabled: true,
discountPercent: 25, // VIP discount
referralAddress: '0xReferrer'
}
);
console.log('Platform receives:', feeBreakdown.platformReceives);
console.log('Referrer receives:', feeBreakdown.referralFee);
console.log('Total fee:', feeBreakdown.totalFee);
// Execute trade with fees (bundled in single transaction)
await sdk.trader.openPositionWithFees({
// ... position params
platformFee: {
enabled: true,
discountPercent: 25,
referralAddress: '0xReferrer'
}
});
```
## ๐ก๏ธ Error Handling
The SDK provides detailed error types for robust error handling:
```typescript
import {
TradingError,
ValidationError,
NetworkError,
ErrorCode
} from '@todayapp/avantis-sdk';
try {
await sdk.trader.openPosition(params);
} catch (error) {
if (error instanceof TradingError) {
switch (error.code) {
case ErrorCode.INSUFFICIENT_COLLATERAL:
console.error('Not enough USDC balance');
break;
case ErrorCode.POSITION_SIZE_TOO_SMALL:
console.error('Position size below minimum');
break;
case ErrorCode.MAX_LEVERAGE_EXCEEDED:
console.error('Leverage too high for this pair');
break;
default:
console.error('Trading error:', error.message);
}
} else if (error instanceof ValidationError) {
console.error('Invalid input:', error.field, error.message);
} else if (error instanceof NetworkError) {
console.error('Network issue:', error.message);
}
}
```
## ๐ Advanced Examples
### Portfolio Monitoring
```typescript
// Monitor all positions with real-time PnL
const positions = await sdk.trader.getPositions();
for (const position of positions) {
sdk.feed.subscribeToPrice(position.pair, (priceData) => {
const currentPrice = priceData.price;
const entryPrice = position.entryPrice;
const pnlPercent = position.side === PositionSide.LONG
? ((currentPrice - entryPrice) / entryPrice) * 100 * position.leverage
: ((entryPrice - currentPrice) / entryPrice) * 100 * position.leverage;
console.log(`${position.pair}: ${pnlPercent.toFixed(2)}% PnL`);
// Auto-close if profit target reached
if (pnlPercent >= 50) {
await sdk.trader.closePosition({ positionId: position.id });
console.log('Profit target reached, position closed!');
}
});
}
```
### Risk Management System
```typescript
class RiskManager {
constructor(private sdk: AvantisSDK, private maxDrawdown: number = 10) {}
async monitorRisk() {
const account = await this.sdk.trader.getAccountInfo();
const initialBalance = account.usdcBalance;
setInterval(async () => {
const current = await this.sdk.trader.getAccountInfo();
const drawdown = ((initialBalance - current.usdcBalance) / initialBalance) * 100;
if (drawdown >= this.maxDrawdown) {
console.warn(`Max drawdown reached: ${drawdown.toFixed(2)}%`);
// Close all positions
for (const position of current.positions) {
await this.sdk.trader.closePosition({ positionId: position.id });
}
console.log('All positions closed due to max drawdown');
}
// Check margin level
if (current.marginLevel < 150) {
console.warn(`Low margin level: ${current.marginLevel}%`);
}
}, 5000); // Check every 5 seconds
}
}
```
## ๐ง Configuration
### Network Configuration
```typescript
// Mainnet (Base)
const sdk = new AvantisSDK('base');
// Testnet (Base Sepolia)
const sdk = new AvantisSDK('base-sepolia');
// Custom RPC
const sdk = new AvantisSDK('base', 'https://your-rpc-url.com');
// Get network info
const network = sdk.trader.getNetwork();
console.log(`Network: ${network.name} (Chain ID: ${network.chainId})`);
```
### Signer Options
```typescript
// Private key (Node.js)
await sdk.setSigner({
type: 'privateKey',
privateKey: '0x...'
});
// Mnemonic phrase
await sdk.setSigner({
type: 'mnemonic',
mnemonic: 'your twelve word phrase...',
path: "m/44'/60'/0'/0/0" // Optional HD path
});
// Account Abstraction (e.g., with Kernel/ZeroDev)
// The SDK is built with viem, making it compatible with smart account libraries
import { createKernelAccount } from '@zerodev/sdk';
const kernelAccount = await createKernelAccount(...);
await sdk.setSigner({
type: 'privateKey',
privateKey: kernelAccount.privateKey
});
```
> **Account Abstraction Support**: The SDK uses [viem](https://viem.sh) internally, making it fully compatible with viem-based account abstraction libraries like Kernel, Biconomy, and Safe.
## ๐ API Reference
### Main Classes
- **`AvantisSDK`**: Main SDK wrapper class
- `getPairIndexByName(name)` - Get dynamic pair index from Socket API
- `getPairNameByIndex(index)` - Get pair name from index
- `getAllPairNames()` - Get all available pair names
- `getAllMarketsFromAPI()` - Get all 89+ markets with metadata
- `getMarketsByType(type)` - Filter markets by asset type
- `getMarketByIndex(index)` - Get specific market data
- **`TraderClient`**: Trading operations and position management
- `getPairIndexFromAPI(name)` - Get accurate pair index (use instead of deprecated `getPairIndex()`)
- `getPairNameFromAPI(index)` - Get pair name (use instead of deprecated `getPairName()`)
- `getAllPairsFromAPI()` - Get all pairs (use instead of deprecated `getAllPairs()`)
- All trading methods now use Socket API for accurate pair indices
- **`FeedClient`**: Real-time price feeds and market data
- **`PythClient`**: Pyth Network oracle price data fetching
- **`SocketAPIClient`**: Socket API for market metadata (89+ pairs)
- **`StorageClient`**: On-chain storage interactions
- **`PriceClient`**: Price aggregation and oracles
- **`FeeManager`**: Platform fee calculations
- **`MulticallBundler`**: Transaction bundling
### Key Types
- **`MarketData`**: Complete market information (from Socket API)
- `pairIndex`, `name`, `from`, `to`
- `pythFeedId` - Pyth price feed ID
- `maxLeverage`, `minLeverage` - Leverage limits
- `spreadPercent` - Trading spread
- `minPositionSizeUSDC`, `maxPositionSizeUSDC` - Position size limits
- `maxOpenInterestLong`, `maxOpenInterestShort` - OI limits
- `currentPrice?` - Optional current Pyth price data
- **`Position`**: Open position data
- **`OpenPositionParams`**: Parameters for opening positions (with `autofetchPrices` and `priceUpdateData`)
- **`ClosePositionParams`**: Parameters for closing positions (with Pyth support)
- **`UpdatePositionParams`**: Parameters for updating positions (with Pyth support)
- **`UpdateMarginParams`**: Parameters for margin updates (with Pyth support)
- **`PlatformFeeConfig`**: Platform fee configuration
- **`MarketStats`**: 24-hour market statistics
- **`AccountInfo`**: Complete account information
- **`PythPriceUpdate`**: Pyth price feed data structure
## โ ๏ธ API Limitations
### Available Data Sources
The SDK integrates with multiple data sources, each with specific capabilities:
| Feature | Socket API | Pyth Network | On-Chain | FeedClient API |
|---------|-----------|--------------|----------|----------------|
| Market metadata | โ
| โ | โ
| โ |
| Current prices | โ | โ
| โ | โ |
| Open interest | โ
| โ | โ
| โ |
| Trading volume | โ | โ | โ ๏ธ Events only | โ |
| 24h price change | โ | โ | โ | โ |
| Historical candles | โ | โ | โ | โ |
| Funding rates | โ | โ | โ
| โ |
### Not Available
The following methods in `FeedClient` are **deprecated** and will throw errors:
- โ `feed.getMarketStats()` - No volume24h or 24h price change data available
- โ `feed.getLatestPrice()` - Use Pyth Network instead
- โ `feed.getCandles()` - No historical candle data API
### Recommended Alternatives
```typescript
// โ Don't use: feed.getMarketStats('BTC/USD')
// โ
Instead use:
// For current prices - use Pyth Network
const market = await sdk.getMarketByIndex(1); // BTC/USD
const priceData = await sdk.pyth.getLatestPriceByFeedId(market.pythFeedId);
// For open interest - use Socket API
const totalOI = await sdk.getTotalOpenInterest();
// For funding rates - query on-chain
// (Contact Avantis for contract methods)
```
## ๐ง Technical Details
### Built with Viem
This SDK uses [viem](https://viem.sh) as its blockchain interaction library. Viem provides:
- **Smaller Bundle Size**: ~80% smaller than ethers.js
- **Better TypeScript**: Superior type inference and safety
- **Modern Architecture**: Built for modern blockchain development
- **Account Abstraction**: Native compatibility with smart account libraries
#### Why Viem?
The SDK was migrated from ethers.js to viem to enable:
1. **Account Abstraction Support**: Works seamlessly with Kernel, ZeroDev, Biconomy, Safe, and other viem-based AA libraries
2. **Better Developer Experience**: Enhanced TypeScript support and modern APIs
3. **Performance**: Smaller bundle size and optimized for tree-shaking
4. **Future-Proof**: Built for the next generation of blockchain applications
All public APIs remain unchanged - the migration is internal only.
### Dependencies
- **viem** ^2.21.60 - Blockchain interactions
- **decimal.js** ^10.6.0 - Precise decimal math
- **axios** ^1.12.2 - HTTP requests
- **ws** ^8.18.3 - WebSocket support
- **zod** ^4.1.11 - Runtime validation
## ๐งช Development
### Building from Source
```bash
# Clone repository
git clone https://github.com/Today-Finance/avantis-sdk
cd avantis-sdk
# Install dependencies
npm install
# Build SDK
npm run build
# Run tests
npm test
# Type checking
npm run typecheck
# Linting
npm run lint
```
### Testing
```bash
# Run all tests
npm test
# Unit tests only
npm run test:unit
# Integration tests
npm run test:integration
# Test coverage
npm run test:coverage
```
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## ๐ Resources
- **Documentation**: [docs.avantisfi.com](https://docs.avantisfi.com)
- **Discord**: [discord.gg/avantis](https://discord.gg/avantis)
- **Twitter**: [@AvantisFinance](https://twitter.com/AvantisFinance)
- **GitHub**: [github.com/avantisfi](https://github.com/avantisfi)
## ๐ License
MIT License - see [LICENSE](LICENSE) file for details.
## โ ๏ธ Important Disclaimers
### Beta Software Notice
This SDK is currently in **BETA** and is an **UNOFFICIAL** implementation. It has not been audited or officially endorsed by Avantis. While extensive testing has been performed, users should:
- Test thoroughly in testnet before mainnet use
- Start with small amounts when using in production
- Monitor all transactions carefully
- Report any issues to the GitHub repository
### Trading Risk Disclaimer
Trading perpetual futures involves significant risk of loss. This software is provided "as is" without warranty of any kind. Always do your own research, trade responsibly, and never invest more than you can afford to lose. Past performance is not indicative of future results.
### No Warranty
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
*This is an unofficial, community-developed SDK. Not affiliated with or endorsed by Avantis.*