@mercurial-finance/dynamic-amm-sdk
Version:
Mercurial Vaults SDK is a typescript library that allows you to interact with Mercurial v2's AMM.
112 lines • 5.93 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.U64_MAX = exports.METAPLEX_PROGRAM = exports.STABLE_SWAP_ALLOWED_TRADE_FEE_BPS = exports.STABLE_SWAP_DEFAULT_TRADE_FEE_BPS = exports.CONSTANT_PRODUCT_ALLOWED_TRADE_FEE_BPS = exports.CONSTANT_PRODUCT_DEFAULT_TRADE_FEE_BPS = exports.FEE_OWNER = exports.PERMISSIONLESS_AMP = exports.VIRTUAL_PRICE_PRECISION = exports.UNLOCK_AMOUNT_BUFFER = exports.DEFAULT_SLIPPAGE = exports.POOL_BASE_KEY = exports.VAULT_BASE_KEY = exports.SEEDS = exports.CURVE_TYPE_ACCOUNTS = exports.MAINNET_POOL = exports.DEVNET_POOL = exports.DEVNET_COIN = exports.STAGING_PROGRAM_ID = exports.PROGRAM_ID = exports.ERROR = void 0;
const spl_token_registry_1 = require("@solana/spl-token-registry");
const web3_js_1 = require("@solana/web3.js");
const bn_js_1 = require("bn.js");
exports.ERROR = {
POOL_NOT_LOAD: 'Pool not loaded',
INVALID_MINT: 'Invalid mint',
INVALID_ACCOUNT: 'Account not found',
};
exports.PROGRAM_ID = 'Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB';
exports.STAGING_PROGRAM_ID = 'ammbh4CQztZ6txJ8AaQgPsWjd6o7GhmvopS2JAo5bCB';
exports.DEVNET_COIN = [
{
chainId: spl_token_registry_1.ENV.Devnet,
address: 'So11111111111111111111111111111111111111112',
decimals: 9,
name: 'Wrapped SOL',
symbol: 'SOL',
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png',
extensions: {
coingeckoId: 'solana',
serumV3Usdc: '9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT',
serumV3Usdt: 'HWHvQhFmJB3NUcu1aihKmrKegfVxBEHzwVX6yZCKEsi1',
website: 'https://solana.com/',
},
},
{
chainId: spl_token_registry_1.ENV.Devnet,
address: 'zVzi5VAf4qMEwzv7NXECVx5v2pQ7xnqVVjCXZwS9XzA',
decimals: 6,
name: 'USD Coin',
symbol: 'USDC',
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',
extensions: {
coingeckoId: 'usd-coin',
serumV3Usdt: '77quYg4MGneUdjgXCunt9GgM1usmrxKY31twEy3WHwcS',
website: 'https://www.centre.io/',
},
},
{
chainId: spl_token_registry_1.ENV.Devnet,
address: '9NGDi2tZtNmCCp8SVLKNuGjuWAVwNF3Vap5tT8km5er9',
decimals: 9,
name: 'USDT',
symbol: 'USDT',
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB/logo.svg',
tags: ['stablecoin'],
extensions: {
coingeckoId: 'tether',
serumV3Usdc: '77quYg4MGneUdjgXCunt9GgM1usmrxKY31twEy3WHwcS',
website: 'https://tether.to/',
},
},
{
chainId: spl_token_registry_1.ENV.Devnet,
address: 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
decimals: 9,
symbol: 'mSOL',
name: 'Marinade staked SOL (mSOL)',
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So/logo.png',
extensions: {
coingeckoId: 'msol',
discord: 'https://discord.gg/mGqZA5pjRN',
github: 'https://github.com/marinade-finance',
medium: 'https://medium.com/marinade-finance',
serumV3Usdc: '6oGsL2puUgySccKzn9XA9afqF217LfxP5ocq4B3LWsjy',
serumV3Usdt: 'HxkQdUnrPdHwXP5T9kewEXs3ApgvbufuTfdw9v1nApFd',
twitter: 'https://twitter.com/MarinadeFinance',
website: 'https://marinade.finance',
},
},
];
exports.DEVNET_POOL = Object.freeze({
USDT_USDC: new web3_js_1.PublicKey('BAHscmu1NncGS7t4rc5gSBPv1UFEMkvLaon1Ahdd5rHi'),
USDT_SOL: new web3_js_1.PublicKey('Bgf1Sy5kfeDgib4go4NgzHuZwek8wE8NZus56z6uizzi'),
SOL_MSOL: new web3_js_1.PublicKey('2rkn2yM4wJcHPV57T8fPWeBksrfSpiNZoEjRgjtxNDEQ'),
});
exports.MAINNET_POOL = Object.freeze({
USDT_USDC: new web3_js_1.PublicKey('32D4zRxNc1EssbJieVHfPhZM3rH6CzfUPrWUuWxD9prG'),
USDC_SOL: new web3_js_1.PublicKey('5yuefgbJJpmFNK2iiYbLSpv1aZXq7F9AUKkZKErTYCvs'),
SOL_STSOL: new web3_js_1.PublicKey('7EJSgV2pthhDfb4UiER9vzTqe2eojei9GEQAQnkqJ96e'),
SOL_MSOL: new web3_js_1.PublicKey('HcjZvfeSNJbNkfLD4eEcRBr96AD3w1GpmMppaeRZf7ur'),
});
// Extra accounts for depeg pools. Might add more addresses in the future when more different types of pools are being added
exports.CURVE_TYPE_ACCOUNTS = {
// Stake account of Marinade finance. Used to retrieve mSol virtual price
marinade: new web3_js_1.PublicKey('8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC'),
// Stake account of Solana Lido. Used to retrieve stSol virtual price
lido: new web3_js_1.PublicKey('49Yi1TKkNyYjPAFdR9LBvoHcUjuPX4Df5T5yv39w2XTn'),
};
exports.SEEDS = Object.freeze({
APY: 'apy',
FEE: 'fee',
LP_MINT: 'lp_mint',
LOCK_ESCROW: 'lock_escrow',
});
exports.VAULT_BASE_KEY = new web3_js_1.PublicKey('HWzXGcGHy4tcpYfaRDCyLNzXqBTv3E6BttpCH2vJxArv');
exports.POOL_BASE_KEY = new web3_js_1.PublicKey('H9NnqW5Thn9dUzW3DRXe2xDhKjwZd4qbjngnZwEvnDuC');
exports.DEFAULT_SLIPPAGE = 1;
exports.UNLOCK_AMOUNT_BUFFER = 0.998;
exports.VIRTUAL_PRICE_PRECISION = new bn_js_1.BN(100_000_000);
exports.PERMISSIONLESS_AMP = new bn_js_1.BN(100);
exports.FEE_OWNER = new web3_js_1.PublicKey('6WaLrrRfReGKBYUSkmx2K6AuT21ida4j8at2SUiZdXu8');
exports.CONSTANT_PRODUCT_DEFAULT_TRADE_FEE_BPS = 25;
exports.CONSTANT_PRODUCT_ALLOWED_TRADE_FEE_BPS = [25, 100, 400, 600];
exports.STABLE_SWAP_DEFAULT_TRADE_FEE_BPS = 1;
exports.STABLE_SWAP_ALLOWED_TRADE_FEE_BPS = [1, 4, 10, 100];
exports.METAPLEX_PROGRAM = new web3_js_1.PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s');
exports.U64_MAX = new bn_js_1.BN('18446744073709551615'); // max amount in program side
//# sourceMappingURL=constants.js.map