Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/stable pool mgx 1307 #14

Open
wants to merge 95 commits into
base: eth-rollup-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
7371a07
chore: updated type definitions to new prerelease version
mangatafinance Nov 20, 2024
b3a738e
chore: updated to new prerelease version
mangatafinance Nov 20, 2024
51a88f0
chore: updated sdk to new prerelease version
mangatafinance Nov 20, 2024
7e70fb7
chore: update rpc types
dominikfedor Nov 20, 2024
6c88a58
chore: updated type definitions to new prerelease version
mangatafinance Nov 20, 2024
b6f4e34
chore: updated to new prerelease version
mangatafinance Nov 20, 2024
71aa19b
chore: updated sdk to new prerelease version
mangatafinance Nov 20, 2024
86bf4c8
chore: update types
dominikfedor Nov 20, 2024
d92159c
Merge branch 'feature/stable-pool-mgx-1307' of github.com:mangata-fin…
dominikfedor Nov 20, 2024
faac733
chore: updated type definitions to new prerelease version
mangatafinance Nov 20, 2024
fcbc2cc
chore: updated to new prerelease version
mangatafinance Nov 20, 2024
8999054
chore: updated sdk to new prerelease version
mangatafinance Nov 20, 2024
5960d81
chore: types
dominikfedor Nov 21, 2024
8e89bef
chore: updated type definitions to new prerelease version
mangatafinance Nov 21, 2024
4f115d9
chore: updated to new prerelease version
mangatafinance Nov 21, 2024
888c2b7
chore: updated sdk to new prerelease version
mangatafinance Nov 21, 2024
b16c3bc
chore: types
dominikfedor Nov 21, 2024
4536364
chore: types
dominikfedor Nov 21, 2024
97d43f3
chore: updated type definitions to new prerelease version
mangatafinance Nov 21, 2024
5b096fd
chore: updated to new prerelease version
mangatafinance Nov 21, 2024
8190205
chore: updated sdk to new prerelease version
mangatafinance Nov 21, 2024
d21614b
chore: updated type definitions to new prerelease version
mangatafinance Nov 21, 2024
3a72eff
chore: updated to new prerelease version
mangatafinance Nov 21, 2024
6706658
chore: updated sdk to new prerelease version
mangatafinance Nov 21, 2024
652d51b
chore: updated type definitions to new prerelease version
mangatafinance Nov 22, 2024
731fe8f
chore: updated to new prerelease version
mangatafinance Nov 22, 2024
47dd648
chore: updated sdk to new prerelease version
mangatafinance Nov 22, 2024
a57fa3e
chore: updated type definitions to new prerelease version
mangatafinance Nov 25, 2024
f9bbbc5
chore: updated to new prerelease version
mangatafinance Nov 25, 2024
371b735
chore: updated sdk to new prerelease version
mangatafinance Nov 25, 2024
531f820
chore: updated type definitions to new prerelease version
mangatafinance Nov 25, 2024
4eacfb2
chore: updated to new prerelease version
mangatafinance Nov 25, 2024
21544dd
chore: updated sdk to new prerelease version
mangatafinance Nov 25, 2024
ec9cc7e
chore: updated type definitions to new prerelease version
mangatafinance Nov 26, 2024
75c675a
chore: updated to new prerelease version
mangatafinance Nov 26, 2024
f0d3070
chore: updated sdk to new prerelease version
mangatafinance Nov 26, 2024
53db73a
chore: update rpc definitions
dominikfedor Nov 27, 2024
baea096
chore: update rpc definitions
dominikfedor Nov 27, 2024
c680c45
chore: updated type definitions to new prerelease version
mangatafinance Nov 27, 2024
9dbc193
chore: updated to new prerelease version
mangatafinance Nov 27, 2024
21df118
chore: updated sdk to new prerelease version
mangatafinance Nov 27, 2024
2199a20
chore: update new rpc pallet type definition exports
dominikfedor Nov 27, 2024
864b9f7
chore: updated type definitions to new prerelease version
mangatafinance Nov 27, 2024
643cd77
chore: updated to new prerelease version
mangatafinance Nov 27, 2024
67ffa50
chore: update types
dominikfedor Nov 29, 2024
779e458
chore: updated type definitions to new prerelease version
mangatafinance Nov 29, 2024
6acf0a1
chore: updated to new prerelease version
mangatafinance Nov 29, 2024
5d8c83d
chore: update types
dominikfedor Nov 29, 2024
2700d61
chore: updated type definitions to new prerelease version
mangatafinance Nov 29, 2024
0ee0c65
chore: updated to new prerelease version
mangatafinance Nov 29, 2024
bb8f636
chore: update types
dominikfedor Nov 29, 2024
56dfd90
chore: updated type definitions to new prerelease version
mangatafinance Nov 29, 2024
6c6e7ea
chore: updated to new prerelease version
mangatafinance Nov 29, 2024
eebcec3
chore: update types
dominikfedor Nov 29, 2024
4dd0f39
chore: updated type definitions to new prerelease version
mangatafinance Nov 29, 2024
09b595e
chore: updated to new prerelease version
mangatafinance Nov 29, 2024
2693585
chore: updated sdk to new prerelease version
mangatafinance Nov 29, 2024
c34eec3
chore: update types
dominikfedor Nov 29, 2024
d38b634
chore: updated type definitions to new prerelease version
mangatafinance Nov 29, 2024
4749160
chore: updated to new prerelease version
mangatafinance Nov 29, 2024
420aff5
chore: updated sdk to new prerelease version
mangatafinance Nov 29, 2024
19ed245
chore: update types
dominikfedor Nov 29, 2024
7ecde26
chore: updated type definitions to new prerelease version
mangatafinance Dec 2, 2024
35c09ad
chore: updated to new prerelease version
mangatafinance Dec 2, 2024
3fcdc48
chore: updated sdk to new prerelease version
mangatafinance Dec 2, 2024
8766fd8
chore: update types
dominikfedor Dec 2, 2024
842f4b6
chore: updated type definitions to new prerelease version
mangatafinance Dec 2, 2024
9451ef2
chore: updated to new prerelease version
mangatafinance Dec 2, 2024
f3a72e6
chore: updated sdk to new prerelease version
mangatafinance Dec 2, 2024
3419482
chore: update types
dominikfedor Dec 2, 2024
d53b6f6
chore: updated type definitions to new prerelease version
mangatafinance Dec 2, 2024
11c7466
chore: updated to new prerelease version
mangatafinance Dec 2, 2024
b09f357
chore: updated type definitions to new prerelease version
mangatafinance Dec 2, 2024
8620d5f
chore: updated to new prerelease version
mangatafinance Dec 2, 2024
d08005e
chore: update types
dominikfedor Dec 2, 2024
05dc3e2
chore: updated type definitions to new prerelease version
mangatafinance Dec 2, 2024
05d92b4
chore: updated to new prerelease version
mangatafinance Dec 2, 2024
7ba254d
chore: updated sdk to new prerelease version
mangatafinance Dec 2, 2024
41c7bc3
chore: export getPoolRatio
dominikfedor Dec 3, 2024
4d2102d
chore: updated type definitions to new prerelease version
mangatafinance Dec 3, 2024
17a6313
chore: updated to new prerelease version
mangatafinance Dec 3, 2024
020e5e7
chore: updated sdk to new prerelease version
mangatafinance Dec 3, 2024
f0c51dd
chore: types
dominikfedor Dec 4, 2024
8da2827
chore: updated type definitions to new prerelease version
mangatafinance Dec 4, 2024
8cb5464
chore: updated to new prerelease version
mangatafinance Dec 4, 2024
bc3787c
chore: updated sdk to new prerelease version
mangatafinance Dec 4, 2024
81bd549
chore: types
dominikfedor Dec 4, 2024
e231c84
chore: updated type definitions to new prerelease version
mangatafinance Dec 4, 2024
43f63a5
chore: updated to new prerelease version
mangatafinance Dec 4, 2024
e69a5f6
chore: updated sdk to new prerelease version
mangatafinance Dec 4, 2024
847a1a7
feat: remove polkadot.js from signing info
dominikfedor Dec 16, 2024
18a919f
chore: updated type definitions to new prerelease version
mangatafinance Dec 16, 2024
90acd98
chore: updated to new prerelease version
mangatafinance Dec 16, 2024
48c1014
chore: updated sdk to new prerelease version
mangatafinance Dec 16, 2024
3df9f75
Revert "feat: remove polkadot.js from signing info"
dominikfedor Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gasp-sdk",
"version": "0.0.2-eth-rollup-develop.61",
"version": "0.0.2-feature-stable-pool-mgx-1307.19",
"description": "GASP SDK",
"type": "module",
"module": "./index.js",
Expand All @@ -23,10 +23,10 @@
"@polkadot/api": "^11.1.1"
},
"devDependencies": {
"gasp-types": "0.0.2-eth-rollup-develop.61"
"gasp-types": "0.0.2-feature-stable-pool-mgx-1307.25"
},
"dependencies": {
"gasp-type-definitions": "0.0.2-eth-rollup-develop.63",
"gasp-type-definitions": "0.0.2-feature-stable-pool-mgx-1307.25",
"big.js": "6.2.1",
"tslib": "^2.3.0",
"tslog": "4.8.2",
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/src/mangata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import "gasp-types";
import { PriceImpact } from "./types/utility";
import { getPriceImpact } from "./utils/getPriceImpact";
import { createMangataInstance } from "./mangataInstance";
import { getRatio } from "./utils/getRatio";
import { BN } from "@polkadot/util";

const Mangata = {
instance: createMangataInstance,
getPriceImpact: (args: PriceImpact) => getPriceImpact(args)
getPriceImpact: (args: PriceImpact) => getPriceImpact(args),
getPoolRatio: (left: BN, right: BN) => getRatio(left, right)
};

export { Mangata };
2 changes: 1 addition & 1 deletion packages/type-definitions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gasp-type-definitions",
"version": "0.0.2-eth-rollup-develop.63",
"version": "0.0.2-feature-stable-pool-mgx-1307.25",
"description": "Type definitions for Gasp",
"repository": {
"type": "git",
Expand Down
156 changes: 153 additions & 3 deletions packages/type-definitions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ export const mTypes = {
requestId: "RequestId",
l2UpdatesToRemove: "Vec<u128>",
timeStamp: "U256"
}
},
PalletMarketPoolKind: {
_enum: ['Xyk', 'StableSwap']
},
RpcPoolInfo: {
poolId: "TokenId",
kind: "PalletMarketPoolKind",
lpTokenId: "TokenId",
assets: "Vec<TokenId>",
reserves: "Vec<Balance>"
},
};

