API & SDK
A programmatic set of tools for interacting with Ostium's smart contract, without a User Interface.
Ostium Labs offers an SDK built in Python (v3.10) that allows for reading of the platform's state: a list of trading pairs, rolling fees, and open interest caps for each. It also allows for placing of new Orders (Market, Limit and Stop), reading their state, such as open PnL and fees paid, as well as editing them and deleting them. It also allows for reading the entire history of orders. All of this can be done in an entirely programatic way by using python as the programing language.
Ostium also provides a REST endpoint that serves the purpose of exposing platform metrics and state in an easy manner for anyone to read.
Reading latest prices for all feeds:
This is useful when placing an order on the platform, allowing a user to see the latest price before placing a trade.
Reading the trading hours for RWA assets:
This endpoint returns a response showing the trading pair trading schedule and the current trading status, in a human readable format, e.g:
Reading liquidity providers' exposure:
If you have deposited liquidity to the vault, you can use the above REST end-point by supplying your depositing address to retrieve insights into your exposure to different assets based on the current imbalance state of the platform.
Dune Analytics
Below is the Dune analytics dashboard showing the platform's main metrics:
Chaos Labs dashboard
Below is the platform's risk analysis dashboard from Chaos Labs:
https://community.chaoslabs.xyz/ostium/risk/overview
Python SDK
Ostium's PyPi module is located here. The codebase for the SDK is publicly available here.
Installing the SDK
If you wish to contribute code or report of any issue, please contact us via Github repository page.
The SDK works both on mainnet (Arbitrum One) and on testnet (Arbitrum Sepolia).
In order to instantiate the SDK you merely need a RPC URL for one of the above networks you wish to interact with. You can obtain an RPC freely from Alchemy; consult the README for more information.
In order to place trades you need to instantiate the SDK with a private key. Consult the README for more information and basic related security issues.
To place trades on testnet, you must obtain testnet USDC, which you can do from our faucet. The SDK has a special set of actions that enable this.
To start performing any write operation (e.g. interact with the platform on testnet or mainnet using the instantiated private key), you must have some native token for gas. For Arbitrum Sepolia gas, you may use Alchemy.
Last updated