@indigo-labs/indigo-sdk 0.3.8 → 0.3.10
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/dist/index.d.mts +192 -32
- package/dist/index.d.ts +192 -32
- package/dist/index.js +819 -242
- package/dist/index.mjs +707 -135
- package/package.json +1 -1
- package/src/contracts/cdp/helpers.ts +12 -0
- package/src/contracts/gov/transactions.ts +4 -4
- package/src/contracts/iasset/helpers.ts +1 -0
- package/src/contracts/price-oracle/types-new.ts +1 -1
- package/src/contracts/rob/helpers.ts +274 -196
- package/src/contracts/rob/transactions.ts +11 -5
- package/src/contracts/rob-leverage/helpers.ts +379 -371
- package/src/contracts/rob-leverage/transactions.ts +176 -104
- package/src/utils/utils.ts +0 -3
- package/tests/cdp/cdp-queries.ts +1 -1
- package/tests/endpoints/initialize.ts +14 -2
- package/tests/interest-collection/interest-collector-queries.ts +2 -1
- package/tests/queries/collector-queries.ts +2 -1
- package/tests/queries/poll-queries.ts +2 -1
- package/tests/queries/treasury-queries.ts +2 -1
- package/tests/rob/rob-leverage.test.ts +1646 -612
- package/tests/rob/rob.test.ts +35 -19
- package/tests/rob/transactions-mutated.ts +6 -4
package/dist/index.d.mts
CHANGED
|
@@ -784,6 +784,10 @@ declare function rationalMul(a: Rational, b: Rational): Rational;
|
|
|
784
784
|
declare function rationalDiv(a: Rational, b: Rational): Rational;
|
|
785
785
|
declare function rationalToFloat(a: Rational): number;
|
|
786
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Amount of iasset equal in value to the given number of collateral amount.
|
|
789
|
+
*/
|
|
790
|
+
declare function iassetValueOfCollateral(collateralAmt: bigint, oraclePrice: Rational): bigint;
|
|
787
791
|
/**
|
|
788
792
|
* This is mostly for debugging purposes.
|
|
789
793
|
*/
|
|
@@ -3009,9 +3013,65 @@ type RobOutput = {
|
|
|
3009
3013
|
utxo: UTxO;
|
|
3010
3014
|
};
|
|
3011
3015
|
|
|
3016
|
+
declare const OracleIdxSchema: TSchema.Union<[TSchema.Struct<{
|
|
3017
|
+
OracleRefInputIdx: TSchema.Integer;
|
|
3018
|
+
}>, TSchema.Struct<{
|
|
3019
|
+
OracleOutputIdx: TSchema.Integer;
|
|
3020
|
+
}>, TSchema.Literal<["OracleVoid"]>]>;
|
|
3021
|
+
type OracleIdx = typeof OracleIdxSchema.Type;
|
|
3022
|
+
declare const PriceOracleDatumSchema: TSchema.Struct<{
|
|
3023
|
+
price: TSchema.Struct<{
|
|
3024
|
+
numerator: TSchema.Integer;
|
|
3025
|
+
denominator: TSchema.Integer;
|
|
3026
|
+
}>;
|
|
3027
|
+
expirationTime: TSchema.Integer;
|
|
3028
|
+
auxiliaryData: Schema$1.SchemaClass<Data$1.Data, Data$1.Data, never>;
|
|
3029
|
+
}>;
|
|
3030
|
+
type PriceOracleDatum = typeof PriceOracleDatumSchema.Type;
|
|
3031
|
+
declare const PriceOracleRedeemerSchema: TSchema.Struct<{
|
|
3032
|
+
currentTime: TSchema.Integer;
|
|
3033
|
+
newPrice: TSchema.Struct<{
|
|
3034
|
+
numerator: TSchema.Integer;
|
|
3035
|
+
denominator: TSchema.Integer;
|
|
3036
|
+
}>;
|
|
3037
|
+
}>;
|
|
3038
|
+
type PriceOracleRedeemer = typeof PriceOracleRedeemerSchema.Type;
|
|
3039
|
+
declare function serialisePriceOracleRedeemer(r: PriceOracleRedeemer): string;
|
|
3040
|
+
declare function serialisePriceOracleDatum(d: PriceOracleDatum): string;
|
|
3041
|
+
declare function parsePriceOracleDatum(datum: string): PriceOracleDatum;
|
|
3042
|
+
|
|
3012
3043
|
declare const MIN_ROB_COLLATERAL_AMT = 3000000n;
|
|
3013
|
-
|
|
3014
|
-
|
|
3044
|
+
/**
|
|
3045
|
+
* The amount of collateral asset available in the ROB when buy order. In case of ADA, take
|
|
3046
|
+
* into account the min UTXO collateral.
|
|
3047
|
+
*/
|
|
3048
|
+
declare function robCollateralAmtToSpend(utxo: UTxO, datum: RobDatum): bigint;
|
|
3049
|
+
/**
|
|
3050
|
+
* The amount if iassets available in ROB when sell order.
|
|
3051
|
+
*/
|
|
3052
|
+
declare function robIAssetAmtToSpend(utxo: UTxO, datum: RobDatum, iassetCurrencySymbol: CurrencySymbolSP): bigint;
|
|
3053
|
+
/**
|
|
3054
|
+
* Amount to spend from the ROB universal for Buy and sell orders.
|
|
3055
|
+
*/
|
|
3056
|
+
declare function robAmtToSpend(utxo: UTxO, datum: RobDatum, iassetCurrencySymbol: CurrencySymbolSP): bigint;
|
|
3057
|
+
declare function robBuyOrderSummary(utxo: UTxO, datum: RobDatum, oraclePrice: Rational): {
|
|
3058
|
+
/**
|
|
3059
|
+
* The amount that can be spent from the ROB.
|
|
3060
|
+
*/
|
|
3061
|
+
redeemableCollateral: bigint;
|
|
3062
|
+
/**
|
|
3063
|
+
* The amount paid to the ROB when everything redeemed.
|
|
3064
|
+
*/
|
|
3065
|
+
payoutIAsset: bigint;
|
|
3066
|
+
};
|
|
3067
|
+
/**
|
|
3068
|
+
* In case it's applied to a sell order instead, it will throw an error.
|
|
3069
|
+
*/
|
|
3070
|
+
declare function isBuyOrderFullyRedeemed(utxo: UTxO, datum: RobDatum, oraclePrice: Rational): boolean;
|
|
3071
|
+
/**
|
|
3072
|
+
* Use the limit prices to decide fully redeemed.
|
|
3073
|
+
*/
|
|
3074
|
+
declare function isFullyRedeemed(utxo: UTxO, datum: RobDatum, iassetCurrencySymbol: CurrencySymbolSP): boolean;
|
|
3015
3075
|
/**
|
|
3016
3076
|
* Right now we allow multi redemptions when the collateral asset, iasset pair is the same.
|
|
3017
3077
|
* The on-chain however should allow even other combinations.
|
|
@@ -3025,7 +3085,25 @@ redemptions: [UTxO, bigint][], iasset: Uint8Array<ArrayBufferLike>, collateralAs
|
|
|
3025
3085
|
/**
|
|
3026
3086
|
* The number of Tx outputs before these new ones.
|
|
3027
3087
|
*/
|
|
3028
|
-
txOutputsBeforeCount: bigint, collateralAssetRefInputIdx: bigint, iassetRefInputIdx: bigint, oracleIdx:
|
|
3088
|
+
txOutputsBeforeCount: bigint, collateralAssetRefInputIdx: bigint, iassetRefInputIdx: bigint, oracleIdx: OracleIdx): TxBuilder;
|
|
3089
|
+
/**
|
|
3090
|
+
* Given all available LRP UTXOs, calculate total available collateral that can be redeemed.
|
|
3091
|
+
* Taking into account incorrectly initialised LRPs (without base collateral) and max number of ROBs.
|
|
3092
|
+
*/
|
|
3093
|
+
declare function calculateTotalCollateralForRedemption(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, iassetPrice: Rational, allRobs: [UTxO, RobDatum][],
|
|
3094
|
+
/**
|
|
3095
|
+
* How many LRPs can be redeemed in a single Tx.
|
|
3096
|
+
*/
|
|
3097
|
+
maxRobsInTx: number): bigint;
|
|
3098
|
+
/**
|
|
3099
|
+
* Pick random subset from all the ROBs (it does the necessary filtering) satisfying the target collateral to spend.
|
|
3100
|
+
* It's relevant for BUY orders only.
|
|
3101
|
+
*/
|
|
3102
|
+
declare function randomRobsSubsetSatisfyingTargetCollateral(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, targetCollateralToSpend: bigint, iassetPrice: Rational, allLrps: [UTxO, RobDatum][],
|
|
3103
|
+
/**
|
|
3104
|
+
* How many LRPs can be redeemed in a single Tx.
|
|
3105
|
+
*/
|
|
3106
|
+
maxLrpsInTx: number, randomiseFn?: (arr: [UTxO, RobDatum][]) => [UTxO, RobDatum][]): [UTxO, RobDatum][];
|
|
3029
3107
|
|
|
3030
3108
|
declare const RobParamsSchema: _lucid_evolution_lucid.TObject<{
|
|
3031
3109
|
versionRecordToken: _lucid_evolution_lucid.TObject<{
|
|
@@ -3092,35 +3170,118 @@ type OneShotParams = Data.Static<typeof OneShotParamsSchema>;
|
|
|
3092
3170
|
declare function oneShotMintTx(lucid: LucidEvolution, params: OneShotParams): Promise<[TxBuilder, PolicyId]>;
|
|
3093
3171
|
declare function runOneShotMintTx(lucid: LucidEvolution, params: OneShotParams): Promise<PolicyId>;
|
|
3094
3172
|
|
|
3095
|
-
declare function
|
|
3096
|
-
declare function feedPriceOracleTx(lucid: LucidEvolution, oracleOref: OutRef, newPrice: Rational, oracleParams: PriceOracleParams, currentSlot: number, auxiliaryData?: Core.Data.Data): Promise<TxBuilder>;
|
|
3173
|
+
declare function leverageCdpWithRob(leverage: number, baseCollateral: bigint, priceOracleOutRef: OutRef | undefined, iassetOutRef: OutRef, collateralAssetOutRef: OutRef, cdpCreatorOref: OutRef, interestOracleOref: OutRef, treasuryOref: OutRef, sysParams: SystemParams, lucid: LucidEvolution, allRobs: [UTxO, RobDatum][], currentSlot: number, pythMessage?: string | undefined, pythStateOref?: OutRef | undefined): Promise<TxBuilder>;
|
|
3097
3174
|
|
|
3098
|
-
declare const
|
|
3099
|
-
|
|
3100
|
-
}>, TSchema.Struct<{
|
|
3101
|
-
OracleOutputIdx: TSchema.Integer;
|
|
3102
|
-
}>, TSchema.Literal<["OracleVoid"]>]>;
|
|
3103
|
-
type OracleIdx = typeof OracleIdxSchema;
|
|
3104
|
-
declare const PriceOracleDatumSchema: TSchema.Struct<{
|
|
3105
|
-
price: TSchema.Struct<{
|
|
3106
|
-
numerator: TSchema.Integer;
|
|
3107
|
-
denominator: TSchema.Integer;
|
|
3108
|
-
}>;
|
|
3109
|
-
expirationTime: TSchema.Integer;
|
|
3110
|
-
auxiliaryData: Schema$1.SchemaClass<Data$1.Data, Data$1.Data, never>;
|
|
3175
|
+
declare const OnChainDecimalSchema: TSchema.Struct<{
|
|
3176
|
+
getOnChainInt: TSchema.Integer;
|
|
3111
3177
|
}>;
|
|
3112
|
-
type
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3178
|
+
type OnChainDecimal = typeof OnChainDecimalSchema.Type;
|
|
3179
|
+
|
|
3180
|
+
/**
|
|
3181
|
+
* The following is the math related to the leverage calculations.
|
|
3182
|
+
*
|
|
3183
|
+
* Leverage is the multiplier you apply to the base deposit and you get the amount of final collateral
|
|
3184
|
+
* the CDP should have. Additionally, the minted amount is used to pay for fees. The leverage a user picks, is
|
|
3185
|
+
* already taking into account the fees, i.e. the fees are paid from the borrowed assets.
|
|
3186
|
+
*
|
|
3187
|
+
* There's a direct relationship between collateral ratio and leverage multiplier. Each leverage multiplier
|
|
3188
|
+
* results in a single collateral ratio and vice versa. Maximum potential leverage is the leverage that
|
|
3189
|
+
* results in collateral ratio being the maintenance collateral ratio of the corresponding iAsset.
|
|
3190
|
+
*
|
|
3191
|
+
* `d` = base deposit
|
|
3192
|
+
* `b` = total borrowed value (including the fees)
|
|
3193
|
+
* `L` = leverage
|
|
3194
|
+
* `f_m` = debt minting fee
|
|
3195
|
+
* `f_r` = reimbursement fee
|
|
3196
|
+
* `c` = collateral ratio
|
|
3197
|
+
*
|
|
3198
|
+
* The following is a detailed derivation of the math:
|
|
3199
|
+
*
|
|
3200
|
+
* 1. Since the redemption fee is proportional to the borrowed amount,
|
|
3201
|
+
* we can express the ADA we get from the order book as `b'=b*(1-f_r)`,
|
|
3202
|
+
* since some of the borrowed amount goes back to the order book.
|
|
3203
|
+
*
|
|
3204
|
+
* 2. Since all the minted iAsset are used to get borrowed ADA,
|
|
3205
|
+
* the value of the minted asset will be `b`.
|
|
3206
|
+
*
|
|
3207
|
+
* 3. The minting fee is a percentage of the value of the minted iAsset.
|
|
3208
|
+
* Therefore the available ADA to add as collateral is `b''=b' - b*f_m = b*(1 - f_r - f_m)`.
|
|
3209
|
+
*
|
|
3210
|
+
* 4. The collateral ratio can now be expressed as `c = (d + b * (1 - f_r - f_m)) / b`.
|
|
3211
|
+
*
|
|
3212
|
+
* 5. Working out the expression, we can express `b` in terms of everything else: `b = d / (c - 1 + f_r + f_m)`.
|
|
3213
|
+
*
|
|
3214
|
+
* 6. The minted amount will be `b / asset_price`.
|
|
3215
|
+
*
|
|
3216
|
+
* 7. Collateral amount of the CDP is `d + b * (1 - f_r - f_m)`
|
|
3217
|
+
*
|
|
3218
|
+
* 8. Leverage calculation: `L = (d + b * (1 - f_r - f_m)) / d`.
|
|
3219
|
+
*
|
|
3220
|
+
* Plugging in the `b` formula we get: `L = (d + (d / (c - 1 + f_r + f_m)) * (1 - f_r - f_m)) / d`.
|
|
3221
|
+
*
|
|
3222
|
+
* Simplified, yields the following:
|
|
3223
|
+
* `L = 1 + ((1 - f_r - f_m) / (c - 1 + f_r + f_m))`
|
|
3224
|
+
*
|
|
3225
|
+
* 9. `b'' = b * (1 - f_r - f_m)`
|
|
3226
|
+
* Solved for `b` yields the following:
|
|
3227
|
+
* `b = b'' / (1 - f_r - f_m)`
|
|
3228
|
+
*
|
|
3229
|
+
* 10. Having leverage and base deposit, we can find `b''`:
|
|
3230
|
+
* `b’’ = d(L - 1)`
|
|
3231
|
+
*/
|
|
3232
|
+
|
|
3233
|
+
/**
|
|
3234
|
+
* How many LRP redemptions can we fit into a TX with CDP open.
|
|
3235
|
+
*/
|
|
3236
|
+
declare const MAX_REDEMPTIONS_WITH_CDP_OPEN = 4;
|
|
3237
|
+
type ROBRedemptionDetails = {
|
|
3238
|
+
utxo: UTxO;
|
|
3239
|
+
redeemedCollateral: bigint;
|
|
3240
|
+
/**
|
|
3241
|
+
* The amount of iAssets paid to ROB.
|
|
3242
|
+
*/
|
|
3243
|
+
iassetsPayoutAmt: bigint;
|
|
3244
|
+
reimbursementIAssetAmt: bigint;
|
|
3245
|
+
};
|
|
3246
|
+
type ApproximateLeverageRedemptionsResult = {
|
|
3247
|
+
leverage: number;
|
|
3248
|
+
collateralRatio: Rational;
|
|
3249
|
+
redeemedCollateral: bigint;
|
|
3250
|
+
};
|
|
3251
|
+
/**
|
|
3252
|
+
* We assume exact precision. However, actual redemptions include rounding and
|
|
3253
|
+
* the rounding behaviour changes based on the number of redemptions.
|
|
3254
|
+
* This may slightly tweak the numbers and the result can be different.
|
|
3255
|
+
*
|
|
3256
|
+
* The math is described at the top of this code file.
|
|
3257
|
+
*/
|
|
3258
|
+
declare function approximateLeverageRedemptions(baseCollateral: bigint, targetLeverage: number, redemptionReimbursementRatio: Rational, debtMintingFeeRatio: Rational): ApproximateLeverageRedemptionsResult;
|
|
3259
|
+
declare function summarizeActualLeverageRedemptions(lovelacesForRedemptionWithReimbursement: bigint, redemptionReimbursementRatio: Rational, iassetPrice: Rational, redemptionLrps: [UTxO, RobDatum][]): {
|
|
3260
|
+
redemptions: ROBRedemptionDetails[];
|
|
3261
|
+
/**
|
|
3262
|
+
* The actual amount received from redemptions (i.e. without the reimbursement fee).
|
|
3263
|
+
*/
|
|
3264
|
+
totalRedeemedCollateral: bigint;
|
|
3265
|
+
/**
|
|
3266
|
+
* Total amount of IAssets to cover the reimbursement fee.
|
|
3267
|
+
*/
|
|
3268
|
+
totalReimbursedIAsset: bigint;
|
|
3269
|
+
/**
|
|
3270
|
+
* Total amount of IAssets paid to ROBs, including the reimbursement.
|
|
3271
|
+
*/
|
|
3272
|
+
totalIAssetPayout: bigint;
|
|
3273
|
+
};
|
|
3274
|
+
/**
|
|
3275
|
+
* The math is described at the top of this code file.
|
|
3276
|
+
*/
|
|
3277
|
+
declare function calculateCollateralRatioFromLeverage(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, leverage: number, baseCollateral: bigint, iassetPrice: Rational, debtMintingFeePercentage: OnChainDecimal, redemptionReimbursementPercentage: OnChainDecimal, allLrps: [UTxO, RobDatum][]): OnChainDecimal | undefined;
|
|
3278
|
+
/**
|
|
3279
|
+
* The math is described at the top of this code file.
|
|
3280
|
+
*/
|
|
3281
|
+
declare function calculateLeverageFromCollateralRatio(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, collateralRatio: Rational, baseCollateral: bigint, iassetPrice: Rational, debtMintingFeeRatio: Rational, redemptionReimbursementRatio: Rational, allLrps: [UTxO, RobDatum][]): number | undefined;
|
|
3282
|
+
|
|
3283
|
+
declare function startPriceOracleTx(lucid: LucidEvolution, assetName: string, startPrice: Rational, oracleParams: PriceOracleParams, currentSlot: number, refOutRef?: OutRef, auxiliaryData?: Core.Data.Data): Promise<[TxBuilder, AssetClass]>;
|
|
3284
|
+
declare function feedPriceOracleTx(lucid: LucidEvolution, oracleOref: OutRef, newPrice: Rational, oracleParams: PriceOracleParams, currentSlot: number, auxiliaryData?: Core.Data.Data): Promise<TxBuilder>;
|
|
3124
3285
|
|
|
3125
3286
|
declare function mkPriceOracleValidator(params: PriceOracleParams): SpendingValidator;
|
|
3126
3287
|
|
|
@@ -3131,7 +3292,6 @@ declare function mkPriceOracleValidator(params: PriceOracleParams): SpendingVali
|
|
|
3131
3292
|
declare function matchSingle<T>(xs: T[], mkErr: (xs: T[]) => Error): T;
|
|
3132
3293
|
declare function loadSystemParamsFromFile(file: string): SystemParams;
|
|
3133
3294
|
declare function loadSystemParamsFromUrl(url: string): Promise<SystemParams>;
|
|
3134
|
-
declare const getRandomElement: <T>(arr: T[]) => T | undefined;
|
|
3135
3295
|
|
|
3136
3296
|
declare function shuffle<T>(arr: T[]): T[];
|
|
3137
3297
|
/**
|
|
@@ -3703,4 +3863,4 @@ declare function mkAuthTokenPolicy(ac: AssetClass, tn: string): MintingPolicy;
|
|
|
3703
3863
|
|
|
3704
3864
|
declare const alwaysFailValidator: SpendingValidator;
|
|
3705
3865
|
|
|
3706
|
-
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_E2S2S_ENTRIES_COUNT, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type ParsedOutput, PollManagerParams, type PollManagerParamsSP, PollShardParams, type PollShardParamsSP, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateIAssetRedemptionAmt, calculateMinCollateralCappedIAssetRedemptionAmt, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findRelevantE2s2sIdxs, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getRandomElement, getUpdatedAccountDeposit, handleOracleForCollateralAsset, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isFullyRedeemed, isSameEpochToScaleKey, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, partitionEpochToScaleToSums, processSpRequest, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, robAmountToSpend, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
|
3866
|
+
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_E2S2S_ENTRIES_COUNT, MAX_REDEMPTIONS_WITH_CDP_OPEN, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type ParsedOutput, PollManagerParams, type PollManagerParamsSP, PollShardParams, type PollShardParamsSP, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, approximateLeverageRedemptions, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateCollateralRatioFromLeverage, calculateIAssetRedemptionAmt, calculateLeverageFromCollateralRatio, calculateMinCollateralCappedIAssetRedemptionAmt, calculateTotalCollateralForRedemption, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findRelevantE2s2sIdxs, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getUpdatedAccountDeposit, handleOracleForCollateralAsset, iassetValueOfCollateral, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isBuyOrderFullyRedeemed, isFullyRedeemed, isSameEpochToScaleKey, leverageCdpWithRob, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, partitionEpochToScaleToSums, processSpRequest, randomRobsSubsetSatisfyingTargetCollateral, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, robAmtToSpend, robBuyOrderSummary, robCollateralAmtToSpend, robIAssetAmtToSpend, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, summarizeActualLeverageRedemptions, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
package/dist/index.d.ts
CHANGED
|
@@ -784,6 +784,10 @@ declare function rationalMul(a: Rational, b: Rational): Rational;
|
|
|
784
784
|
declare function rationalDiv(a: Rational, b: Rational): Rational;
|
|
785
785
|
declare function rationalToFloat(a: Rational): number;
|
|
786
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Amount of iasset equal in value to the given number of collateral amount.
|
|
789
|
+
*/
|
|
790
|
+
declare function iassetValueOfCollateral(collateralAmt: bigint, oraclePrice: Rational): bigint;
|
|
787
791
|
/**
|
|
788
792
|
* This is mostly for debugging purposes.
|
|
789
793
|
*/
|
|
@@ -3009,9 +3013,65 @@ type RobOutput = {
|
|
|
3009
3013
|
utxo: UTxO;
|
|
3010
3014
|
};
|
|
3011
3015
|
|
|
3016
|
+
declare const OracleIdxSchema: TSchema.Union<[TSchema.Struct<{
|
|
3017
|
+
OracleRefInputIdx: TSchema.Integer;
|
|
3018
|
+
}>, TSchema.Struct<{
|
|
3019
|
+
OracleOutputIdx: TSchema.Integer;
|
|
3020
|
+
}>, TSchema.Literal<["OracleVoid"]>]>;
|
|
3021
|
+
type OracleIdx = typeof OracleIdxSchema.Type;
|
|
3022
|
+
declare const PriceOracleDatumSchema: TSchema.Struct<{
|
|
3023
|
+
price: TSchema.Struct<{
|
|
3024
|
+
numerator: TSchema.Integer;
|
|
3025
|
+
denominator: TSchema.Integer;
|
|
3026
|
+
}>;
|
|
3027
|
+
expirationTime: TSchema.Integer;
|
|
3028
|
+
auxiliaryData: Schema$1.SchemaClass<Data$1.Data, Data$1.Data, never>;
|
|
3029
|
+
}>;
|
|
3030
|
+
type PriceOracleDatum = typeof PriceOracleDatumSchema.Type;
|
|
3031
|
+
declare const PriceOracleRedeemerSchema: TSchema.Struct<{
|
|
3032
|
+
currentTime: TSchema.Integer;
|
|
3033
|
+
newPrice: TSchema.Struct<{
|
|
3034
|
+
numerator: TSchema.Integer;
|
|
3035
|
+
denominator: TSchema.Integer;
|
|
3036
|
+
}>;
|
|
3037
|
+
}>;
|
|
3038
|
+
type PriceOracleRedeemer = typeof PriceOracleRedeemerSchema.Type;
|
|
3039
|
+
declare function serialisePriceOracleRedeemer(r: PriceOracleRedeemer): string;
|
|
3040
|
+
declare function serialisePriceOracleDatum(d: PriceOracleDatum): string;
|
|
3041
|
+
declare function parsePriceOracleDatum(datum: string): PriceOracleDatum;
|
|
3042
|
+
|
|
3012
3043
|
declare const MIN_ROB_COLLATERAL_AMT = 3000000n;
|
|
3013
|
-
|
|
3014
|
-
|
|
3044
|
+
/**
|
|
3045
|
+
* The amount of collateral asset available in the ROB when buy order. In case of ADA, take
|
|
3046
|
+
* into account the min UTXO collateral.
|
|
3047
|
+
*/
|
|
3048
|
+
declare function robCollateralAmtToSpend(utxo: UTxO, datum: RobDatum): bigint;
|
|
3049
|
+
/**
|
|
3050
|
+
* The amount if iassets available in ROB when sell order.
|
|
3051
|
+
*/
|
|
3052
|
+
declare function robIAssetAmtToSpend(utxo: UTxO, datum: RobDatum, iassetCurrencySymbol: CurrencySymbolSP): bigint;
|
|
3053
|
+
/**
|
|
3054
|
+
* Amount to spend from the ROB universal for Buy and sell orders.
|
|
3055
|
+
*/
|
|
3056
|
+
declare function robAmtToSpend(utxo: UTxO, datum: RobDatum, iassetCurrencySymbol: CurrencySymbolSP): bigint;
|
|
3057
|
+
declare function robBuyOrderSummary(utxo: UTxO, datum: RobDatum, oraclePrice: Rational): {
|
|
3058
|
+
/**
|
|
3059
|
+
* The amount that can be spent from the ROB.
|
|
3060
|
+
*/
|
|
3061
|
+
redeemableCollateral: bigint;
|
|
3062
|
+
/**
|
|
3063
|
+
* The amount paid to the ROB when everything redeemed.
|
|
3064
|
+
*/
|
|
3065
|
+
payoutIAsset: bigint;
|
|
3066
|
+
};
|
|
3067
|
+
/**
|
|
3068
|
+
* In case it's applied to a sell order instead, it will throw an error.
|
|
3069
|
+
*/
|
|
3070
|
+
declare function isBuyOrderFullyRedeemed(utxo: UTxO, datum: RobDatum, oraclePrice: Rational): boolean;
|
|
3071
|
+
/**
|
|
3072
|
+
* Use the limit prices to decide fully redeemed.
|
|
3073
|
+
*/
|
|
3074
|
+
declare function isFullyRedeemed(utxo: UTxO, datum: RobDatum, iassetCurrencySymbol: CurrencySymbolSP): boolean;
|
|
3015
3075
|
/**
|
|
3016
3076
|
* Right now we allow multi redemptions when the collateral asset, iasset pair is the same.
|
|
3017
3077
|
* The on-chain however should allow even other combinations.
|
|
@@ -3025,7 +3085,25 @@ redemptions: [UTxO, bigint][], iasset: Uint8Array<ArrayBufferLike>, collateralAs
|
|
|
3025
3085
|
/**
|
|
3026
3086
|
* The number of Tx outputs before these new ones.
|
|
3027
3087
|
*/
|
|
3028
|
-
txOutputsBeforeCount: bigint, collateralAssetRefInputIdx: bigint, iassetRefInputIdx: bigint, oracleIdx:
|
|
3088
|
+
txOutputsBeforeCount: bigint, collateralAssetRefInputIdx: bigint, iassetRefInputIdx: bigint, oracleIdx: OracleIdx): TxBuilder;
|
|
3089
|
+
/**
|
|
3090
|
+
* Given all available LRP UTXOs, calculate total available collateral that can be redeemed.
|
|
3091
|
+
* Taking into account incorrectly initialised LRPs (without base collateral) and max number of ROBs.
|
|
3092
|
+
*/
|
|
3093
|
+
declare function calculateTotalCollateralForRedemption(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, iassetPrice: Rational, allRobs: [UTxO, RobDatum][],
|
|
3094
|
+
/**
|
|
3095
|
+
* How many LRPs can be redeemed in a single Tx.
|
|
3096
|
+
*/
|
|
3097
|
+
maxRobsInTx: number): bigint;
|
|
3098
|
+
/**
|
|
3099
|
+
* Pick random subset from all the ROBs (it does the necessary filtering) satisfying the target collateral to spend.
|
|
3100
|
+
* It's relevant for BUY orders only.
|
|
3101
|
+
*/
|
|
3102
|
+
declare function randomRobsSubsetSatisfyingTargetCollateral(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, targetCollateralToSpend: bigint, iassetPrice: Rational, allLrps: [UTxO, RobDatum][],
|
|
3103
|
+
/**
|
|
3104
|
+
* How many LRPs can be redeemed in a single Tx.
|
|
3105
|
+
*/
|
|
3106
|
+
maxLrpsInTx: number, randomiseFn?: (arr: [UTxO, RobDatum][]) => [UTxO, RobDatum][]): [UTxO, RobDatum][];
|
|
3029
3107
|
|
|
3030
3108
|
declare const RobParamsSchema: _lucid_evolution_lucid.TObject<{
|
|
3031
3109
|
versionRecordToken: _lucid_evolution_lucid.TObject<{
|
|
@@ -3092,35 +3170,118 @@ type OneShotParams = Data.Static<typeof OneShotParamsSchema>;
|
|
|
3092
3170
|
declare function oneShotMintTx(lucid: LucidEvolution, params: OneShotParams): Promise<[TxBuilder, PolicyId]>;
|
|
3093
3171
|
declare function runOneShotMintTx(lucid: LucidEvolution, params: OneShotParams): Promise<PolicyId>;
|
|
3094
3172
|
|
|
3095
|
-
declare function
|
|
3096
|
-
declare function feedPriceOracleTx(lucid: LucidEvolution, oracleOref: OutRef, newPrice: Rational, oracleParams: PriceOracleParams, currentSlot: number, auxiliaryData?: Core.Data.Data): Promise<TxBuilder>;
|
|
3173
|
+
declare function leverageCdpWithRob(leverage: number, baseCollateral: bigint, priceOracleOutRef: OutRef | undefined, iassetOutRef: OutRef, collateralAssetOutRef: OutRef, cdpCreatorOref: OutRef, interestOracleOref: OutRef, treasuryOref: OutRef, sysParams: SystemParams, lucid: LucidEvolution, allRobs: [UTxO, RobDatum][], currentSlot: number, pythMessage?: string | undefined, pythStateOref?: OutRef | undefined): Promise<TxBuilder>;
|
|
3097
3174
|
|
|
3098
|
-
declare const
|
|
3099
|
-
|
|
3100
|
-
}>, TSchema.Struct<{
|
|
3101
|
-
OracleOutputIdx: TSchema.Integer;
|
|
3102
|
-
}>, TSchema.Literal<["OracleVoid"]>]>;
|
|
3103
|
-
type OracleIdx = typeof OracleIdxSchema;
|
|
3104
|
-
declare const PriceOracleDatumSchema: TSchema.Struct<{
|
|
3105
|
-
price: TSchema.Struct<{
|
|
3106
|
-
numerator: TSchema.Integer;
|
|
3107
|
-
denominator: TSchema.Integer;
|
|
3108
|
-
}>;
|
|
3109
|
-
expirationTime: TSchema.Integer;
|
|
3110
|
-
auxiliaryData: Schema$1.SchemaClass<Data$1.Data, Data$1.Data, never>;
|
|
3175
|
+
declare const OnChainDecimalSchema: TSchema.Struct<{
|
|
3176
|
+
getOnChainInt: TSchema.Integer;
|
|
3111
3177
|
}>;
|
|
3112
|
-
type
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3178
|
+
type OnChainDecimal = typeof OnChainDecimalSchema.Type;
|
|
3179
|
+
|
|
3180
|
+
/**
|
|
3181
|
+
* The following is the math related to the leverage calculations.
|
|
3182
|
+
*
|
|
3183
|
+
* Leverage is the multiplier you apply to the base deposit and you get the amount of final collateral
|
|
3184
|
+
* the CDP should have. Additionally, the minted amount is used to pay for fees. The leverage a user picks, is
|
|
3185
|
+
* already taking into account the fees, i.e. the fees are paid from the borrowed assets.
|
|
3186
|
+
*
|
|
3187
|
+
* There's a direct relationship between collateral ratio and leverage multiplier. Each leverage multiplier
|
|
3188
|
+
* results in a single collateral ratio and vice versa. Maximum potential leverage is the leverage that
|
|
3189
|
+
* results in collateral ratio being the maintenance collateral ratio of the corresponding iAsset.
|
|
3190
|
+
*
|
|
3191
|
+
* `d` = base deposit
|
|
3192
|
+
* `b` = total borrowed value (including the fees)
|
|
3193
|
+
* `L` = leverage
|
|
3194
|
+
* `f_m` = debt minting fee
|
|
3195
|
+
* `f_r` = reimbursement fee
|
|
3196
|
+
* `c` = collateral ratio
|
|
3197
|
+
*
|
|
3198
|
+
* The following is a detailed derivation of the math:
|
|
3199
|
+
*
|
|
3200
|
+
* 1. Since the redemption fee is proportional to the borrowed amount,
|
|
3201
|
+
* we can express the ADA we get from the order book as `b'=b*(1-f_r)`,
|
|
3202
|
+
* since some of the borrowed amount goes back to the order book.
|
|
3203
|
+
*
|
|
3204
|
+
* 2. Since all the minted iAsset are used to get borrowed ADA,
|
|
3205
|
+
* the value of the minted asset will be `b`.
|
|
3206
|
+
*
|
|
3207
|
+
* 3. The minting fee is a percentage of the value of the minted iAsset.
|
|
3208
|
+
* Therefore the available ADA to add as collateral is `b''=b' - b*f_m = b*(1 - f_r - f_m)`.
|
|
3209
|
+
*
|
|
3210
|
+
* 4. The collateral ratio can now be expressed as `c = (d + b * (1 - f_r - f_m)) / b`.
|
|
3211
|
+
*
|
|
3212
|
+
* 5. Working out the expression, we can express `b` in terms of everything else: `b = d / (c - 1 + f_r + f_m)`.
|
|
3213
|
+
*
|
|
3214
|
+
* 6. The minted amount will be `b / asset_price`.
|
|
3215
|
+
*
|
|
3216
|
+
* 7. Collateral amount of the CDP is `d + b * (1 - f_r - f_m)`
|
|
3217
|
+
*
|
|
3218
|
+
* 8. Leverage calculation: `L = (d + b * (1 - f_r - f_m)) / d`.
|
|
3219
|
+
*
|
|
3220
|
+
* Plugging in the `b` formula we get: `L = (d + (d / (c - 1 + f_r + f_m)) * (1 - f_r - f_m)) / d`.
|
|
3221
|
+
*
|
|
3222
|
+
* Simplified, yields the following:
|
|
3223
|
+
* `L = 1 + ((1 - f_r - f_m) / (c - 1 + f_r + f_m))`
|
|
3224
|
+
*
|
|
3225
|
+
* 9. `b'' = b * (1 - f_r - f_m)`
|
|
3226
|
+
* Solved for `b` yields the following:
|
|
3227
|
+
* `b = b'' / (1 - f_r - f_m)`
|
|
3228
|
+
*
|
|
3229
|
+
* 10. Having leverage and base deposit, we can find `b''`:
|
|
3230
|
+
* `b’’ = d(L - 1)`
|
|
3231
|
+
*/
|
|
3232
|
+
|
|
3233
|
+
/**
|
|
3234
|
+
* How many LRP redemptions can we fit into a TX with CDP open.
|
|
3235
|
+
*/
|
|
3236
|
+
declare const MAX_REDEMPTIONS_WITH_CDP_OPEN = 4;
|
|
3237
|
+
type ROBRedemptionDetails = {
|
|
3238
|
+
utxo: UTxO;
|
|
3239
|
+
redeemedCollateral: bigint;
|
|
3240
|
+
/**
|
|
3241
|
+
* The amount of iAssets paid to ROB.
|
|
3242
|
+
*/
|
|
3243
|
+
iassetsPayoutAmt: bigint;
|
|
3244
|
+
reimbursementIAssetAmt: bigint;
|
|
3245
|
+
};
|
|
3246
|
+
type ApproximateLeverageRedemptionsResult = {
|
|
3247
|
+
leverage: number;
|
|
3248
|
+
collateralRatio: Rational;
|
|
3249
|
+
redeemedCollateral: bigint;
|
|
3250
|
+
};
|
|
3251
|
+
/**
|
|
3252
|
+
* We assume exact precision. However, actual redemptions include rounding and
|
|
3253
|
+
* the rounding behaviour changes based on the number of redemptions.
|
|
3254
|
+
* This may slightly tweak the numbers and the result can be different.
|
|
3255
|
+
*
|
|
3256
|
+
* The math is described at the top of this code file.
|
|
3257
|
+
*/
|
|
3258
|
+
declare function approximateLeverageRedemptions(baseCollateral: bigint, targetLeverage: number, redemptionReimbursementRatio: Rational, debtMintingFeeRatio: Rational): ApproximateLeverageRedemptionsResult;
|
|
3259
|
+
declare function summarizeActualLeverageRedemptions(lovelacesForRedemptionWithReimbursement: bigint, redemptionReimbursementRatio: Rational, iassetPrice: Rational, redemptionLrps: [UTxO, RobDatum][]): {
|
|
3260
|
+
redemptions: ROBRedemptionDetails[];
|
|
3261
|
+
/**
|
|
3262
|
+
* The actual amount received from redemptions (i.e. without the reimbursement fee).
|
|
3263
|
+
*/
|
|
3264
|
+
totalRedeemedCollateral: bigint;
|
|
3265
|
+
/**
|
|
3266
|
+
* Total amount of IAssets to cover the reimbursement fee.
|
|
3267
|
+
*/
|
|
3268
|
+
totalReimbursedIAsset: bigint;
|
|
3269
|
+
/**
|
|
3270
|
+
* Total amount of IAssets paid to ROBs, including the reimbursement.
|
|
3271
|
+
*/
|
|
3272
|
+
totalIAssetPayout: bigint;
|
|
3273
|
+
};
|
|
3274
|
+
/**
|
|
3275
|
+
* The math is described at the top of this code file.
|
|
3276
|
+
*/
|
|
3277
|
+
declare function calculateCollateralRatioFromLeverage(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, leverage: number, baseCollateral: bigint, iassetPrice: Rational, debtMintingFeePercentage: OnChainDecimal, redemptionReimbursementPercentage: OnChainDecimal, allLrps: [UTxO, RobDatum][]): OnChainDecimal | undefined;
|
|
3278
|
+
/**
|
|
3279
|
+
* The math is described at the top of this code file.
|
|
3280
|
+
*/
|
|
3281
|
+
declare function calculateLeverageFromCollateralRatio(iasset: Uint8Array<ArrayBufferLike>, collateralAsset: AssetClass, collateralRatio: Rational, baseCollateral: bigint, iassetPrice: Rational, debtMintingFeeRatio: Rational, redemptionReimbursementRatio: Rational, allLrps: [UTxO, RobDatum][]): number | undefined;
|
|
3282
|
+
|
|
3283
|
+
declare function startPriceOracleTx(lucid: LucidEvolution, assetName: string, startPrice: Rational, oracleParams: PriceOracleParams, currentSlot: number, refOutRef?: OutRef, auxiliaryData?: Core.Data.Data): Promise<[TxBuilder, AssetClass]>;
|
|
3284
|
+
declare function feedPriceOracleTx(lucid: LucidEvolution, oracleOref: OutRef, newPrice: Rational, oracleParams: PriceOracleParams, currentSlot: number, auxiliaryData?: Core.Data.Data): Promise<TxBuilder>;
|
|
3124
3285
|
|
|
3125
3286
|
declare function mkPriceOracleValidator(params: PriceOracleParams): SpendingValidator;
|
|
3126
3287
|
|
|
@@ -3131,7 +3292,6 @@ declare function mkPriceOracleValidator(params: PriceOracleParams): SpendingVali
|
|
|
3131
3292
|
declare function matchSingle<T>(xs: T[], mkErr: (xs: T[]) => Error): T;
|
|
3132
3293
|
declare function loadSystemParamsFromFile(file: string): SystemParams;
|
|
3133
3294
|
declare function loadSystemParamsFromUrl(url: string): Promise<SystemParams>;
|
|
3134
|
-
declare const getRandomElement: <T>(arr: T[]) => T | undefined;
|
|
3135
3295
|
|
|
3136
3296
|
declare function shuffle<T>(arr: T[]): T[];
|
|
3137
3297
|
/**
|
|
@@ -3703,4 +3863,4 @@ declare function mkAuthTokenPolicy(ac: AssetClass, tn: string): MintingPolicy;
|
|
|
3703
3863
|
|
|
3704
3864
|
declare const alwaysFailValidator: SpendingValidator;
|
|
3705
3865
|
|
|
3706
|
-
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_E2S2S_ENTRIES_COUNT, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type ParsedOutput, PollManagerParams, type PollManagerParamsSP, PollShardParams, type PollShardParamsSP, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateIAssetRedemptionAmt, calculateMinCollateralCappedIAssetRedemptionAmt, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findRelevantE2s2sIdxs, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getRandomElement, getUpdatedAccountDeposit, handleOracleForCollateralAsset, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isFullyRedeemed, isSameEpochToScaleKey, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, partitionEpochToScaleToSums, processSpRequest, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, robAmountToSpend, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
|
3866
|
+
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_E2S2S_ENTRIES_COUNT, MAX_REDEMPTIONS_WITH_CDP_OPEN, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type ParsedOutput, PollManagerParams, type PollManagerParamsSP, PollShardParams, type PollShardParamsSP, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, approximateLeverageRedemptions, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateCollateralRatioFromLeverage, calculateIAssetRedemptionAmt, calculateLeverageFromCollateralRatio, calculateMinCollateralCappedIAssetRedemptionAmt, calculateTotalCollateralForRedemption, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findRelevantE2s2sIdxs, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getUpdatedAccountDeposit, handleOracleForCollateralAsset, iassetValueOfCollateral, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isBuyOrderFullyRedeemed, isFullyRedeemed, isSameEpochToScaleKey, leverageCdpWithRob, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, partitionEpochToScaleToSums, processSpRequest, randomRobsSubsetSatisfyingTargetCollateral, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, robAmtToSpend, robBuyOrderSummary, robCollateralAmtToSpend, robIAssetAmtToSpend, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, summarizeActualLeverageRedemptions, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|