Skip to content

alcor-finance/alcor-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alcor SDK

TypeScript SDK for interacting with Alcor on Arbitrum.

Quick Start

import { AlcorSDK } from 'alcor-sdk';

// Initialize the SDK
const sdk = new AlcorSDK(
    'YOUR_PRIVATE_KEY',
    'YOUR_RPC_URL' // e.g. https://arb-mainnet.g.alchemy.com/v2/API_KEY
);

// Example: Get all available options
const options = await sdk.options.getOptions();

// Example: Buy option
await sdk.options.buy({
    option: options[0],
    contractsAmount: 0.1
});

// Example: Sell option
await sdk.options.sell({
    option: {
      expiration: 1234567890,
      strikePrice: 3000,
      optionType: 'call'
    },
    contractsAmount: 0.1,
    paymentToken: 'weth'
});

Modules

Options

// Get all available options
const options = await sdk.options.getOptions();

// Get options for specific expiration
const options = await sdk.options.getOptions(1234567890);

// Get your positions
const positions = await sdk.options.getPositions();

// Buy options
await sdk.options.buy({
    option: options[0],
    contractsAmount: 1
});

// Sell options
await sdk.options.sell({
    option: {
        expiration: 1735290000,
        strikePrice: 3000,
        optionType: 'call'
    },
    contractsAmount: 1
});

Liquidity

// Get available pools
const pools = await sdk.liquidity.getPools();

// Get your LP position
const position = await sdk.liquidity.getPosition();

// Provide liquidity
await sdk.liquidity.provide({
    amount: 0.1 // 0.1 ETH
});

// Collect fees
await sdk.liquidity.collectFees();

// Remove provided liquidity
await sdk.liquidity.remove();

Combo

Coming soon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published