export const mRpc = {
Expand Down Expand Up @@ -265,6 +275,146 @@ export const mRpc = {
type: "Vec<TokenId>"
}
},
market: {
calculate_buy_price: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "buy_asset_id",
type: "u32"
},
{
name: "buy_amount",
type: "u128"
}
],
type: "Option<u128>"
},
calculate_buy_price_with_impact: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "buy_asset_id",
type: "u32"
},
{
name: "buy_amount",
type: "u128"
}
],
type: "Option<(u128,u128)>"
},
calculate_expected_amount_for_minting: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "asset_id",
type: "u32"
},
{
name: "amount",
type: "u128"
}
],
type: "Option<u128>"
},
calculate_expected_lp_minted: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "amounts",
type: "(u128, u128)"
},
],
type: "Option<u128>"
},
calculate_sell_price: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "sell_asset_id",
type: "u32"
},
{
name: "sell_amount",
type: "u128"
}
],
type: "Option<u128>"
},
calculate_sell_price_with_impact: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "sell_asset_id",
type: "u32"
},
{
name: "sell_amount",
type: "u128"
}
],
type: "Option<(u128,u128)>"
},
get_pools: {
description: "",
params: [
{
name: "pool_id",
type: "Option<u32>"
},
],
type: "Vec<RpcPoolInfo>"
},
get_burn_amount: {
description: "",
params: [
{
name: "pool_id",
type: "u32"
},
{
name: "lp_burn_amount",
type: "u128"
},
],
type: "Option<(u128,u128)>"
},
get_tradeable_tokens: {
description: "",
params: [],
type: "Vec<RpcAssetMetadata>"
},
get_pools_for_trading: {
description: "",
params: [],
type: "Vec<u32>"
},
},
pos: {
calculate_native_rewards_amount: {
description: "Calculates amount of available native rewards",
Expand Down Expand Up @@ -396,7 +546,7 @@ export const mRpc = {
{
name: 'range',
type: '(u128, u128)',
},{
}, {
name: 'tx_id',
type: 'u128',
},
Expand Down Expand Up @@ -451,7 +601,7 @@ export const mRpc = {
],
type: "String"
}
}
},
};

export const mangataTypesBundleForPolkadotApps: OverrideBundleDefinition = {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/metadata.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gasp-types",
"version": "0.0.2-eth-rollup-develop.61",
"version": "0.0.2-feature-stable-pool-mgx-1307.25",
"description": "Polkadot.js type definitions for GASP Network",
"author": "Gasp <solutions@gasp.xyz>",
"repository": {
Expand Down
22 changes: 22 additions & 0 deletions packages/types/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,28 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
stableSwap: {
defaultApmCoeff: u128 & AugmentedConst<ApiType>;
/**
* Percentage of treasury fee that gets burned if possible.
**/
marketBnBFeePart: u128 & AugmentedConst<ApiType>;
/**
* Total fee applied to a swap.
* Part goes back to pool, part to treasury, and part is burned.
**/
marketTotalFee: u128 & AugmentedConst<ApiType>;
/**
* Percentage of total fee that goes into the treasury.
**/
marketTreasuryFeePart: u128 & AugmentedConst<ApiType>;
maxApmCoeff: u128 & AugmentedConst<ApiType>;
maxAssetsInPool: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: {
/**
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
Expand Down
Loading