Across SDK
Last updated
Last updated
The Across SDK is written and maintained by the engineering team at Risk Labs.
It is written in typescript and available on NPM at . It's compatible with both Node JS environments and in the browser.
The SDK can be used currently to query suggested deposit fees and limits, and get liquidity pool statistics. It is imported and used in the implementation.
We recommend using the API, which wraps SDK functions and has an easier interface. However, if speed is a concern then we recommend reviewing the to understand best how to use the SDK.
To add the SDK to your project, use npm or yarn to npm install @across-protocol/sdk-v2
or yarn add @across-protocol/sdk-v2
.
This can be used either in a frontend application or a node js project.
You can read about the different SDK modules on the page. For convenience, the available modules are:
lpFeeCalculator: Get liquidity provider fee that will be charged on deposit for its quoteTimestamp
relayFeeCalculator: Get suggested relayerFeePct
for a deposit, which accounts for opportunity cost of capital and gas costs. If the depositor opts to set this fee lower than the suggested fee, then there is a chance that the deposit goes unfilled for a long time.
pool: Get HubPool statistics, such as available liquidReserves
that be used to refund relayers and estimatedApy
for liquidity providers.