diff --git a/.gitbook/SUMMARY.md b/.gitbook/SUMMARY.md
index 39a91f133..d26f82e85 100644
--- a/.gitbook/SUMMARY.md
+++ b/.gitbook/SUMMARY.md
@@ -1,98 +1,99 @@
# Table of contents
-* [Getting Started](README.md)
- * [Technical Concepts](readme/technical-concepts.md)
- * [Application Concepts](readme/application-concepts.md)
- * [Assets](readme/assets/README.md)
- * [Creating Tokens](readme/assets/creating-tokens.md)
- * [Denom Client (deprecated)](readme/assets/denom-client.md)
- * [Injective Lists](readme/assets/injective-list.md)
- * [Networks](readme/networks.md)
- * [CosmJs Support](readme/getting-started-cosmjs.md)
- * [Running examples](readme/running-examples.md)
-* [Wallet](wallet/README.md)
- * [Accounts](wallet/wallet-accounts.md)
- * [Wallet Connections](wallet/wallet-connections.md)
- * [Wallet Strategy](wallet/wallet-wallet-strategy.md)
- * [Offchain (Arbitrary) Data](wallet/offchain-arbitrary-data.md)
-* [Querying](querying/README.md)
- * [Indexer](querying/querying-api/README.md)
- * [Account](querying/querying-api/querying-indexer-account.md)
- * [Auction](querying/querying-api/querying-indexer-auction.md)
- * [Derivatives](querying/querying-api/querying-indexer-derivatives.md)
- * [Explorer](querying/querying-api/querying-indexer-explorer.md)
- * [Insurance Funds](querying/querying-api/querying-indexer-insurance-funds.md)
- * [Markets](querying/querying-api/querying-indexer-markets.md)
- * [Leaderboard](querying/querying-api/querying-indexer-leaderboard.md)
- * [Mito](querying/querying-api/querying-indexer-mito.md)
- * [Oracle](querying/querying-api/querying-indexer-oracle.md)
- * [Portfolio](querying/querying-api/querying-indexer-portfolio.md)
- * [Spot](querying/querying-api/querying-indexer-spot.md)
- * [Web3Gw Transactions](querying/querying-api/querying-indexer-transaction.md)
- * [Streaming](querying/querying-api/streaming/README.md)
- * [Account](querying/querying-api/streaming/streaming-indexer-account.md)
- * [Auction](querying/querying-api/streaming/streaming-indexer-auction.md)
- * [Derivatives](querying/querying-api/streaming/streaming-indexer-derivatives.md)
- * [Oracle](querying/querying-api/streaming/streaming-indexer-oracle.md)
- * [Portfolio](querying/querying-api/streaming/streaming-indexer-portfolio.md)
- * [Spot](querying/querying-api/streaming/streaming-indexer-spot.md)
- * [Explorer](querying/querying-api/streaming/streaming-indexer-explorer.md)
- * [Chain](querying/querying-chain/README.md)
- * [Auction](querying/querying-chain/querying-chain-auction-module.md)
- * [Auth](querying/querying-chain/querying-chain-auth-module.md)
- * [Bank](querying/querying-chain/querying-chain-bank-module.md)
- * [Distribution](querying/querying-chain/querying-chain-distribution.md)
- * [Exchange](querying/querying-chain/querying-chain-exchange.md)
- * [Governance](querying/querying-chain/querying-chain-governance.md)
- * [IBC](querying/querying-chain/querying-chain-ibc.md)
- * [Mint](querying/querying-chain/querying-chain-mint.md)
- * [Insurance Funds](querying/querying-chain/querying-chain-insurance-funds.md)
- * [Oracle](querying/querying-chain/querying-chain-oracle.md)
- * [Peggy](querying/querying-chain/querying-chain-peggy.md)
- * [Permissions](querying/querying-chain/querying-chain-permissions.md)
- * [Staking](querying/querying-chain/querying-chain-staking.md)
- * [Tendermint](querying/querying-chain/querying-chain-tendermint.md)
- * [Wasm](querying/querying-chain/querying-chain-wasm.md)
- * [WasmX](querying/querying-chain/querying-chain-wasmx.md)
- * [Token Factory](querying/querying-chain/token-factory.md)
- * [Ethereum (GraphQL)](querying/querying-ethereum.md)
-* [Transactions](transactions/README.md)
- * [Cosmos](transactions/transactions-cosmos/README.md)
- * [Ledger through Keplr Wallet](transactions/transactions-cosmos/ledger-through-keplr-wallet.md)
- * [Ethereum](transactions/ethereum.md)
- * [Ethereum Ledger](transactions/ethereum-ledger.md)
- * [MsgBroadcaster](transactions/msgbroadcaster.md)
- * [Private Key](transactions/private-key.md)
- * [Web3 Gateway](transactions/web3-gateway.md)
-* [Core Modules](core-modules/README.md)
- * [Auction](core-modules/auction.md)
- * [AuthZ](core-modules/authz.md)
- * [Bank](core-modules/bank.md)
- * [Distribution](core-modules/distribution.md)
- * [Exchange](core-modules/exchange.md)
- * [Feegrant](core-modules/feegrant.md)
- * [Governance](core-modules/governance.md)
- * [IBC](core-modules/ibc.md)
- * [Insurance](core-modules/insurance.md)
- * [Peggy](core-modules/peggy.md)
- * [Permissions](core-modules/permissions.md)
- * [Staking](core-modules/staking.md)
- * [Tokenfactory](core-modules/token-factory.md)
- * [Wasm](core-modules/wasm.md)
-* [Bridge](bridge/README.md)
- * [Ethereum](bridge/ethereum.md)
- * [IBC](bridge/ibc.md)
- * [Wormhole](bridge/wormhole.md)
-* [Contracts](contracts/README.md)
- * [Injective Name Service](contracts/injective-name-service.md)
-* [Building dApps](building-dapps/README.md)
- * [Configuring Nuxt](building-dapps/configuring-nuxt.md)
- * [Configuring React](building-dapps/configuring-react.md)
- * [dApps Examples](building-dapps/dapps-examples/README.md)
- * [Smart Contract](building-dapps/smart-contract.md)
- * [DEX](building-dapps/dex.md)
- * [Bridge](building-dapps/bridge.md)
- * [Simple HTML example with Webpack](building-dapps/dapps-examples/simple-html-example-with-webpack.md)
-* [Calculations](calculations/README.md)
- * [Min Price Tick Size](calculations/min-price-tick-size.md)
- * [Min Quantity Tick Size](calculations/min-quantity-tick-size.md)
+- [Getting Started](README.md)
+ - [Technical Concepts](readme/technical-concepts.md)
+ - [Application Concepts](readme/application-concepts.md)
+ - [Assets](readme/assets/README.md)
+ - [Creating Tokens](readme/assets/creating-tokens.md)
+ - [Denom Client (deprecated)](readme/assets/denom-client.md)
+ - [Injective Lists](readme/assets/injective-list.md)
+ - [Networks](readme/networks.md)
+ - [CosmJs Support](readme/getting-started-cosmjs.md)
+ - [Running examples](readme/running-examples.md)
+- [Wallet](wallet/README.md)
+ - [Accounts](wallet/wallet-accounts.md)
+ - [Wallet Connections](wallet/wallet-connections.md)
+ - [Wallet Strategy](wallet/wallet-wallet-strategy.md)
+ - [Offchain (Arbitrary) Data](wallet/offchain-arbitrary-data.md)
+- [Querying](querying/README.md)
+ - [Indexer](querying/querying-api/README.md)
+ - [Account](querying/querying-api/querying-indexer-account.md)
+ - [Auction](querying/querying-api/querying-indexer-auction.md)
+ - [Derivatives](querying/querying-api/querying-indexer-derivatives.md)
+ - [Explorer](querying/querying-api/querying-indexer-explorer.md)
+ - [Insurance Funds](querying/querying-api/querying-indexer-insurance-funds.md)
+ - [Markets](querying/querying-api/querying-indexer-markets.md)
+ - [Leaderboard](querying/querying-api/querying-indexer-leaderboard.md)
+ - [Mito](querying/querying-api/querying-indexer-mito.md)
+ - [Oracle](querying/querying-api/querying-indexer-oracle.md)
+ - [Portfolio](querying/querying-api/querying-indexer-portfolio.md)
+ - [Spot](querying/querying-api/querying-indexer-spot.md)
+ - [Web3Gw Transactions](querying/querying-api/querying-indexer-transaction.md)
+ - [Streaming](querying/querying-api/streaming/README.md)
+ - [Account](querying/querying-api/streaming/streaming-indexer-account.md)
+ - [Auction](querying/querying-api/streaming/streaming-indexer-auction.md)
+ - [Derivatives](querying/querying-api/streaming/streaming-indexer-derivatives.md)
+ - [Oracle](querying/querying-api/streaming/streaming-indexer-oracle.md)
+ - [Portfolio](querying/querying-api/streaming/streaming-indexer-portfolio.md)
+ - [Spot](querying/querying-api/streaming/streaming-indexer-spot.md)
+ - [Explorer](querying/querying-api/streaming/streaming-indexer-explorer.md)
+ - [Chain](querying/querying-chain/README.md)
+ - [Auction](querying/querying-chain/querying-chain-auction-module.md)
+ - [Auth](querying/querying-chain/querying-chain-auth-module.md)
+ - [Bank](querying/querying-chain/querying-chain-bank-module.md)
+ - [Distribution](querying/querying-chain/querying-chain-distribution.md)
+ - [Exchange](querying/querying-chain/querying-chain-exchange.md)
+ - [Governance](querying/querying-chain/querying-chain-governance.md)
+ - [IBC](querying/querying-chain/querying-chain-ibc.md)
+ - [Mint](querying/querying-chain/querying-chain-mint.md)
+ - [Insurance Funds](querying/querying-chain/querying-chain-insurance-funds.md)
+ - [Oracle](querying/querying-chain/querying-chain-oracle.md)
+ - [Peggy](querying/querying-chain/querying-chain-peggy.md)
+ - [Permissions](querying/querying-chain/querying-chain-permissions.md)
+ - [Staking](querying/querying-chain/querying-chain-staking.md)
+ - [Tendermint](querying/querying-chain/querying-chain-tendermint.md)
+ - [Wasm](querying/querying-chain/querying-chain-wasm.md)
+ - [WasmX](querying/querying-chain/querying-chain-wasmx.md)
+ - [Token Factory](querying/querying-chain/token-factory.md)
+ - [Ethereum (GraphQL)](querying/querying-ethereum.md)
+- [Transactions](transactions/README.md)
+ - [Cosmos](transactions/transactions-cosmos/README.md)
+ - [Ledger through Keplr Wallet](transactions/transactions-cosmos/ledger-through-keplr-wallet.md)
+ - [Ethereum](transactions/ethereum.md)
+ - [Ethereum Ledger](transactions/ethereum-ledger.md)
+ - [MsgBroadcaster](transactions/msgbroadcaster.md)
+ - [Private Key](transactions/private-key.md)
+ - [Web3 Gateway](transactions/web3-gateway.md)
+- [Core Modules](core-modules/README.md)
+ - [Auction](core-modules/auction.md)
+ - [AuthZ](core-modules/authz.md)
+ - [Bank](core-modules/bank.md)
+ - [Distribution](core-modules/distribution.md)
+ - [Exchange](core-modules/exchange.md)
+ - [Feegrant](core-modules/feegrant.md)
+ - [Governance](core-modules/governance.md)
+ - [IBC](core-modules/ibc.md)
+ - [Insurance](core-modules/insurance.md)
+ - [Peggy](core-modules/peggy.md)
+ - [Permissions](core-modules/permissions.md)
+ - [Staking](core-modules/staking.md)
+ - [Tokenfactory](core-modules/token-factory.md)
+ - [Wasm](core-modules/wasm.md)
+- [Bridge](bridge/README.md)
+ - [Ethereum](bridge/ethereum.md)
+ - [IBC](bridge/ibc.md)
+ - [Wormhole](bridge/wormhole.md)
+- [Contracts](contracts/README.md)
+ - [Injective Name Service](contracts/injective-name-service.md)
+ - [Neptune Service](contracts/neptune-service.md)
+- [Building dApps](building-dapps/README.md)
+ - [Configuring Nuxt](building-dapps/configuring-nuxt.md)
+ - [Configuring React](building-dapps/configuring-react.md)
+ - [dApps Examples](building-dapps/dapps-examples/README.md)
+ - [Smart Contract](building-dapps/smart-contract.md)
+ - [DEX](building-dapps/dex.md)
+ - [Bridge](building-dapps/bridge.md)
+ - [Simple HTML example with Webpack](building-dapps/dapps-examples/simple-html-example-with-webpack.md)
+- [Calculations](calculations/README.md)
+ - [Min Price Tick Size](calculations/min-price-tick-size.md)
+ - [Min Quantity Tick Size](calculations/min-quantity-tick-size.md)
diff --git a/.gitbook/contracts/README.md b/.gitbook/contracts/README.md
index 293ca8678..03977430f 100644
--- a/.gitbook/contracts/README.md
+++ b/.gitbook/contracts/README.md
@@ -1,6 +1,6 @@
# Contracts
-#### [What is CosmWasm?](./#what-is-cosmwasm-)[](https://docs.injective.network/develop/guides/cosmwasm-dapps/#what-is-cosmwasm)
+#### [What is CosmWasm?](./#what-is-cosmwasm-)[](https://docs.injective.network/develop/guides/cosmwasm-dapps/#what-is-cosmwasm)
CosmWasm is a novel smart contracting platform built for the Cosmos ecosystem. You can learn more about CosmWasm [here](https://docs.cosmwasm.com/docs/), or see the [CosmWasm Book](https://book.cosmwasm.com/index.html) for a guide on creating CosmWasm smart contracts.
@@ -9,3 +9,4 @@ CosmWasm is a novel smart contracting platform built for the Cosmos ecosystem. Y
| Topic | Description |
| --------------------------------------------------- | ---------------------- |
| [Injective Name Service](injective-name-service.md) | Injective Name Service |
+| [Neptune Service](neptune-service.md) | Injective Name Service |
diff --git a/.gitbook/contracts/neptune-service.md b/.gitbook/contracts/neptune-service.md
new file mode 100644
index 000000000..5a44407c7
--- /dev/null
+++ b/.gitbook/contracts/neptune-service.md
@@ -0,0 +1,211 @@
+# NeptuneService
+
+`NeptuneService` is a straightforward tool that interacts with the Neptune CosmWasm smart contracts on Injective. It allows you to fetch asset prices, calculate exchange ratios, create deposit and withdraw messages, and retrieve lending rates.
+
+## Example Code Snippets
+
+Below are examples of how to use each method in the `NeptuneService` class.
+
+### Initialize NeptuneService
+
+Before using the service, create an instance of `NeptuneService`.
+
+```ts
+import { NeptuneService } from '@injectivelabs/sdk-ts'
+import { Network } from '@injectivelabs/networks'
+
+// Create a NeptuneService instance using the mainnet
+const neptuneService = new NeptuneService(Network.MainnetSentry)
+```
+
+### Fetch Prices
+
+- Get the prices of specific assets from the Neptune Price Oracle contract. Use native_token for bank denoms and token with contract_addr for CW20 tokens.
+
+```ts
+const assets = [
+ {
+ native_token: {
+ denom: 'peggy0xdAC17F958D2ee523a2206206994597C13D831ec7', // peggy USDT bank denom
+ },
+ },
+ {
+ token: {
+ contract_addr: 'inj1cy9hes20vww2yr6crvs75gxy5hpycya2hmjg9s', // nUSDT contract address
+ },
+ },
+]
+
+const prices = await neptuneService.fetchPrices(assets)
+
+console.log(prices)
+```
+
+### Fetch Redemption Ratio
+
+- Calculate the redemption ratio between nUSDT (CW20 token) and USDT (bank token).
+
+```ts
+const cw20Asset = {
+ token: {
+ contract_addr: 'inj1cy9hes20vww2yr6crvs75gxy5hpycya2hmjg9s', // nUSDT
+ },
+}
+
+const nativeAsset = {
+ native_token: {
+ denom: 'peggy0xdAC17F958D2ee523a2206206994597C13D831ec7', // USDT
+ },
+}
+
+const redemptionRatio = await neptuneService.fetchRedemptionRatio({
+ cw20Asset,
+ nativeAsset,
+})
+
+console.log(`Redemption Ratio: ${redemptionRatio}`)
+```
+
+### Convert CW20 nUSDT to Bank USDT
+
+- Calculate the amount in bank USDT from a given amount of CW20 nUSDT using the redemption ratio.
+
+```ts
+const amountCW20 = 1000 // Amount in nUSDT
+const redemptionRatio = 0.95 // Obtained from fetchRedemptionRatio
+
+const bankAmount = neptuneService.calculateBankAmount(
+ amountCW20,
+ redemptionRatio,
+)
+
+console.log(`Bank USDT Amount: ${bankAmount}`)
+```
+
+### Convert Bank USDT to CW20 nUSDT
+
+- Calculate the amount in CW20 nUSDT from a given amount of bank USDT using the redemption ratio.
+
+```ts
+const amountBank = 950 // Amount in USDT
+const redemptionRatio = 0.95 // Obtained from fetchRedemptionRatio
+
+const cw20Amount = neptuneService.calculateCw20Amount(
+ amountBank,
+ redemptionRatio,
+)
+
+console.log(`CW20 nUSDT Amount: ${cw20Amount}`)
+```
+
+### Fetch Lending Rates
+
+- Retrieve lending rates for the different lending markets in neptune's lending market smart contract
+
+```ts
+const lendingRates = await neptuneService.getLendingRates({
+ limit: 10, // Optional: number of rates to fetch
+})
+
+console.log(lendingRates)
+```
+
+### Fetch Lending Rate by Denomination
+
+- Get the lending rate for USDT for example
+
+```ts
+const denom = 'peggy0xdAC17F958D2ee523a2206206994597C13D831ec7' // USDT denom
+
+const lendingRate = await neptuneService.getLendingRateByDenom({ denom })
+
+if (lendingRate) {
+ console.log(`Lending Rate for USDT: ${lendingRate}`)
+} else {
+ console.log('Lending Rate for USDT not found')
+}
+```
+
+### Calculate Annual Percentage Yield (APY)
+
+- Convert the annual percentage rate (APR) to the continuously compounded annual percentage yield (APY). Make sure to use the lending rate retried from neptuneService.getLendingRateByDenom to use as the apr.
+
+```ts
+const apr = 0.1 // 10% APR
+
+const apy = neptuneService.calculateAPY(apr)
+
+console.log(`APY (continuously compounded): ${(apy * 100).toFixed(2)}%`)
+```
+
+### Create and Broadcast a Deposit Message
+
+- Create a message to deposit USDT into the Neptune USDT lending market and broadcast it to the network.
+
+```ts
+import {
+ MsgBroadcasterWithPk,
+ MsgExecuteContractCompat,
+} from '@injectivelabs/sdk-ts'
+import { BigNumberInBase } from '@injectivelabs/utils'
+
+const privateKey = '0x...'
+const injectiveAddress = 'inj1...'
+const denom = 'peggy0xdAC17F958D2ee523a2206206994597C13D831ec7' // USDT denom
+
+const amountInUsdt = '100'
+
+// Convert the amount to the smallest unit (USDT has 6 decimals)
+const amount = new BigNumberInBase(amountInUsdt).toWei(6).toFixed()
+
+const depositMsg = neptuneService.createDepositMsg({
+ denom,
+ amount,
+ sender: injectiveAddress,
+})
+
+const txHash = await new MsgBroadcasterWithPk({
+ privateKey,
+ network: Network.MainnetSentry,
+}).broadcast({
+ msgs: depositMsg,
+})
+
+console.log(txHash)
+```
+
+### Create and Broadcast a Withdraw Message
+
+- Create a message to withdraw USDT from the Neptune USDT lending market and broadcast it to the network
+
+```ts
+import {
+ Network,
+ MsgBroadcasterWithPk,
+ MsgExecuteContractCompat,
+} from '@injectivelabs/sdk-ts'
+import { BigNumberInBase } from '@injectivelabs/utils'
+
+const privateKey = '0x...' // Your private key
+const injectiveAddress = 'inj1...' // Your Injective address
+
+// Define the amount to withdraw (e.g., 100 nUSDT)
+const amountInNusdt = '100'
+
+// Convert the amount to the smallest unit (nUSDT has 6 decimals)
+const amount = new BigNumberInBase(amountInNusdt).toWei(6).toFixed()
+
+const withdrawMsg = neptuneService.createWithdrawMsg({
+ amount,
+ sender: injectiveAddress,
+})
+
+const txHash = await new MsgBroadcasterWithPk({
+ privateKey,
+ network: Network.MainnetSentry,
+}).broadcast({
+ msgs: withdrawMsg,
+})
+
+console.log(`Transaction Hash: ${txHash}`)
+```
diff --git a/packages/sdk-ts/src/client/wasm/index.ts b/packages/sdk-ts/src/client/wasm/index.ts
index 3f0ded87c..df93ad7b8 100644
--- a/packages/sdk-ts/src/client/wasm/index.ts
+++ b/packages/sdk-ts/src/client/wasm/index.ts
@@ -1,5 +1,6 @@
-export * from './swap/index.js'
export * from './types.js'
+export * from './swap/index.js'
+export * from './neptune/index.js'
export * from './incentives/index.js'
export * from './nameservice/index.js'
export * from './trading_strategies/index.js'
diff --git a/packages/sdk-ts/src/client/wasm/neptune/helper.ts b/packages/sdk-ts/src/client/wasm/neptune/helper.ts
new file mode 100644
index 000000000..37a6443c6
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/helper.ts
@@ -0,0 +1,9 @@
+import { AssetInfo } from './types.js'
+
+export function getDenom(assetInfo: AssetInfo): string | undefined {
+ if ('native_token' in assetInfo) {
+ return assetInfo.native_token.denom
+ }
+
+ return assetInfo.token.contract_addr
+}
diff --git a/packages/sdk-ts/src/client/wasm/neptune/index.ts b/packages/sdk-ts/src/client/wasm/neptune/index.ts
new file mode 100644
index 000000000..9dd369b0c
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/index.ts
@@ -0,0 +1,6 @@
+export * from './types.js'
+export * from './service.js'
+export * from './transformer.js'
+export * from './queries/index.js'
+
+export const NEPTUNE_PRICE_CONTRACT = 'inj1u6cclz0qh5tep9m2qayry9k97dm46pnlqf8nre'
diff --git a/packages/sdk-ts/src/client/wasm/neptune/queries/QueryGetPrices.ts b/packages/sdk-ts/src/client/wasm/neptune/queries/QueryGetPrices.ts
new file mode 100644
index 000000000..2c5382a09
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/queries/QueryGetPrices.ts
@@ -0,0 +1,19 @@
+import { BaseWasmQuery } from '../../BaseWasmQuery.js'
+import { toBase64 } from '../../../../utils/index.js'
+import { AssetInfo } from '../types.js'
+
+export declare namespace QueryGetPrices {
+ export interface Params {
+ assets: AssetInfo[]
+ }
+}
+
+export class QueryGetPrices extends BaseWasmQuery {
+ toPayload() {
+ return toBase64({
+ get_prices: {
+ assets: this.params.assets,
+ },
+ })
+ }
+}
diff --git a/packages/sdk-ts/src/client/wasm/neptune/queries/QueryLendingRates.ts b/packages/sdk-ts/src/client/wasm/neptune/queries/QueryLendingRates.ts
new file mode 100644
index 000000000..4a91de1d6
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/queries/QueryLendingRates.ts
@@ -0,0 +1,23 @@
+import { BaseWasmQuery } from '../../BaseWasmQuery.js';
+import { toBase64 } from '../../../../utils/index.js';
+import { AssetInfo } from '../types.js';
+
+export declare namespace QueryGetAllLendingRates {
+ export interface Params {
+ limit?: number;
+ startAfter?: AssetInfo;
+ }
+}
+
+export class QueryGetAllLendingRates extends BaseWasmQuery {
+ toPayload() {
+ const payload = {
+ get_all_lending_rates: {
+ ...(this.params.limit !== undefined ? { limit: this.params.limit } : {}),
+ ...(this.params.startAfter ? { start_after: this.params.startAfter } : {}),
+ },
+ };
+
+ return toBase64(payload);
+ }
+}
diff --git a/packages/sdk-ts/src/client/wasm/neptune/queries/index.ts b/packages/sdk-ts/src/client/wasm/neptune/queries/index.ts
new file mode 100644
index 000000000..65c4f006c
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/queries/index.ts
@@ -0,0 +1,2 @@
+export { QueryGetPrices } from './QueryGetPrices.js'
+export { QueryGetAllLendingRates } from './QueryLendingRates.js'
diff --git a/packages/sdk-ts/src/client/wasm/neptune/service.ts b/packages/sdk-ts/src/client/wasm/neptune/service.ts
new file mode 100644
index 000000000..699b70c1e
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/service.ts
@@ -0,0 +1,268 @@
+import {
+ Network,
+ isMainnet,
+ NetworkEndpoints,
+ getNetworkEndpoints,
+} from '@injectivelabs/networks'
+import { getDenom } from './helper.js'
+import { ChainGrpcWasmApi } from '../../chain/index.js'
+import { QueryGetPrices, QueryGetAllLendingRates } from './queries/index.js'
+import { NeptuneQueryTransformer } from './transformer.js'
+import ExecArgNeptuneDeposit from '../../../core/modules/wasm/exec-args/ExecArgNeptuneDeposit.js'
+import ExecArgNeptuneWithdraw from '../../../core/modules/wasm/exec-args/ExecArgNeptuneWithdraw.js'
+import MsgExecuteContractCompat from '../../../core/modules/wasm/msgs/MsgExecuteContractCompat.js'
+import { GeneralException } from '@injectivelabs/exceptions'
+import { NEPTUNE_PRICE_CONTRACT } from './index.js'
+import {
+ AssetInfo,
+ AssetInfoWithPrice,
+ NEPTUNE_USDT_CW20_CONTRACT,
+} from './types.js'
+
+const NEPTUNE_USDT_MARKET_CONTRACT =
+ 'inj1nc7gjkf2mhp34a6gquhurg8qahnw5kxs5u3s4u'
+const NEPTUNE_INTEREST_CONTRACT =
+ 'inj1ftech0pdjrjawltgejlmpx57cyhsz6frdx2dhq'
+
+export class NeptuneService {
+ private client: ChainGrpcWasmApi
+ private priceOracleContract: string
+
+ /**
+ * Constructs a new NeptuneService instan ce.
+ * @param network The network to use (default: Mainnet).
+ * @param endpoints Optional custom network endpoints.
+ */
+ constructor(
+ network: Network = Network.MainnetSentry,
+ endpoints?: NetworkEndpoints,
+ ) {
+ if (!isMainnet(network)) {
+ throw new GeneralException(new Error('Please switch to mainnet network'))
+ }
+
+ const networkEndpoints = endpoints || getNetworkEndpoints(network)
+ this.client = new ChainGrpcWasmApi(networkEndpoints.grpc)
+ this.priceOracleContract = NEPTUNE_PRICE_CONTRACT
+ }
+
+ /**
+ * Fetch prices for given assets from the Neptune Price Oracle contract.
+ * @param assets Array of AssetInfo objects.
+ * @returns Array of Price objects.
+ */
+ async fetchPrices(assets: AssetInfo[]): Promise {
+ const queryGetPricesPayload = new QueryGetPrices({ assets }).toPayload()
+
+ try {
+ const response = await this.client.fetchSmartContractState(
+ this.priceOracleContract,
+ queryGetPricesPayload,
+ )
+
+ const prices =
+ NeptuneQueryTransformer.contractPricesResponseToPrices(response)
+
+ return prices
+ } catch (error) {
+ console.error('Error fetching prices:', error)
+ throw new GeneralException(new Error('Failed to fetch prices'))
+ }
+ }
+
+ /**
+ * Fetch the redemption ratio based on CW20 and native asset prices.
+ * @param cw20Asset AssetInfo for the CW20 token.
+ * @param nativeAsset AssetInfo for the native token.
+ * @returns Redemption ratio as a number.
+ */
+ async fetchRedemptionRatio({
+ cw20Asset,
+ nativeAsset,
+ }: {
+ cw20Asset: AssetInfo
+ nativeAsset: AssetInfo
+ }): Promise {
+ const prices = await this.fetchPrices([cw20Asset, nativeAsset])
+
+ const [cw20Price] = prices
+ const [nativePrice] = prices.reverse()
+
+ if (!cw20Price || !nativePrice) {
+ throw new GeneralException(
+ new Error('Failed to compute redemption ratio'),
+ )
+ }
+
+ return Number(cw20Price.price) / Number(nativePrice.price)
+ }
+
+ /**
+ * Convert CW20 nUSDT to bank nUSDT using the redemption ratio.
+ * @param amountCW20 Amount in CW20 nUSDT.
+ * @param redemptionRatio Redemption ratio.
+ * @returns Amount in bank nUSDT.
+ */
+ calculateBankAmount(amountCW20: number, redemptionRatio: number): number {
+ return amountCW20 * redemptionRatio
+ }
+
+ /**
+ * Convert bank nUSDT to CW20 nUSDT using the redemption ratio.
+ * @param amountBank Amount in bank nUSDT.
+ * @param redemptionRatio Redemption ratio.
+ * @returns Amount in CW20 nUSDT.
+ */
+ calculateCw20Amount(amountBank: number, redemptionRatio: number): number {
+ return amountBank / redemptionRatio
+ }
+
+ /**
+ * Create a deposit message.
+ * @param sender Sender's Injective address.
+ * @param contractAddress USDT market contract address.
+ * @param denom Denomination of the asset.
+ * @param amount Amount to deposit as a string.
+ * @returns MsgExecuteContractCompat message.
+ */
+ createDepositMsg({
+ denom,
+ amount,
+ sender,
+ contractAddress = NEPTUNE_USDT_MARKET_CONTRACT,
+ }: {
+ denom: string
+ amount: string
+ sender: string
+ contractAddress?: string
+ }): MsgExecuteContractCompat {
+ return MsgExecuteContractCompat.fromJSON({
+ sender,
+ contractAddress,
+ execArgs: ExecArgNeptuneDeposit.fromJSON({}),
+ funds: {
+ denom,
+ amount,
+ },
+ })
+ }
+
+ /**
+ * Create a withdraw message.
+ * @param sender Sender's Injective address.
+ * @param contractAddress nUSDT contract address.
+ * @param amount Amount to withdraw as a string.
+ * @returns MsgExecuteContractCompat message.
+ */
+ createWithdrawMsg({
+ amount,
+ sender,
+ cw20ContractAddress = NEPTUNE_USDT_CW20_CONTRACT,
+ marketContractAddress = NEPTUNE_USDT_MARKET_CONTRACT,
+ }: {
+ amount: string
+ sender: string
+ cw20ContractAddress?: string
+ marketContractAddress?: string
+ }): MsgExecuteContractCompat {
+ return MsgExecuteContractCompat.fromJSON({
+ sender,
+ contractAddress: cw20ContractAddress,
+ execArgs: ExecArgNeptuneWithdraw.fromJSON({
+ amount,
+ contract: marketContractAddress,
+ }),
+ })
+ }
+
+ /**
+ * Fetch lending rates with optional pagination parameters.
+ * @param limit Maximum number of lending rates to fetch.
+ * @param startAfter AssetInfo to start after for pagination.
+ * @returns Array of [AssetInfo, Decimal256] tuples.
+ */
+ async getLendingRates({
+ limit,
+ startAfter,
+ contractAddress = NEPTUNE_INTEREST_CONTRACT,
+ }: {
+ limit?: number
+ startAfter?: AssetInfo
+ contractAddress?: string
+ }): Promise> {
+ const query = new QueryGetAllLendingRates({ limit, startAfter })
+ const payload = query.toPayload()
+
+ try {
+ const response = await this.client.fetchSmartContractState(
+ contractAddress,
+ payload,
+ )
+
+ const lendingRates =
+ NeptuneQueryTransformer.contractLendingRatesResponseToLendingRates(
+ response,
+ )
+
+ return lendingRates
+ } catch (error) {
+ console.error('Error fetching lending rates:', error)
+ throw new GeneralException(new Error('Failed to fetch lending rates'))
+ }
+ }
+
+ /**
+ * Fetch the lending rate for a specific denom by querying the smart contract with pagination.
+ * @param denom The denomination string of the asset to find the lending rate for.
+ * @returns Lending rate as a string.
+ */
+ async getLendingRateByDenom({
+ denom,
+ contractAddress = NEPTUNE_INTEREST_CONTRACT,
+ }: {
+ denom: string
+ contractAddress?: string
+ }): Promise {
+ const limit = 10
+ let startAfter = undefined
+
+ while (true) {
+ const lendingRates = await this.getLendingRates({
+ limit,
+ startAfter,
+ contractAddress,
+ })
+
+ if (lendingRates.length === 0) {
+ return
+ }
+
+ for (const { assetInfo, lendingRate } of lendingRates) {
+ const currentDenom = getDenom(assetInfo)
+
+ if (currentDenom === denom) {
+ return lendingRate
+ }
+ }
+
+ if (lendingRates.length < limit) {
+ return
+ }
+
+ const lastLendingRate = lendingRates[lendingRates.length - 1]
+
+ startAfter = lastLendingRate.assetInfo
+ }
+ }
+
+ /**
+ * Calculates APY from APR and compounding frequency.
+ *
+ * @param apr - The annual percentage rate as a decimal (e.g., 0.10 for 10%)
+ * @param compoundingFrequency - Number of times interest is compounded per year
+ * @returns The annual percentage yield as a decimal
+ */
+ calculateAPY(apr: number): number {
+ return Math.exp(apr) - 1
+ }
+}
diff --git a/packages/sdk-ts/src/client/wasm/neptune/transformer.ts b/packages/sdk-ts/src/client/wasm/neptune/transformer.ts
new file mode 100644
index 000000000..e889940db
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/transformer.ts
@@ -0,0 +1,27 @@
+import { WasmContractQueryResponse } from '../types.js'
+import { toUtf8 } from '../../../utils/index.js'
+import { AssetInfo, PriceResponse, LendingRateResponse } from './types.js'
+
+export class NeptuneQueryTransformer {
+ static contractPricesResponseToPrices(
+ response: WasmContractQueryResponse,
+ ): Array<{ assetInfo: AssetInfo; price: string }> {
+ const data = JSON.parse(toUtf8(response.data)) as PriceResponse
+
+ return data.map(([assetInfo, priceInfo]) => ({
+ assetInfo,
+ price: priceInfo.price,
+ }))
+ }
+
+ static contractLendingRatesResponseToLendingRates(
+ response: WasmContractQueryResponse,
+ ): Array<{ assetInfo: AssetInfo; lendingRate: string }> {
+ const data = JSON.parse(toUtf8(response.data)) as LendingRateResponse
+
+ return data.map(([assetInfo, lendingRate]) => ({
+ assetInfo,
+ lendingRate,
+ }))
+ }
+}
diff --git a/packages/sdk-ts/src/client/wasm/neptune/types.ts b/packages/sdk-ts/src/client/wasm/neptune/types.ts
new file mode 100644
index 000000000..19c15a78d
--- /dev/null
+++ b/packages/sdk-ts/src/client/wasm/neptune/types.ts
@@ -0,0 +1,19 @@
+export type AssetInfo =
+ | {
+ token: {
+ contract_addr: string
+ }
+ }
+ | {
+ native_token: {
+ denom: string
+ }
+ }
+
+export type AssetInfoWithPrice = {assetInfo: AssetInfo, price: string }
+
+export type PriceResponse = Array<[AssetInfo, { price: string }]>
+export type LendingRateResponse = Array<[AssetInfo, string]>
+
+export const NEPTUNE_USDT_CW20_CONTRACT =
+ 'inj1cy9hes20vww2yr6crvs75gxy5hpycya2hmjg9s'
diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgNeptuneDeposit.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgNeptuneDeposit.ts
new file mode 100644
index 000000000..3cd75205b
--- /dev/null
+++ b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgNeptuneDeposit.ts
@@ -0,0 +1,33 @@
+import {
+ dataToExecData,
+ ExecArgBase,
+ ExecDataRepresentation,
+} from '../ExecArgBase'
+
+export declare namespace ExecArgNeptuneDeposit {
+ export interface Params {}
+
+ export interface Data {}
+}
+
+/**
+ * @category Contract Exec Arguments
+ */
+export default class ExecArgNeptuneDeposit extends ExecArgBase<
+ ExecArgNeptuneDeposit.Params,
+ ExecArgNeptuneDeposit.Data
+> {
+ static fromJSON(
+ params: ExecArgNeptuneDeposit.Params,
+ ): ExecArgNeptuneDeposit {
+ return new ExecArgNeptuneDeposit(params)
+ }
+
+ public toData(): ExecArgNeptuneDeposit.Data {
+ return {}
+ }
+
+ public toExecData(): ExecDataRepresentation {
+ return dataToExecData('lend', this.toData())
+ }
+}
diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgNeptuneWithdraw.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgNeptuneWithdraw.ts
new file mode 100644
index 000000000..287dd389b
--- /dev/null
+++ b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgNeptuneWithdraw.ts
@@ -0,0 +1,50 @@
+import {
+ ExecArgBase,
+ dataToExecData,
+ ExecDataRepresentation,
+} from '../ExecArgBase'
+import { toBase64 } from '../../../../utils'
+
+
+export declare namespace ExecArgNeptuneWithdraw {
+ export interface Params {
+ amount: string
+ contract: string
+ }
+
+ export interface Data {
+ amount: string
+ contract: string
+ msg: string
+ }
+}
+
+/**
+ * @category Contract Exec Arguments
+ */
+export default class ExecArgNeptuneWithdraw extends ExecArgBase<
+ ExecArgNeptuneWithdraw.Params,
+ ExecArgNeptuneWithdraw.Data
+> {
+ static fromJSON(
+ params: ExecArgNeptuneWithdraw.Params,
+ ): ExecArgNeptuneWithdraw {
+ return new ExecArgNeptuneWithdraw(params)
+ }
+
+ toData(): ExecArgNeptuneWithdraw.Data {
+ const { params } = this
+ const innerMsg = { redeem: {} }
+ const encodedMsg = toBase64(innerMsg)
+
+ return {
+ amount: params.amount,
+ contract: params.contract,
+ msg: encodedMsg,
+ }
+ }
+
+ toExecData(): ExecDataRepresentation {
+ return dataToExecData('send', this.toData())
+ }
+}
diff --git a/packages/sdk-ts/src/core/modules/wasm/index.ts b/packages/sdk-ts/src/core/modules/wasm/index.ts
index 286a11190..f3f178877 100644
--- a/packages/sdk-ts/src/core/modules/wasm/index.ts
+++ b/packages/sdk-ts/src/core/modules/wasm/index.ts
@@ -6,7 +6,9 @@ import ExecArgCW20Transfer from './exec-args/ExecArgCW20Transfer.js'
import ExecArgSwapMinOutput from './exec-args/ExecArgSwapMinOutput.js'
import ExecArgDepositTokens from './exec-args/ExecArgDepositTokens.js'
import ExecArgCreateCampaign from './exec-args/ExecArgCreateCampaign.js'
+import ExecArgNeptuneDeposit from './exec-args/ExecArgNeptuneDeposit.js'
import ExecArgSwapExactOutput from './exec-args/ExecArgSwapExactOutput.js'
+import ExecArgNeptuneWithdraw from './exec-args/ExecArgNeptuneWithdraw.js'
import ExecArgInitiateTransfer from './exec-args/ExecArgInitiateTransfer.js'
import ExecArgUpdateGridConfig from './exec-args/ExecArgUpdateGridConfig.js'
import ExecArgIncreaseAllowance from './exec-args/ExecArgIncreaseAllowance.js'
@@ -40,7 +42,9 @@ export {
ExecArgSwapMinOutput,
ExecArgDepositTokens,
ExecArgCreateCampaign,
+ ExecArgNeptuneDeposit,
ExecArgSwapExactOutput,
+ ExecArgNeptuneWithdraw,
ExecArgInitiateTransfer,
ExecArgUpdateGridConfig,
ExecArgIncreaseAllowance,