like-axiom

1.1.0 • Public • Published

like-axiom

Axiom Trade wrapper for Node.js

npm i like-axiom

https://axiomsolana.com/

Usage

const AxiomTrade = require('like-axiom')

const axiom = new AxiomTrade({
  token: '<auth refresh token>'
})

const memeTrending = await axiom.memeTrending({ timePeriod: '1h' })
const memeTrending6h = await axiom.memeTrending({ timePeriod: '6h' })

const oldTrending = await axiom.oldTrending({ timePeriod: '1h' })

const newPairs = await axiom.pulse('newPairs')
const pairs = await axiom.pulse('finalStretch')
const pairsMigrated = await axiom.pulse('migrated')

const found = await axiom.search('AI')

const info = await axiom.tokenInfo(pairs[0].pairAddress)

const portfolio = await axiom.portfolio('<wallet address...>')

// ...

API

axiom = new AxiomTrade(options)

Create a new Axiom.Trade instance.

Options:

{
  token: process.env.AXIOM_TRADE_TOKEN // Cookie value of auth-refresh-token
}

await axiom.auth()

Generates a new access token (auth-access-token).

It's automatically used in the API requests.

pairs = await axiom.memeTrending([options])

Get the list of meme coins that are trending.

Options:

{
  timePeriod: '1h' // Possible values are: '5m', '1h', '6h', or '24h'
}

Returns an array with values like this:

{
  pairAddress,
  tokenAddress,
  tokenName,
  tokenTicker,
  tokenImage,
  tokenDecimals,
  protocol,
  protocolDetails: {
    id,
    lpMint,
    lpVault,
    version,
    baseMint,
    marketId,
    authority, baseVault, programId, quoteMint,
    marketAsks, marketBids, openOrders,
    quoteVault,
    lpDecimals, baseDecimals, quoteDecimals,
    targetOrders,
    withdrawQueue,
    marketVersion, marketAuthority, marketBaseVault,
    marketProgramId, marketEventQueue, marketQuoteVault,
    lookupTableAccount
  },
  prevMarketCapSol,
  marketCapSol,
  marketCapPercentChange,
  liquiditySol,
  liquidityToken,
  volumeSol,
  buyCount,
  sellCount,
  top10Holders,
  lpBurned,
  mintAuthority,
  freezeAuthority,
  dexPaid,
  website, twitter, telegram, discord,
  createdAt,
  extra: { migratedFrom, pumpDeployerAddress },
  supply,
  twitterHandleHistory
}

pairs = await axiom.oldTrending([options])

Get the list of meme coins that are trending.

Options:

{
  timePeriod: '1h' // Possible values are: '5m', '1h', '6h', or '24h'
}

Similar output than meme trending, but properties are in snake case format!

pairs = await axiom.pulse(table, [options])

Get the list of new pairs, final stretch, and migrated coins.

Table can be: newPairs, finalStretch, or migrated.

Options:

{
  filters, // See possible values below
  usdPerSol: 0 // Auto fetch the price
}

Returns an array with values like this:

{
  pairAddress,
  tokenAddress,
  devAddress,
  tokenName,
  tokenTicker,
  tokenImage,
  tokenDecimals,
  protocol,
  protocolDetails: {
    global,
    feeRecipient,
    eventAuthority,
    associatedBondingCurve
  },
  website,
  twitter,
  telegram,
  discord,
  top10HoldersPercent,
  devHoldsPercent,
  snipersHoldPercent,
  insidersHoldPercent,
  bundlersHoldPercent,
  volumeSol,
  marketCapSol,
  liquiditySol,
  liquidityToken,
  bondingCurvePercent,
  supply,
  numTxns,
  numBuys,
  numSells,
  numHolders,
  numTradingBotUsers,
  createdAt,
  extra,
  dexPaid,
  migrationCount,
  twitterHandleHistory
}

Example with filters:

const pairs = await axiom.pulse('finalStretch', {
  filters: {
    txns: { min: 10 }
  }
})

Filters available:

{
  protocols: { raydium: false, pump: true, moonshot: true },
  searchKeywords: [],
  excludeKeywords: [],
  dexPaid: false,
  mustEndInPump: false,
  age: { min: null, max: null },
  top10Holders: { min: null, max: null },
  devHolding: { min: null, max: null },
  snipers: { min: null, max: null },
  insiders: { min: null, max: null },
  bundle: { min: null, max: null },
  holders: { min: null, max: null },
  botUsers: { min: null, max: null },
  bondingCurve: { min: null, max: null },
  liquidity: { min: null, max: null },
  volume: { min: null, max: null },
  marketCap: { min: null, max: null },
  txns: { min: null, max: null },
  numBuys: { min: null, max: null },
  numSells: { min: null, max: null },
  twitter: { min: null, max: null },
  website: false,
  telegram: false
}

found = await axiom.search(input)

Search tokens by name, token address, pair address, etc.

Returns an array:

[..., {
  tokenName,
  tokenImage,
  tokenTicker,
  createdAt,
  pairAddress,
  tokenAddress,
  protocol,
  supply,
  liquiditySol,
  liquidityToken,
  marketCapSol,
  bondingCurvePercent,
  volumeSol,
  extra,
  website,
  twitter,
  telegram,
  discord
}]

info = await axiom.tokenInfo(pairAddress)

Get the details of a token.

Returns:

{
  top10HoldersPercent,
  devHoldsPercent,
  snipersHoldPercent,
  insidersHoldPercent,
  bundlersHoldPercent,
  dexPaid,
  numHolders,
  numBotUsers,
  numBluechipHolders
}

portfolio = await axiom.portfolio(walletAddress)

Get the investment details of a wallet.

Returns an object like this:

{
  activePositions,
  historyPositions,
  topPositions,
  transactions,
  balanceStats: { totalValueSol, availableBalanceSol, unrealizedPnlSol },
  performanceMetrics: {
    sevenDay: { totalPnl, buyCount, sellCount, pnlBreakdown },
    thirtyDay: { totalPnl, buyCount, sellCount, pnlBreakdown },
    allTime: { totalPnl, buyCount, sellCount, pnlBreakdown }
  },
  chartData
}

usdPerSol = await axiom.usdPerSol()

Get the price of SOL in USD.

Useful for caching the price option in pulse requests.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i like-axiom

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

12.1 kB

Total Files

4

Last publish

Collaborators

  • lukks