ault-sdk-ts 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -1
- package/dist/agent/sign-and-broadcast.d.ts +1 -1
- package/dist/agent/tx/perpetual.d.ts +10 -0
- package/dist/client.d.ts +2 -0
- package/dist/core/clob-msgs.d.ts +12 -3
- package/dist/core/manifest-types.d.ts +8 -0
- package/dist/core/network.d.ts +11 -7
- package/dist/core/perpetual-gas.d.ts +12 -0
- package/dist/core/perpetual-msgs.d.ts +60 -0
- package/dist/eip712/msg-encoders.generated.d.ts +8 -0
- package/dist/eip712/msg.generated.d.ts +76 -6
- package/dist/eip712/registry.d.ts +11 -0
- package/dist/eip712/types.d.ts +5 -0
- package/dist/high-level/tx/perpetual.d.ts +3 -0
- package/dist/high-level/types.d.ts +83 -4
- package/dist/index.cjs +25837 -10411
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25760 -10598
- package/dist/index.js.map +1 -1
- package/dist/perp/decimal.d.ts +39 -0
- package/dist/perp/funding.d.ts +18 -0
- package/dist/perp/index.d.ts +5 -0
- package/dist/perp/margin.d.ts +33 -0
- package/dist/perp/orders.d.ts +27 -0
- package/dist/perp/position.d.ts +29 -0
- package/dist/proto/gen/ault/accountx/v1/query.d.ts +10 -1
- package/dist/proto/gen/ault/authority/v1/authority.d.ts +2 -0
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +7 -0
- package/dist/proto/gen/ault/clob/v1/twap.d.ts +11 -8
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +11 -1
- package/dist/proto/gen/ault/common/v1/system.d.ts +31 -0
- package/dist/proto/gen/ault/lending/v1/genesis.d.ts +34 -0
- package/dist/proto/gen/ault/lending/v1/lending.d.ts +152 -0
- package/dist/proto/gen/ault/lending/v1/params.d.ts +42 -0
- package/dist/proto/gen/ault/lending/v1/query.d.ts +157 -0
- package/dist/proto/gen/ault/lending/v1/tx.d.ts +236 -0
- package/dist/proto/gen/ault/margin/v1/genesis.d.ts +102 -0
- package/dist/proto/gen/ault/margin/v1/margin.d.ts +130 -0
- package/dist/proto/gen/ault/margin/v1/params.d.ts +31 -0
- package/dist/proto/gen/ault/margin/v1/query.d.ts +127 -0
- package/dist/proto/gen/ault/margin/v1/tx.d.ts +181 -0
- package/dist/proto/gen/ault/market/v1/market.d.ts +9 -0
- package/dist/proto/gen/ault/market/v1/tx.d.ts +16 -0
- package/dist/proto/gen/ault/oracle/v1/genesis.d.ts +69 -0
- package/dist/proto/gen/ault/oracle/v1/oracle.d.ts +154 -0
- package/dist/proto/gen/ault/oracle/v1/query.d.ts +93 -0
- package/dist/proto/gen/ault/oracle/v1/tx.d.ts +151 -0
- package/dist/proto/gen/ault/perpetual/v1/genesis.d.ts +119 -0
- package/dist/proto/gen/ault/perpetual/v1/order.d.ts +46 -0
- package/dist/proto/gen/ault/perpetual/v1/params.d.ts +30 -0
- package/dist/proto/gen/ault/perpetual/v1/perpetual.d.ts +192 -0
- package/dist/proto/gen/ault/perpetual/v1/query.d.ts +150 -0
- package/dist/proto/gen/ault/perpetual/v1/tx.d.ts +97 -0
- package/dist/proto/gen/ault/systemtx/v1/genesis.d.ts +37 -0
- package/dist/proto/gen/ault/vault/v1/genesis.d.ts +90 -0
- package/dist/proto/gen/ault/vault/v1/params.d.ts +55 -0
- package/dist/proto/gen/ault/vault/v1/query.d.ts +152 -0
- package/dist/proto/gen/ault/vault/v1/tx.d.ts +194 -0
- package/dist/proto/gen/ault/vault/v1/vault.d.ts +227 -0
- package/dist/rest/dex-types.generated.d.ts +2045 -27
- package/dist/rest/dex.d.ts +18 -1
- package/dist/rest/dex.generated.d.ts +5097 -1276
- package/dist/rest/perpetual.d.ts +46 -0
- package/dist/rest/tokenregistry.d.ts +7 -0
- package/dist/utils/cosmos-dec.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed-point arithmetic matching cosmossdk.io/math LegacyDec: 18 fractional
|
|
3
|
+
* digits, with the chain's rounding rules pinned per operation so a value the
|
|
4
|
+
* SDK derives (margin, equity, funding) matches the chain digit for digit.
|
|
5
|
+
*
|
|
6
|
+
* Values travel as canonical decimal strings (what the chain and the dex-api
|
|
7
|
+
* emit) and are scaled to `bigint` internally.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEC_PRECISION = 18;
|
|
10
|
+
/** Parses a decimal string into its 18-place scaled integer. */
|
|
11
|
+
export declare function parseDec(input: string): bigint;
|
|
12
|
+
/**
|
|
13
|
+
* Formats a scaled integer as a decimal string. With `fractionDigits`
|
|
14
|
+
* omitted the result is trimmed ("2500", "0.025"); pass 18 for LegacyDec's
|
|
15
|
+
* fixed `String()` form.
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatDec(value: bigint, fractionDigits?: number): string;
|
|
18
|
+
/** LegacyDec.Mul: exact product rounded half-to-even at 18 places. */
|
|
19
|
+
export declare function mulBank(a: bigint, b: bigint): bigint;
|
|
20
|
+
/** LegacyDec.QuoInt64 / QuoTruncate: quotient truncated toward zero at 18 places. */
|
|
21
|
+
export declare function quoTruncate(a: bigint, b: bigint): bigint;
|
|
22
|
+
/**
|
|
23
|
+
* LegacyDec.QuoRoundUp: the truncated quotient plus one unit in the last
|
|
24
|
+
* place when a remainder is left and either both operands share a sign or
|
|
25
|
+
* the dividend is negative (the chain's exact, slightly odd, rule).
|
|
26
|
+
*/
|
|
27
|
+
export declare function quoRoundUp(a: bigint, b: bigint): bigint;
|
|
28
|
+
/** Quotient rounded half away from zero at 18 places (shopspring DivRound). */
|
|
29
|
+
export declare function divRoundHalfAway(a: bigint, b: bigint): bigint;
|
|
30
|
+
export declare function absDec(value: bigint): bigint;
|
|
31
|
+
export declare function clampDec(value: bigint, low: bigint, high: bigint): bigint;
|
|
32
|
+
export declare function decFromInt(value: number | bigint): bigint;
|
|
33
|
+
/**
|
|
34
|
+
* Guards a count the chain stores as a positive uint32 (leverage, premium
|
|
35
|
+
* sample count) before it reaches the arithmetic, so an out-of-domain input
|
|
36
|
+
* fails with a clear message instead of a negative result or a raw
|
|
37
|
+
* `BigInt()` RangeError.
|
|
38
|
+
*/
|
|
39
|
+
export declare function requireUint32Positive(value: number, label: string): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The chain settles funding once per hour (UTC-aligned windows). */
|
|
2
|
+
export declare const SECONDS_PER_FUNDING_WINDOW = 3600;
|
|
3
|
+
/**
|
|
4
|
+
* Hourly funding rate from an average premium. Mirrors x/perpetual
|
|
5
|
+
* FundingRate: the eight-hour rate is the premium plus the interest gap
|
|
6
|
+
* clamped to ±`interestAdjustmentCap`, divided by eight with truncation, then
|
|
7
|
+
* clamped to ±`hourlyCap`. All inputs are decimal strings from the x/perpetual
|
|
8
|
+
* market query's config (proto PerpetualMarketConfig fundingInterestRate,
|
|
9
|
+
* fundingInterestAdjustmentCap, fundingHourlyCap); the dex-api REST market
|
|
10
|
+
* response does not carry them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function fundingRate(premium: string, interest8h: string, interestAdjustmentCap: string, hourlyCap: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* The window's mean premium so far: premium sum over sample count, truncated
|
|
15
|
+
* like the chain. Zero samples mean zero premium, which is also what the
|
|
16
|
+
* chain does when a window discards its samples.
|
|
17
|
+
*/
|
|
18
|
+
export declare function averagePremium(premiumSum: string, premiumCount: number): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DEC_PRECISION, parseDec, formatDec, mulBank, quoTruncate, quoRoundUp, divRoundHalfAway, } from "./decimal";
|
|
2
|
+
export { type MarginTier, parseMarginTiers, validateMarginTiers, maintenanceMargin, maxLeverage, initialMargin, } from "./margin";
|
|
3
|
+
export { SECONDS_PER_FUNDING_WINDOW, fundingRate, averagePremium } from "./funding";
|
|
4
|
+
export { notional, positionValue, unrealizedPnl, pendingFunding, equity, entryPrice, } from "./position";
|
|
5
|
+
export { type IocLimitPriceInput, type IocLimitPrice, iocLimitPrice } from "./orders";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A perpetual market's margin tier: the leverage cap that applies while the
|
|
3
|
+
* position notional stays at or below `notionalCap`. A "0" cap marks the
|
|
4
|
+
* unbounded last tier. Mirrors x/perpetual MarginTier.
|
|
5
|
+
*/
|
|
6
|
+
export interface MarginTier {
|
|
7
|
+
/** Decimal string in the chain's quote units; "0" = unbounded (last tier only). */
|
|
8
|
+
notionalCap: string;
|
|
9
|
+
maxLeverage: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Accepts tiers as the dex-api serves them (`notionalCap`/`maxLeverage`) or
|
|
13
|
+
* as the chain stores them (`notional_cap`/`max_leverage`) and validates
|
|
14
|
+
* them with the chain's rules, so a malformed list fails loudly instead of
|
|
15
|
+
* producing a silently wrong margin.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseMarginTiers(raw: unknown): MarginTier[];
|
|
18
|
+
/** Mirrors x/perpetual ValidateMarginTiers. */
|
|
19
|
+
export declare function validateMarginTiers(tiers: readonly MarginTier[]): void;
|
|
20
|
+
/**
|
|
21
|
+
* Maintenance margin for a notional under the given tiers, with deductions
|
|
22
|
+
* carried across tier boundaries so the requirement is continuous. Mirrors
|
|
23
|
+
* x/perpetual MaintenanceMargin, rounding each product half-to-even.
|
|
24
|
+
*/
|
|
25
|
+
export declare function maintenanceMargin(notional: string, tiers: readonly MarginTier[]): string;
|
|
26
|
+
/** The leverage cap the notional's tier allows. Mirrors x/perpetual MaxLeverage. */
|
|
27
|
+
export declare function maxLeverage(notional: string, tiers: readonly MarginTier[]): number;
|
|
28
|
+
/**
|
|
29
|
+
* Collateral a position must hold at the owner's leverage: notional /
|
|
30
|
+
* leverage rounded up, as the chain's risk walk does (QuoRoundUp) so a
|
|
31
|
+
* fractional unit is never waived. Leverage 0 returns the notional.
|
|
32
|
+
*/
|
|
33
|
+
export declare function initialMargin(notional: string, leverage: number): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface IocLimitPriceInput {
|
|
2
|
+
side: "buy" | "sell";
|
|
3
|
+
/** Best bid on the book, decimal string; null/undefined when the side is empty. */
|
|
4
|
+
bestBid?: string | null;
|
|
5
|
+
/** Best ask on the book, decimal string; null/undefined when the side is empty. */
|
|
6
|
+
bestAsk?: string | null;
|
|
7
|
+
/** Fallback reference when the opposite side is empty (last trade or mark). */
|
|
8
|
+
fallbackPrice?: string | null;
|
|
9
|
+
/** Fractional slippage allowance, e.g. "0.005" for 0.5%. */
|
|
10
|
+
slippage: string;
|
|
11
|
+
/** Number of decimal places the market's price tick allows. */
|
|
12
|
+
priceDecimals: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IocLimitPrice {
|
|
15
|
+
/** The limit price to submit with `timeInForce: "ioc"`. */
|
|
16
|
+
price: string;
|
|
17
|
+
/** The book price the slippage was applied to. */
|
|
18
|
+
referencePrice: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Perpetual markets accept limit orders only, so a "market order" is an
|
|
22
|
+
* immediate-or-cancel limit priced through the book: best opposite price
|
|
23
|
+
* plus (buy) or minus (sell) the slippage allowance, rounded away from the
|
|
24
|
+
* reference to the market's price tick so the order stays marketable. The
|
|
25
|
+
* chain projects margin at this limit price, which bounds the worst fill.
|
|
26
|
+
*/
|
|
27
|
+
export declare function iocLimitPrice(input: IocLimitPriceInput): IocLimitPrice;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Position formulas mirroring the x/perpetual risk walk (keeper/risk.go) and
|
|
3
|
+
* Position helpers (types/position.go). Inputs are the chain's own units:
|
|
4
|
+
* `netBase` in raw base units (positive = long, negative = short), `netQuote`
|
|
5
|
+
* and `collateral` in raw quote units, prices as quote per base. Every
|
|
6
|
+
* product rounds half-to-even at 18 places like LegacyDec.Mul.
|
|
7
|
+
*/
|
|
8
|
+
/** Mark-valued size: |netBase| × mark. */
|
|
9
|
+
export declare function notional(netBase: string, mark: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* What the position is worth at mark net of what was paid for it:
|
|
12
|
+
* netBase × mark + netQuote. Positive is unrealized profit.
|
|
13
|
+
*/
|
|
14
|
+
export declare function positionValue(netBase: string, netQuote: string, mark: string): string;
|
|
15
|
+
/** Alias of `positionValue`: the position's unrealized PnL at mark. */
|
|
16
|
+
export declare function unrealizedPnl(netBase: string, netQuote: string, mark: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Funding owed since the position's checkpoint: netBase × (cumulative index −
|
|
19
|
+
* last index). Positive means the position pays.
|
|
20
|
+
*/
|
|
21
|
+
export declare function pendingFunding(netBase: string, cumulativeFundingIndex: string, lastFundingIndex: string): string;
|
|
22
|
+
/** Collateral plus value at mark, less pending funding: the chain's per-position equity walk. */
|
|
23
|
+
export declare function equity(collateral: string, netBase: string, netQuote: string, mark: string, cumulativeFundingIndex: string, lastFundingIndex: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Average entry price of the open base: |netQuote / netBase|. A display
|
|
26
|
+
* value, not a chain formula; rounds half away from zero at 18 places. Zero
|
|
27
|
+
* base yields "0".
|
|
28
|
+
*/
|
|
29
|
+
export declare function entryPrice(netBase: string, netQuote: string): string;
|
|
@@ -56,7 +56,10 @@ export interface QueryFeeFreeGasLimitsRequest {
|
|
|
56
56
|
* Query/FeeFreeGasLimits RPC method.
|
|
57
57
|
*/
|
|
58
58
|
export interface QueryFeeFreeGasLimitsResponse {
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* gas_limits contains schedules identified by msg_type_url and variant
|
|
61
|
+
* together.
|
|
62
|
+
*/
|
|
60
63
|
gasLimits: FeeFreeGasLimit[];
|
|
61
64
|
}
|
|
62
65
|
/** FeeFreeGasLimit defines the minimum gas setting for a fee-free message. */
|
|
@@ -73,6 +76,12 @@ export interface FeeFreeGasLimit {
|
|
|
73
76
|
* per_unit * n.
|
|
74
77
|
*/
|
|
75
78
|
perUnitGasLimit: bigint;
|
|
79
|
+
/**
|
|
80
|
+
* variant distinguishes schedules for the same message type; empty means a
|
|
81
|
+
* single schedule. MsgCreateVault uses "trading" (per spot market) and
|
|
82
|
+
* "lending" (per pool).
|
|
83
|
+
*/
|
|
84
|
+
variant: string;
|
|
76
85
|
}
|
|
77
86
|
export declare const QueryLabelRequest: MessageFns<QueryLabelRequest>;
|
|
78
87
|
export declare const QueryLabelResponse: MessageFns<QueryLabelResponse>;
|
|
@@ -11,6 +11,8 @@ export declare enum Role {
|
|
|
11
11
|
ROLE_REWARD_MANAGER = 3,
|
|
12
12
|
/** ROLE_REVOKER - ROLE_REVOKER can call MsgRevokeRole without a governance proposal. */
|
|
13
13
|
ROLE_REVOKER = 4,
|
|
14
|
+
/** ROLE_LENDING_COORDINATOR - ROLE_LENDING_COORDINATOR coordinates lending pool and asset operations. */
|
|
15
|
+
ROLE_LENDING_COORDINATOR = 5,
|
|
14
16
|
UNRECOGNIZED = -1
|
|
15
17
|
}
|
|
16
18
|
export declare function roleFromJSON(object: any): Role;
|
|
@@ -15,6 +15,8 @@ export interface GenesisState {
|
|
|
15
15
|
twapOrders: TwapOrder[];
|
|
16
16
|
/** Scheduling state per TWAP order: twap_id -> schedule */
|
|
17
17
|
twapSchedules: TwapScheduleEntry[];
|
|
18
|
+
/** Owner index entries: orderer -> order_id */
|
|
19
|
+
ordersByOrderer: OrdersByOrdererEntry[];
|
|
18
20
|
}
|
|
19
21
|
export interface TwapScheduleEntry {
|
|
20
22
|
twapId: Uint8Array;
|
|
@@ -39,12 +41,17 @@ export interface OrdersByCloidEntry {
|
|
|
39
41
|
cloid: Uint8Array;
|
|
40
42
|
orderId: Uint8Array;
|
|
41
43
|
}
|
|
44
|
+
export interface OrdersByOrdererEntry {
|
|
45
|
+
orderer: string;
|
|
46
|
+
orderId: Uint8Array;
|
|
47
|
+
}
|
|
42
48
|
export declare const GenesisState: MessageFns<GenesisState>;
|
|
43
49
|
export declare const TwapScheduleEntry: MessageFns<TwapScheduleEntry>;
|
|
44
50
|
export declare const OrderBookIndexEntry: MessageFns<OrderBookIndexEntry>;
|
|
45
51
|
export declare const TotalOrdersByOrdererEntry: MessageFns<TotalOrdersByOrdererEntry>;
|
|
46
52
|
export declare const OrdersByDeadlineIndexEntry: MessageFns<OrdersByDeadlineIndexEntry>;
|
|
47
53
|
export declare const OrdersByCloidEntry: MessageFns<OrdersByCloidEntry>;
|
|
54
|
+
export declare const OrdersByOrdererEntry: MessageFns<OrdersByOrdererEntry>;
|
|
48
55
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
49
56
|
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
50
57
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,9 +3,9 @@ import { FeeInfo } from "./fee";
|
|
|
3
3
|
export declare const protobufPackage = "ault.clob.v1";
|
|
4
4
|
/**
|
|
5
5
|
* TwapOrder is the market-agnostic execution parent owned by x/clob. It holds
|
|
6
|
-
* only the parameters fixed at placement
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* only the parameters fixed at placement; the frequently-updated execution
|
|
7
|
+
* state lives in TwapSchedule so per-block updates rewrite a small record
|
|
8
|
+
* instead of this one.
|
|
9
9
|
*/
|
|
10
10
|
export interface TwapOrder {
|
|
11
11
|
id: Uint8Array;
|
|
@@ -13,12 +13,10 @@ export interface TwapOrder {
|
|
|
13
13
|
marketId: Uint8Array;
|
|
14
14
|
isBuy: boolean;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* pay-denom balance, so unfilled slice refunds are redeployed by later
|
|
19
|
-
* slices instead of being tracked with a counter.
|
|
16
|
+
* total_size is the maximum pay-denom amount for all slices. Each slice
|
|
17
|
+
* escrows its own deposit from orderer when it executes.
|
|
20
18
|
*/
|
|
21
|
-
|
|
19
|
+
totalSize: string;
|
|
22
20
|
startTime: Date | undefined;
|
|
23
21
|
deadline: Date | undefined;
|
|
24
22
|
worstPrice: string;
|
|
@@ -37,6 +35,11 @@ export interface TwapSchedule {
|
|
|
37
35
|
* interval, so it is not stored (see TwapOrder.NumSlices).
|
|
38
36
|
*/
|
|
39
37
|
sliceIndex: number;
|
|
38
|
+
/**
|
|
39
|
+
* remaining_size is reduced by the pay-denom amount actually consumed by
|
|
40
|
+
* completed slices. Unfilled refunds remain available to later slices.
|
|
41
|
+
*/
|
|
42
|
+
remainingSize: string;
|
|
40
43
|
}
|
|
41
44
|
export declare const TwapOrder: MessageFns<TwapOrder>;
|
|
42
45
|
export declare const TwapSchedule: MessageFns<TwapSchedule>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
|
3
|
+
import { Any } from "../../../google/protobuf/any";
|
|
3
4
|
import { Params } from "./params";
|
|
4
5
|
export declare const protobufPackage = "ault.clob.v1";
|
|
5
6
|
/** TimeInForce controls how long an order remains active. */
|
|
@@ -37,6 +38,7 @@ export interface MsgPlaceLimitOrder {
|
|
|
37
38
|
builderFeeRate: string;
|
|
38
39
|
cloid: Uint8Array;
|
|
39
40
|
timeInForce: TimeInForce;
|
|
41
|
+
options: Any | undefined;
|
|
40
42
|
}
|
|
41
43
|
export interface MsgPlaceLimitOrderResponse {
|
|
42
44
|
orderId: Uint8Array;
|
|
@@ -58,6 +60,7 @@ export interface MsgPlaceMarketOrder {
|
|
|
58
60
|
*/
|
|
59
61
|
builderFeeRate: string;
|
|
60
62
|
cloid: Uint8Array;
|
|
63
|
+
options: Any | undefined;
|
|
61
64
|
}
|
|
62
65
|
export interface MsgPlaceMarketOrderResponse {
|
|
63
66
|
orderId: Uint8Array;
|
|
@@ -68,7 +71,8 @@ export interface MsgPlaceTwapOrder {
|
|
|
68
71
|
sender: string;
|
|
69
72
|
marketId: Uint8Array;
|
|
70
73
|
isBuy: boolean;
|
|
71
|
-
|
|
74
|
+
/** total_size is the maximum pay-denom amount for all TWAP slices. */
|
|
75
|
+
totalSize: string;
|
|
72
76
|
deadline: Date | undefined;
|
|
73
77
|
worstPrice: string;
|
|
74
78
|
priceTolerance: string;
|
|
@@ -84,6 +88,11 @@ export interface MsgPlaceTwapOrder {
|
|
|
84
88
|
}
|
|
85
89
|
export interface MsgPlaceTwapOrderResponse {
|
|
86
90
|
twapId: Uint8Array;
|
|
91
|
+
/**
|
|
92
|
+
* Deprecated: TWAP placement no longer escrows the total size.
|
|
93
|
+
*
|
|
94
|
+
* @deprecated
|
|
95
|
+
*/
|
|
87
96
|
escrowedAmount: Coin | undefined;
|
|
88
97
|
numSlices: number;
|
|
89
98
|
cloid: Uint8Array;
|
|
@@ -133,6 +142,7 @@ export interface MsgPlaceScaleOrder {
|
|
|
133
142
|
* optional).
|
|
134
143
|
*/
|
|
135
144
|
builderFeeRate: string;
|
|
145
|
+
options: Any | undefined;
|
|
136
146
|
}
|
|
137
147
|
export interface MsgPlaceScaleOrderResponse {
|
|
138
148
|
orders: ScaleOrderResult[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "ault.common.v1";
|
|
3
|
+
/**
|
|
4
|
+
* ExtensionOptionsSystemTx is the tx extension option marking a system
|
|
5
|
+
* transaction injected by the block proposer in PrepareProposal (e.g. oracle
|
|
6
|
+
* price injection). It routes the tx to the dedicated prepare-proposal ante
|
|
7
|
+
* handler; system txs are unsigned and fee-free by design and can never enter
|
|
8
|
+
* through the mempool.
|
|
9
|
+
*/
|
|
10
|
+
export interface ExtensionOptionsSystemTx {
|
|
11
|
+
}
|
|
12
|
+
export declare const ExtensionOptionsSystemTx: MessageFns<ExtensionOptionsSystemTx>;
|
|
13
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
14
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
15
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
16
|
+
} : Partial<T>;
|
|
17
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
18
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
19
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
20
|
+
} & {
|
|
21
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
22
|
+
};
|
|
23
|
+
export interface MessageFns<T> {
|
|
24
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
25
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
26
|
+
fromJSON(object: any): T;
|
|
27
|
+
toJSON(message: T): unknown;
|
|
28
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
29
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { AssetEntry, AssetStateEntry, PendingAssetUpdateEntry, PoolEntry, SharesEntry } from "./lending";
|
|
3
|
+
import { Params } from "./params";
|
|
4
|
+
export declare const protobufPackage = "ault.lending.v1";
|
|
5
|
+
export interface GenesisState {
|
|
6
|
+
params: Params | undefined;
|
|
7
|
+
nextPoolId: bigint;
|
|
8
|
+
lastAccruedAt: bigint;
|
|
9
|
+
pools: PoolEntry[];
|
|
10
|
+
assets: AssetEntry[];
|
|
11
|
+
assetStates: AssetStateEntry[];
|
|
12
|
+
shares: SharesEntry[];
|
|
13
|
+
pendingAssetUpdates: PendingAssetUpdateEntry[];
|
|
14
|
+
}
|
|
15
|
+
export declare const GenesisState: MessageFns<GenesisState>;
|
|
16
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
17
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
18
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
19
|
+
} : Partial<T>;
|
|
20
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
21
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
22
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
23
|
+
} & {
|
|
24
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
25
|
+
};
|
|
26
|
+
export interface MessageFns<T> {
|
|
27
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
28
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
29
|
+
fromJSON(object: any): T;
|
|
30
|
+
toJSON(message: T): unknown;
|
|
31
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
32
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "ault.lending.v1";
|
|
3
|
+
export interface Pool {
|
|
4
|
+
owner: string;
|
|
5
|
+
disabledActions: number;
|
|
6
|
+
allowSocialize: boolean;
|
|
7
|
+
targetHealthFactor: string;
|
|
8
|
+
minBonus: string;
|
|
9
|
+
maxBonusHf: string;
|
|
10
|
+
protocolFeeRate: string;
|
|
11
|
+
liquidationFeeRate: string;
|
|
12
|
+
/** Maximum oracle age in microseconds. */
|
|
13
|
+
maxOracleStaleness: bigint;
|
|
14
|
+
maxOracleDeviationRatio: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PoolEntry {
|
|
17
|
+
poolId: bigint;
|
|
18
|
+
pool: Pool | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface PoolAction {
|
|
21
|
+
poolId: bigint;
|
|
22
|
+
actions: number;
|
|
23
|
+
}
|
|
24
|
+
export interface Asset {
|
|
25
|
+
isBorrowable: boolean;
|
|
26
|
+
isCollateral: boolean;
|
|
27
|
+
ltv: string;
|
|
28
|
+
lt: string;
|
|
29
|
+
maxBonus: string;
|
|
30
|
+
kinks: string[];
|
|
31
|
+
/** Annualized rates at each kink and full utilization, in basis points. */
|
|
32
|
+
rates: string[];
|
|
33
|
+
supplyCap: string;
|
|
34
|
+
borrowCap: string;
|
|
35
|
+
oracleAsset: string;
|
|
36
|
+
spotMarketId: Uint8Array;
|
|
37
|
+
spotQuoteOracleDenom: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AssetTerms {
|
|
40
|
+
maxBonus: string;
|
|
41
|
+
kinks: string[];
|
|
42
|
+
/** Annualized rates at each kink and full utilization, in basis points. */
|
|
43
|
+
rates: string[];
|
|
44
|
+
supplyCap: string;
|
|
45
|
+
borrowCap: string;
|
|
46
|
+
}
|
|
47
|
+
export interface AssetRisk {
|
|
48
|
+
ltv: string;
|
|
49
|
+
lt: string;
|
|
50
|
+
oracleAsset: string;
|
|
51
|
+
spotMarketId: Uint8Array;
|
|
52
|
+
spotQuoteOracleDenom: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AssetTermsConfig {
|
|
55
|
+
denom: string;
|
|
56
|
+
terms: AssetTerms | undefined;
|
|
57
|
+
}
|
|
58
|
+
export interface AssetRiskConfig {
|
|
59
|
+
denom: string;
|
|
60
|
+
risk: AssetRisk | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface AssetConfig {
|
|
63
|
+
denom: string;
|
|
64
|
+
asset: Asset | undefined;
|
|
65
|
+
}
|
|
66
|
+
export interface AssetEntry {
|
|
67
|
+
poolId: bigint;
|
|
68
|
+
denom: string;
|
|
69
|
+
asset: Asset | undefined;
|
|
70
|
+
}
|
|
71
|
+
export interface PendingAssetUpdate {
|
|
72
|
+
risk: AssetRisk | undefined;
|
|
73
|
+
effectiveAt: bigint;
|
|
74
|
+
}
|
|
75
|
+
export interface PendingAssetUpdateEntry {
|
|
76
|
+
poolId: bigint;
|
|
77
|
+
denom: string;
|
|
78
|
+
update: PendingAssetUpdate | undefined;
|
|
79
|
+
}
|
|
80
|
+
export interface AssetState {
|
|
81
|
+
totalSupply: string;
|
|
82
|
+
totalBorrow: string;
|
|
83
|
+
totalSupplyShares: string;
|
|
84
|
+
totalBorrowShares: string;
|
|
85
|
+
collectedProtocolFee: string;
|
|
86
|
+
deficit: string;
|
|
87
|
+
}
|
|
88
|
+
export interface AssetStateEntry {
|
|
89
|
+
poolId: bigint;
|
|
90
|
+
denom: string;
|
|
91
|
+
state: AssetState | undefined;
|
|
92
|
+
}
|
|
93
|
+
export interface Shares {
|
|
94
|
+
supply: string;
|
|
95
|
+
borrow: string;
|
|
96
|
+
collateral: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SharesEntry {
|
|
99
|
+
poolId: bigint;
|
|
100
|
+
owner: string;
|
|
101
|
+
denom: string;
|
|
102
|
+
shares: Shares | undefined;
|
|
103
|
+
}
|
|
104
|
+
export interface DeficitEntry {
|
|
105
|
+
poolId: bigint;
|
|
106
|
+
denom: string;
|
|
107
|
+
amount: string;
|
|
108
|
+
}
|
|
109
|
+
export interface Health {
|
|
110
|
+
collateralValue: string;
|
|
111
|
+
borrowCapacity: string;
|
|
112
|
+
liquidationCollateralValue: string;
|
|
113
|
+
debtValue: string;
|
|
114
|
+
healthFactor: string;
|
|
115
|
+
}
|
|
116
|
+
export declare const Pool: MessageFns<Pool>;
|
|
117
|
+
export declare const PoolEntry: MessageFns<PoolEntry>;
|
|
118
|
+
export declare const PoolAction: MessageFns<PoolAction>;
|
|
119
|
+
export declare const Asset: MessageFns<Asset>;
|
|
120
|
+
export declare const AssetTerms: MessageFns<AssetTerms>;
|
|
121
|
+
export declare const AssetRisk: MessageFns<AssetRisk>;
|
|
122
|
+
export declare const AssetTermsConfig: MessageFns<AssetTermsConfig>;
|
|
123
|
+
export declare const AssetRiskConfig: MessageFns<AssetRiskConfig>;
|
|
124
|
+
export declare const AssetConfig: MessageFns<AssetConfig>;
|
|
125
|
+
export declare const AssetEntry: MessageFns<AssetEntry>;
|
|
126
|
+
export declare const PendingAssetUpdate: MessageFns<PendingAssetUpdate>;
|
|
127
|
+
export declare const PendingAssetUpdateEntry: MessageFns<PendingAssetUpdateEntry>;
|
|
128
|
+
export declare const AssetState: MessageFns<AssetState>;
|
|
129
|
+
export declare const AssetStateEntry: MessageFns<AssetStateEntry>;
|
|
130
|
+
export declare const Shares: MessageFns<Shares>;
|
|
131
|
+
export declare const SharesEntry: MessageFns<SharesEntry>;
|
|
132
|
+
export declare const DeficitEntry: MessageFns<DeficitEntry>;
|
|
133
|
+
export declare const Health: MessageFns<Health>;
|
|
134
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
135
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
136
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
137
|
+
} : Partial<T>;
|
|
138
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
139
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
140
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
141
|
+
} & {
|
|
142
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
143
|
+
};
|
|
144
|
+
export interface MessageFns<T> {
|
|
145
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
146
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
147
|
+
fromJSON(object: any): T;
|
|
148
|
+
toJSON(message: T): unknown;
|
|
149
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
150
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
151
|
+
}
|
|
152
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "ault.lending.v1";
|
|
3
|
+
export interface Params {
|
|
4
|
+
/** Maximum protocol fee rate configurable by a pool. */
|
|
5
|
+
maxProtocolFeeRate: string;
|
|
6
|
+
/** Maximum liquidation fee rate configurable for a pool. */
|
|
7
|
+
maxLiquidationFeeRate: string;
|
|
8
|
+
/** Delay before asset risk updates take effect. */
|
|
9
|
+
assetRiskUpdateDelay: bigint;
|
|
10
|
+
/** Minimum debt value that may remain after liquidation. */
|
|
11
|
+
minResidualDebtValue: string;
|
|
12
|
+
/** Maximum annualized borrow rate, in basis points. */
|
|
13
|
+
maxBorrowRate: string;
|
|
14
|
+
/** Share of protocol fees allocated to the insurance fund. */
|
|
15
|
+
insuranceFundAllocationRate: string;
|
|
16
|
+
/** Oracle checks applied when borrowing. */
|
|
17
|
+
borrowOracleChecks: number;
|
|
18
|
+
/** Oracle checks applied when withdrawing collateral. */
|
|
19
|
+
withdrawCollateralOracleChecks: number;
|
|
20
|
+
/** Oracle checks applied when liquidating. */
|
|
21
|
+
liquidationOracleChecks: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const Params: MessageFns<Params>;
|
|
24
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
25
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
26
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
27
|
+
} : Partial<T>;
|
|
28
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
29
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
30
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
31
|
+
} & {
|
|
32
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
33
|
+
};
|
|
34
|
+
export interface MessageFns<T> {
|
|
35
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
36
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
37
|
+
fromJSON(object: any): T;
|
|
38
|
+
toJSON(message: T): unknown;
|
|
39
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
40
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
41
|
+
}
|
|
42
|
+
export {};
|