Gains and Ostium vault API
Gains Network gToken vault integration.
GToken-based vault smart contracts provide automated market making vaults for perpetual futures purely onchain. The trading engine uses gToken vaults for all trading pairs, making it over 100x more capital efficient than traditional order book approaches.
Known implementations are:
gTrade, formerly known as Gains protocol and its gToken vaults
Ostium vaults, also known as “Ostium LP” vaults where LP stands for liquidity provider
Domination Finance dfUSDC vault, a Base counterparty liquidity vault for dominance perpetual futures
Links
This Python-based API allows you to automate interactions with these vault in your application:
Discover vaults and their features across multiple chains
Historical data reading: share price, profit, TVL, deposits, redemptions
Deposit into a vault from your application
Redeem from the vault
Query your vault positions
Query vault redemption delays
Withdrawal periods are exported in public lifetime metrics. Gains and legacy
Ostium V1 withdrawals use a delay of one to three Open PnL epochs, selected by
the collateralisation ratio. Ostium V1.5 uses its onchain settlement interval
and withdrawal-settlement delay; the export includes one additional interval
as the maximum because a request can arrive immediately after a settlement.
All of these records use withdrawal_delay_type: "delay".
For the example usage, see GainsVault class.
Gains/Ostium vault adapter. |
|
Deposit and redeem flow for GToken-like vaults. |
|
Gains vault testing helpers. |
For more tutorials, like vault historical data, see ERC-4626 tutorials in tutorials section.