diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 8792880e8..77664d588 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,24 @@ # @convergence-rfq/cli +## 6.6.1 + +### Patch Changes + +- Add clear cache before finding a vacant base asset index +- Updated dependencies + - @convergence-rfq/sdk@6.6.1 + +## 6.6.0 + +### Minor Changes + +- Add user asset functionality, remove duplicated operation to change the existing base asset, add logic to automatically find a vacant base asset index + +### Patch Changes + +- Updated dependencies + - @convergence-rfq/sdk@6.6.0 + ## 6.5.0 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 31d79d482..23f6ba8a3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@convergence-rfq/cli", "description": "Official Convergence CLI", - "version": "6.5.0", + "version": "6.6.1", "license": "MIT", "publishConfig": { "access": "public" @@ -47,7 +47,7 @@ "cli": "ts-node src/index.ts" }, "dependencies": { - "@convergence-rfq/sdk": "6.5.0", + "@convergence-rfq/sdk": "6.6.1", "@solana/web3.js": "^1.87.6", "@types/cookie": "^0.5.1", "commander": "^10.0.0" diff --git a/packages/cli/scripts/bootstrap.sh b/packages/cli/scripts/bootstrap.sh index 41186e487..fa6d70d5f 100755 --- a/packages/cli/scripts/bootstrap.sh +++ b/packages/cli/scripts/bootstrap.sh @@ -52,8 +52,8 @@ convergence risk-engine set-risk-categories-info --new-value="0.05,1.2,0.06,0.6, convergence risk-engine set-risk-categories-info --new-value="0.05,2.4,0.08,0.8,0.16,1.2,0.32,1.6,0.48,2.0,0.8,2.4,1.2,2.8" --category=high --rpc-endpoint=$RPC_ENDPOINT convergence risk-engine set-risk-categories-info --new-value="0.05,5.0,0.10,1.0,0.20,1.5,0.40,2.0,0.60,2.5,1.0,3.0,1.5,3.5" --category=very-high --rpc-endpoint=$RPC_ENDPOINT -convergence protocol add-base-asset --ticker=BTC --oracle-address=$BTC_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT -convergence protocol add-base-asset --ticker=SOL --oracle-address=$SOL_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT +convergence protocol add-base-asset --index=0 --ticker=BTC --oracle-address=$BTC_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT +convergence protocol add-base-asset --index=1 --ticker=SOL --oracle-address=$SOL_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT convergence protocol register-mint --mint=$BTC_MINT --base-asset-index=0 --rpc-endpoint=$RPC_ENDPOINT convergence protocol register-mint --mint=$SOL_MINT --base-asset-index=1 --rpc-endpoint=$RPC_ENDPOINT diff --git a/packages/cli/src/actions.ts b/packages/cli/src/actions.ts index f738a4c7d..75b8b4183 100644 --- a/packages/cli/src/actions.ts +++ b/packages/cli/src/actions.ts @@ -2,7 +2,6 @@ import { PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js'; import { token, devnetAirdrops, - PriceOracle, SpotLegInstrument, SpotQuoteInstrument, isRiskCategory, @@ -116,6 +115,7 @@ export const initializeProtocol = async (opts: Opts) => { protocolMakerFee: opts.protocolMakerFee, settlementTakerFee: opts.settlementTakerFee, settlementMakerFee: opts.settlementMakerFee, + addAssetFee: Number(opts.addAssetFee), }), opts ); @@ -176,31 +176,16 @@ export const addPrintTradeProvider = async (opts: Opts) => { export const addBaseAsset = async (opts: Opts) => { const cvg = await createCvg(opts); try { - const baseAssets = await expirationRetry( - () => cvg.protocol().getBaseAssets(), - opts - ); - const { oracleSource } = opts; - - let priceOracle: PriceOracle; - if (oracleSource === 'in-place') { - priceOracle = { - source: 'in-place', - price: opts.oraclePrice, - }; - } else { - priceOracle = { - source: oracleSource, - address: new PublicKey(opts.oracleAddress), - }; - } - const { response } = await cvg.protocol().addBaseAsset({ authority: cvg.rpc().getDefaultFeePayer(), - index: baseAssets.length, + index: opts.index && Number(opts.index), ticker: opts.ticker, riskCategory: opts.riskCategory, - priceOracle, + oracleSource: opts.oracleSource, + inPlacePrice: opts.inPlacePrice && Number(opts.inPlacePrice), + pythOracle: opts.pythAddress && new PublicKey(opts.pythAddress), + switchboardOracle: + opts.switchboardAddress && new PublicKey(opts.switchboardAddress), }); logResponse(response); } catch (e) { @@ -219,29 +204,32 @@ export const changeBaseAssetParameters = async (opts: Opts) => { switchboardOracle: switchboardOracleOpts, pythOracle: pythOracleOpts, inPlacePrice: inPlacePriceOpts, + strict: strictOpts, }: { - index: number; + index: string; enabled?: string; riskCategory?: string; oracleSource?: string; switchboardOracle?: string; pythOracle?: string; - inPlacePrice?: number; + inPlacePrice?: string; + strict?: string; } = opts; - let enabled; - switch (enabledOpts) { - case undefined: - break; - case 'true': - enabled = true; - break; - case 'false': - enabled = false; - break; - default: - throw new Error('Unrecognized enabled parameter!'); - } + const parseBool = (value: string | undefined, name: string) => { + switch (value) { + case undefined: + return undefined; + case 'true': + return true; + case 'false': + return false; + default: + throw new Error(`Unrecognized ${name} parameter!`); + } + }; + const enabled = parseBool(enabledOpts, 'enabled'); + const strict = parseBool(strictOpts, 'strict'); if (riskCategory !== undefined && !isRiskCategory(riskCategory)) { throw new Error('Unrecognized risk category parameter!'); @@ -266,55 +254,22 @@ export const changeBaseAssetParameters = async (opts: Opts) => { } let inPlacePrice; - if (inPlacePriceOpts === -1) { - inPlacePrice = null; - } else if (typeof inPlacePriceOpts === 'number') { - inPlacePrice = inPlacePriceOpts; + if (inPlacePriceOpts !== undefined) { + inPlacePrice = Number(inPlacePriceOpts); + if (inPlacePrice === -1) { + inPlacePrice = null; + } } const { response } = await cvg.protocol().changeBaseAssetParameters({ - index, + index: Number(index), enabled, riskCategory, oracleSource, switchboardOracle, pythOracle, inPlacePrice, - }); - logResponse(response); - } catch (e) { - logError(e); - } -}; - -export const updateBaseAsset = async (opts: Opts) => { - const cvg = await createCvg(opts); - const { - enabled, - index, - oracleSource, - oraclePrice, - oracleAddress, - riskCategory, - } = opts; - const enabledArg = enabled === 'true' ? true : false; - if (!oraclePrice && !oracleAddress) { - throw new Error('Either oraclePrice or oracleAddress must be provided'); - } - if (!riskCategory) { - throw new Error('riskCategory must be provided'); - } - try { - const { response } = await cvg.protocol().updateBaseAsset({ - authority: cvg.rpc().getDefaultFeePayer(), - enabled: enabledArg, - index, - priceOracle: { - source: oracleSource, - price: oraclePrice, - address: oracleAddress ? new PublicKey(opts.oracleAddress) : undefined, - }, - riskCategory, + strict, }); logResponse(response); } catch (e) { @@ -341,6 +296,23 @@ export const registerMint = async (opts: Opts) => { } }; +export const addUserAsset = async (opts: Opts) => { + const cvg = await createCvg(opts); + try { + const { response } = await expirationRetry( + () => + cvg.protocol().addUserAsset({ + mint: new PublicKey(opts.mint), + ticker: opts.ticker, + }), + opts + ); + logResponse(response); + } catch (e) { + logError(e); + } +}; + export const getRegisteredMints = async (opts: Opts) => { const cvg = await createCvg(opts); try { @@ -546,14 +518,6 @@ export const addBaseAssetsFromJupiter = async (opts: Opts) => { !registerMintAddresses.includes(t.address.toString()) ); - let baseAssetIndexToStart; - if (baseAssets?.length > 0) { - baseAssetIndexToStart = Math.max(...baseAssets.map((b) => b.index)) + 1; - } else { - baseAssetIndexToStart = 0; - } - // eslint-disable-next-line no-console - console.log('last baseAssetIndex', baseAssetIndexToStart - 1); for (const token of jupTokensToAdd) { try { const coingeckoId = token?.extensions?.coingeckoId; @@ -589,23 +553,19 @@ export const addBaseAssetsFromJupiter = async (opts: Opts) => { console.log('Adding token:', token.symbol, 'with price:', tokenPrice); //mint should already exists on mainnet - const addBaseAssetTxBuilder = addBaseAssetBuilder(cvg, { - authority: cvg.rpc().getDefaultFeePayer(), - ticker: token.symbol, - riskCategory: 'high', - index: baseAssetIndexToStart, - priceOracle: { - source: 'in-place', - price: tokenPrice, - }, - }); + const { builder: addBaseAssetTxBuilder, baseAssetIndex } = + await addBaseAssetBuilder(cvg, { + authority: cvg.rpc().getDefaultFeePayer(), + ticker: token.symbol, + riskCategory: 'high', + oracleSource: 'in-place', + inPlacePrice: tokenPrice, + }); // eslint-disable-next-line no-console console.log('Adding base asset:', token.symbol); - // eslint-disable-next-line no-console - console.log('current baseAssetIndex:', baseAssetIndexToStart); const registerMintTxBuilder = await registerMintBuilder(cvg, { mint: new PublicKey(token.address), - baseAssetIndex: baseAssetIndexToStart, + baseAssetIndex, }); const mergedTxBuiler = TransactionBuilder.make() @@ -623,7 +583,6 @@ export const addBaseAssetsFromJupiter = async (opts: Opts) => { if (signatureStatus && signatureStatus === commitment) { // eslint-disable-next-line no-console console.log('Transaction confirmed'); - baseAssetIndexToStart++; } } catch (e) { // eslint-disable-next-line no-console diff --git a/packages/cli/src/groups/protocol.ts b/packages/cli/src/groups/protocol.ts index b42cfab83..f80cc7b06 100644 --- a/packages/cli/src/groups/protocol.ts +++ b/packages/cli/src/groups/protocol.ts @@ -11,7 +11,7 @@ import { addPrintTradeProvider, changeBaseAssetParameters, addBaseAssetsFromJupiter, - updateBaseAsset, + addUserAsset, } from '../actions'; import { addCmd } from '../helpers'; @@ -73,6 +73,11 @@ const initializeProtocolCmd = (c: Command) => description: 'settlement taker fee', defaultValue: '0', }, + { + flags: '--add-asset-fee ', + description: 'add asset fee in sol', + defaultValue: '0', + }, ]); const addInstrumentCmd = (c: Command) => @@ -111,29 +116,39 @@ const closeCmd = (c: Command) => const addBaseAssetCmd = (c: Command) => addCmd(c, 'add-base-asset', 'adds protocol base asset', addBaseAsset, [ + { + flags: '--index ', + description: 'base asset index', + defaultValue: null, + }, { flags: '--ticker ', description: 'ticker', }, + { + flags: '--risk-category ', + description: 'risk category', + defaultValue: 'medium', + }, { flags: '--oracle-source ', - description: 'oracle source', + description: 'oracle source - in-place | switchboard | pyth,', defaultValue: null, }, { - flags: '--oracle-price ', - description: 'oracle price', + flags: '--switchboard-address ', + description: 'switchboard address', defaultValue: null, }, { - flags: '--oracle-address ', - description: 'oracle address', + flags: '--pyth-address ', + description: 'pyth address', defaultValue: null, }, { - flags: '--risk-category ', - description: 'risk category', - defaultValue: 'medium', + flags: '--in-place-price ', + description: 'in place price', + defaultValue: null, }, ]); @@ -173,12 +188,16 @@ const changeBaseAssetParametersCmd = (c: Command) => description: 'pyth oracle, none to unset', defaultValue: null, }, - { flags: '--in-place-price ', description: 'in place price, -1 to unset', defaultValue: null, }, + { + flags: '--strict ', + description: 'true to set asset as strict, false to unset', + defaultValue: null, + }, ] ); @@ -193,6 +212,15 @@ const registerMintCmd = (c: Command) => }, ]); +const addUserAssetCmd = (c: Command) => + addCmd(c, 'add-user-asset', 'adds user asset', addUserAsset, [ + { flags: '--mint ', description: 'mint address' }, + { + flags: '--ticker ', + description: 'ticker', + }, + ]); + const getRegisteredMintsCmd = (c: Command) => addCmd( c, @@ -225,38 +253,6 @@ const addBaseAssetsFromJupiterCmd = (c: Command) => ] ); -const updateBaseAssetCmd = (c: Command) => - addCmd(c, 'update-base-asset', 'updates base asset', updateBaseAsset, [ - { - flags: '--index ', - description: 'index', - }, - { - flags: '--enabled ', - description: 'enabled', - defaultValue: 'true', - }, - { - flags: '--oracle-source ', - description: 'oracle source - in-place | switchboard | pyth,', - }, - { - flags: '--oracle-price ', - description: 'oracle price', - defaultValue: null, - }, - { - flags: '--oracle-address ', - description: 'oracle address', - defaultValue: null, - }, - { - flags: '--risk-category ', - description: - 'risk category - "very-low" | "low" | "medium" | "high" | "very-high" | "custom-1" | "custom-2" | "custom-3"', - }, - ]); - export const protocolGroup = (c: Command) => { const group = c.command('protocol'); initializeProtocolCmd(group); @@ -270,5 +266,5 @@ export const protocolGroup = (c: Command) => { getBaseAssetsCmd(group); closeCmd(group); addBaseAssetsFromJupiterCmd(group); - updateBaseAssetCmd(group); + addUserAssetCmd(group); }; diff --git a/packages/cli/src/logger.ts b/packages/cli/src/logger.ts index 505cea445..3443fea44 100644 --- a/packages/cli/src/logger.ts +++ b/packages/cli/src/logger.ts @@ -13,7 +13,6 @@ import { SpotLegInstrument, PsyoptionsAmericanInstrument, PsyoptionsEuropeanInstrument, - toPriceOracle, PrintTradeLeg, HxroPrintTradeProviderConfig, SpotInstrumentConfig, @@ -53,18 +52,16 @@ export const logResponse = (r: SendAndConfirmTransactionResponse): void => l('Tx:', r.signature); export const logBaseAsset = (b: BaseAsset): void => { - const priceOracle = toPriceOracle(b); l('Address:', b.address.toString()); l('Ticker:', b.ticker.toString()); l('Enabled:', b.enabled); l('Index:', b.index); l('Risk category:', b.riskCategory); - l('Oracle source:', priceOracle.source); - if (priceOracle.address) { - l('Oracle address:', priceOracle.address.toString()); - } else if (priceOracle.price) { - l('Oracle price:', priceOracle.price.toString()); - } + l('Oracle source:', b.oracleSource); + l('Switchboard oracle:', b.switchboardOracle); + l('Pyth oracle:', b.pythOracle); + l('In place price:', b.inPlacePrice); + l('Strict:', b.strict); }; export const logRegisteredMint = (r: RegisteredMint): void => { diff --git a/packages/cli/tests/unit/protocol.spec.ts b/packages/cli/tests/unit/protocol.spec.ts index 543c0b4f1..a3b9c77fd 100644 --- a/packages/cli/tests/unit/protocol.spec.ts +++ b/packages/cli/tests/unit/protocol.spec.ts @@ -52,6 +52,8 @@ describe('unit.protocol', () => { 'initialize', '--collateral-mint', COLLATERAL_MINT, + '--add-asset-fee', + '1', ]); expect(stub.args[0][0]).toEqual(ADDRESS_LABEL); }); @@ -145,7 +147,7 @@ describe('unit.protocol', () => { 'GOD', '--oracle-source', 'switchboard', - '--oracle-address', + '--switchboard-address', SWITCHBOARD_BTC_ORACLE, ]); expect(stub.args[0][0]).toEqual(TX_LABEL); @@ -159,7 +161,7 @@ describe('unit.protocol', () => { 'DOG', '--oracle-source', 'in-place', - '--oracle-price', + '--in-place-price', '101', ]); expect(stub.args[0][0]).toEqual(TX_LABEL); @@ -175,6 +177,8 @@ describe('unit.protocol', () => { 'true', '--in-place-price', '42', + '--strict', + 'true', ]); expect(stub.args[0][0]).toEqual(TX_LABEL); }); @@ -187,12 +191,25 @@ describe('unit.protocol', () => { 'ODG', '--oracle-source', 'pyth', - '--oracle-address', + '--pyth-address', PYTH_SOL_ORACLE, ]); expect(stub.args[0][0]).toEqual(TX_LABEL); }); + it('add-user-asset', async () => { + await runCli(['token', 'create-mint', '--decimals', '3']); + await runCli([ + 'protocol', + 'add-user-asset', + '--ticker', + 'TEST', + '--mint', + stub.args[0][1], + ]); + expect(stub.args[1][0]).toEqual(TX_LABEL); + }); + it('get-registered-mints', async () => { await runCli(['protocol', 'get-registered-mints']); expect(stub.args[0][0]).toEqual(ADDRESS_LABEL); diff --git a/packages/js/CHANGELOG.md b/packages/js/CHANGELOG.md index 66be5b240..50b0c296a 100644 --- a/packages/js/CHANGELOG.md +++ b/packages/js/CHANGELOG.md @@ -1,5 +1,17 @@ # @convergence-rfq/sdk +## 6.6.1 + +### Patch Changes + +- Add clear cache before finding a vacant base asset index + +## 6.6.0 + +### Minor Changes + +- Add user asset functionality, remove duplicated operation to change the existing base asset, add logic to automatically find a vacant base asset index + ## 6.5.0 ### Minor Changes diff --git a/packages/js/package.json b/packages/js/package.json index d18914ab6..02ed07053 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -1,7 +1,7 @@ { "name": "@convergence-rfq/sdk", "description": "Official Convergence RFQ SDK", - "version": "6.5.0", + "version": "6.6.1", "license": "MIT", "publishConfig": { "access": "public" @@ -52,13 +52,13 @@ "@bundlr-network/client": "^0.8.8", "@convergence-rfq/beet": "0.7.10", "@convergence-rfq/beet-solana": "0.4.11", - "@convergence-rfq/hxro-print-trade-provider": "3.10.0", - "@convergence-rfq/psyoptions-american-instrument": "3.10.0", - "@convergence-rfq/psyoptions-european-instrument": "3.10.0", - "@convergence-rfq/rfq": "3.10.0", - "@convergence-rfq/risk-engine": "3.10.0", - "@convergence-rfq/spot-instrument": "3.10.0", - "@convergence-rfq/vault-operator": "^3.10.0", + "@convergence-rfq/hxro-print-trade-provider": "3.11.0", + "@convergence-rfq/psyoptions-american-instrument": "3.11.0", + "@convergence-rfq/psyoptions-european-instrument": "3.11.0", + "@convergence-rfq/rfq": "3.11.0", + "@convergence-rfq/risk-engine": "3.11.0", + "@convergence-rfq/spot-instrument": "3.11.0", + "@convergence-rfq/vault-operator": "^3.11.0", "@coral-xyz/anchor": "^0.28.0", "@coral-xyz/borsh": "^0.28.0", "@hxronetwork/dexterity-ts": "1.6.16", diff --git a/packages/js/src/plugins/protocolModule/ProtocolClient.ts b/packages/js/src/plugins/protocolModule/ProtocolClient.ts index 207053bbe..f09f1e060 100644 --- a/packages/js/src/plugins/protocolModule/ProtocolClient.ts +++ b/packages/js/src/plugins/protocolModule/ProtocolClient.ts @@ -23,8 +23,8 @@ import { addPrintTradeProviderOperation, ChangeBaseAssetParametersInput, changeBaseAssetParametersOperation, - updateBaseAssetOperation, - UpdateBaseAssetInput, + AddUserAssetInput, + addUserAssetOperation, } from './operations'; import { ProtocolPdasClient } from './ProtocolPdasClient'; import { OperationOptions } from '@/types'; @@ -155,10 +155,10 @@ export class ProtocolClient { .execute(findBaseAssetByAddressOperation(input), options); } - /** {@inheritDoc updateBaseAssetOperation} */ - updateBaseAsset(input: UpdateBaseAssetInput, options?: OperationOptions) { + /** {@inheritDoc addUserAssetOperation} */ + addUserAsset(input: AddUserAssetInput, options?: OperationOptions) { return this.convergence .operations() - .execute(updateBaseAssetOperation(input), options); + .execute(addUserAssetOperation(input), options); } } diff --git a/packages/js/src/plugins/protocolModule/ProtocolPdasClient.ts b/packages/js/src/plugins/protocolModule/ProtocolPdasClient.ts index 74f8ae8be..e53e8baad 100644 --- a/packages/js/src/plugins/protocolModule/ProtocolPdasClient.ts +++ b/packages/js/src/plugins/protocolModule/ProtocolPdasClient.ts @@ -1,7 +1,7 @@ import { Buffer } from 'buffer'; import type { Convergence } from '../../Convergence'; -import { Pda, Program } from '../../types'; +import { Pda, Program, PublicKey } from '../../types'; function toLittleEndian(value: number, bytes: number) { const buf = Buffer.allocUnsafe(bytes); @@ -34,6 +34,15 @@ export class ProtocolPdasClient { ]); } + /** Finds the PDA of a given mint. */ + mintInfo({ mint }: MintInfoInput): Pda { + const programId = this.programId(); + return Pda.find(programId, [ + Buffer.from('mint_info', 'utf8'), + mint.toBuffer(), + ]); + } + private programId(programs?: Program[]) { return this.convergence.programs().getRfq(programs).address; } @@ -43,3 +52,11 @@ type BaseAssetInput = { /** The base asset index. */ index: number; }; + +type MintInfoInput = { + /** The address of the mint account. */ + mint: PublicKey; + + /** An optional set of programs that override the registered ones. */ + programs?: Program[]; +}; diff --git a/packages/js/src/plugins/protocolModule/helpers.ts b/packages/js/src/plugins/protocolModule/helpers.ts index 69dc8c950..3f1629118 100644 --- a/packages/js/src/plugins/protocolModule/helpers.ts +++ b/packages/js/src/plugins/protocolModule/helpers.ts @@ -1,6 +1,8 @@ import { COption } from '@convergence-rfq/beet'; import { CustomOptionalF64, CustomOptionalPubkey } from '@convergence-rfq/rfq'; import { PublicKey } from '@solana/web3.js'; +import { baseAssetsCache } from './cache'; +import { Convergence } from '@/Convergence'; export const toCustomOptionalF64 = ( input: COption @@ -29,3 +31,34 @@ export const toCustomOptionalPubkey = ( __kind: 'None', }; }; + +export const findVacantBaseAssetIndex = async (cvg: Convergence) => { + await baseAssetsCache.clear(); // clear the cache to use up-to-date base assets + + const getRandomNumber = (min: number, max: number) => { + const minCeiled = Math.ceil(min); + const maxFloored = Math.floor(max); + return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled); // The maximum is exclusive and the minimum is inclusive + }; + let elementsToSkip = getRandomNumber(0, 100); + + const existingBaseAssets = await cvg.protocol().getBaseAssets(); + const existing = existingBaseAssets + .map((el) => el.index) + .sort((a, b) => a - b); + + let nextExistingIndex = 0; + for (let i = 0; i < 2 ** 16; i++) { + const nextExisting = + nextExistingIndex < existing.length ? existing[nextExistingIndex] : null; + if (i === nextExisting) { + nextExistingIndex++; + } else if (elementsToSkip > 0) { + elementsToSkip--; + } else { + return i; + } + } + + throw new Error('Failed to find a vacant base asset index'); +}; diff --git a/packages/js/src/plugins/protocolModule/models/BaseAsset.ts b/packages/js/src/plugins/protocolModule/models/BaseAsset.ts index ff2abee70..9d39f61ed 100644 --- a/packages/js/src/plugins/protocolModule/models/BaseAsset.ts +++ b/packages/js/src/plugins/protocolModule/models/BaseAsset.ts @@ -4,7 +4,6 @@ import { RiskCategory as SolitaRiskCategory, OracleSource as SolitaOracleSource, } from '@convergence-rfq/rfq'; -import { COption } from '@convergence-rfq/beet'; import { BaseAssetAccount } from '../accounts'; import { assert } from '../../../utils/assert'; @@ -38,12 +37,6 @@ export const isOracleSource = (value: string): value is OracleSource => { return ['switchboard', 'pyth', 'in-place'].includes(value); }; -export type PriceOracle = { - source: OracleSource; - address?: PublicKey; - price?: number; -}; - /** * This model captures all the relevant information about a Solita base asset * on the Solana blockchain. @@ -81,6 +74,9 @@ export type BaseAsset = { /** The in-place price. */ readonly inPlacePrice?: number; + /** Is strict asset. */ + readonly strict: boolean; + /** The ticker for the base asset. */ readonly ticker: string; }; @@ -155,68 +151,6 @@ export const toSolitaOracleSource = ( } }; -/** @group Model Helpers */ -export const toPriceOracle = (baseAsset: BaseAsset): PriceOracle => { - switch (baseAsset.oracleSource) { - case 'switchboard': - return { - source: 'switchboard', - address: baseAsset.switchboardOracle, - }; - case 'pyth': - return { - source: 'pyth', - address: baseAsset.pythOracle, - }; - case 'in-place': - return { - source: 'in-place', - price: baseAsset.inPlacePrice, - }; - default: - throw new Error(`Unsupported price oracle: ${baseAsset.oracleSource}`); - } -}; - -/** @group Model Helpers */ -export const toSolitaPriceOracle = ( - priceOracle: PriceOracle -): { - oracleSource: SolitaOracleSource; - pythOracle: COption; - switchboardOracle: COption; - inPlacePrice: COption; -} => { - switch (priceOracle.source) { - case 'switchboard': - if (!priceOracle.address) throw new Error('Missing oracle address'); - return { - oracleSource: SolitaOracleSource.Switchboard, - switchboardOracle: priceOracle.address, - pythOracle: null, - inPlacePrice: null, - }; - case 'pyth': - if (!priceOracle.address) throw new Error('Missing oracle address'); - return { - oracleSource: SolitaOracleSource.Pyth, - switchboardOracle: null, - pythOracle: priceOracle.address, - inPlacePrice: null, - }; - case 'in-place': - if (!priceOracle.price) throw new Error('Missing oracle price'); - return { - oracleSource: SolitaOracleSource.InPlace, - switchboardOracle: null, - pythOracle: null, - inPlacePrice: priceOracle.price, - }; - default: - throw new Error(`Unsupported price oracle: ${priceOracle}`); - } -}; - export const toSolitaRiskCategory = (riskCategory: RiskCategory) => { switch (riskCategory) { case 'very-low': @@ -257,5 +191,6 @@ export const toBaseAsset = (account: BaseAssetAccount): BaseAsset => ({ : undefined, inPlacePrice: account.data.inPlacePrice !== 0 ? account.data.inPlacePrice : undefined, + strict: !account.data.nonStrict, ticker: account.data.ticker, }); diff --git a/packages/js/src/plugins/protocolModule/models/Protocol.ts b/packages/js/src/plugins/protocolModule/models/Protocol.ts index d265ffc43..0d5942396 100644 --- a/packages/js/src/plugins/protocolModule/models/Protocol.ts +++ b/packages/js/src/plugins/protocolModule/models/Protocol.ts @@ -7,6 +7,7 @@ import { import { ProtocolAccount } from '../accounts'; import { assert } from '../../../utils/assert'; +import { removeDecimals } from '@/utils/conversions'; /** * This model captures all the relevant information about an RFQ @@ -33,6 +34,9 @@ export type Protocol = { /** The default fees for the protocol */ readonly defaultFees: FeeParameters; + /** Sol fee to add a user asset */ + readonly assetAddFee: number; + /** The address of the risk engine */ readonly riskEngine: PublicKey; @@ -63,6 +67,7 @@ export const toProtocol = (account: ProtocolAccount): Protocol => ({ active: account.data.active, settleFees: account.data.settleFees, defaultFees: account.data.defaultFees, + assetAddFee: removeDecimals(account.data.assetAddFee, 9), riskEngine: account.data.riskEngine, collateralMint: account.data.collateralMint, instruments: account.data.instruments, diff --git a/packages/js/src/plugins/protocolModule/operations/addBaseAsset.ts b/packages/js/src/plugins/protocolModule/operations/addBaseAsset.ts index 6f5e16b14..7e95780cb 100644 --- a/packages/js/src/plugins/protocolModule/operations/addBaseAsset.ts +++ b/packages/js/src/plugins/protocolModule/operations/addBaseAsset.ts @@ -3,10 +3,10 @@ import { PublicKey } from '@solana/web3.js'; import { SendAndConfirmTransactionResponse } from '../../rpcModule'; import { + OracleSource, RiskCategory, - PriceOracle, + toSolitaOracleSource, toSolitaRiskCategory, - toSolitaPriceOracle, } from '../models/BaseAsset'; import { Convergence } from '../../../Convergence'; import { @@ -21,6 +21,7 @@ import { TransactionBuilderOptions, } from '../../../utils/TransactionBuilder'; import { baseAssetsCache } from '../cache'; +import { findVacantBaseAssetIndex } from '../helpers'; const Key = 'AddBaseAssetOperation' as const; @@ -66,13 +67,19 @@ export type AddBaseAssetInput = { /** * The index of the BaseAsset. */ - index: number; + index?: number; ticker: string; - riskCategory: RiskCategory; + riskCategory?: RiskCategory; - priceOracle: PriceOracle; + oracleSource?: OracleSource; + + inPlacePrice?: number; + + pythOracle?: PublicKey; + + switchboardOracle?: PublicKey; }; /** @@ -82,6 +89,8 @@ export type AddBaseAssetInput = { export type AddBaseAssetOutput = { /** The blockchain response from sending and confirming the transaction. */ response: SendAndConfirmTransactionResponse; + + baseAssetIndex: number; }; /** @@ -92,19 +101,23 @@ export const addBaseAssetOperationHandler: OperationHandler => { scope.throwIfCanceled(); - const builder = addBaseAssetBuilder(convergence, operation.input, scope); + const { builder, baseAssetIndex } = await addBaseAssetBuilder( + cvg, + operation.input, + scope + ); const { response } = await builder.sendAndConfirm( - convergence, + cvg, scope.confirmOptions ); baseAssetsCache.clear(); - return { response }; + return { response, baseAssetIndex }; }, }; @@ -114,6 +127,11 @@ export const addBaseAssetOperationHandler: OperationHandler { - const { programs, payer = convergence.rpc().getDefaultFeePayer() } = options; - const rfqProgram = convergence.programs().getRfq(programs); - const protocolPda = convergence.protocol().pdas().protocol(); +): Promise => { + const { programs, payer = cvg.rpc().getDefaultFeePayer() } = options; + const rfqProgram = cvg.programs().getRfq(programs); + const protocolPda = cvg.protocol().pdas().protocol(); const { protocol = protocolPda, authority, - index, + index = await findVacantBaseAssetIndex(cvg), ticker, - riskCategory, - priceOracle, + riskCategory = 'low', + oracleSource = 'in-place', + inPlacePrice = null, + pythOracle = null, + switchboardOracle = null, } = params; - const baseAsset = convergence.protocol().pdas().baseAsset({ index }); - const { oracleSource, inPlacePrice, pythOracle, switchboardOracle } = - toSolitaPriceOracle(priceOracle); + const baseAsset = cvg.protocol().pdas().baseAsset({ index }); - return TransactionBuilder.make() + const builder = TransactionBuilder.make() .setFeePayer(payer) - .addTxPriorityFeeIx(convergence) + .addTxPriorityFeeIx(cvg) .add({ instruction: createAddBaseAssetInstruction( { @@ -162,7 +181,7 @@ export const addBaseAssetBuilder = ( index: { value: index }, ticker, riskCategory: toSolitaRiskCategory(riskCategory), - oracleSource, + oracleSource: toSolitaOracleSource(oracleSource), inPlacePrice, pythOracle, switchboardOracle, @@ -172,4 +191,9 @@ export const addBaseAssetBuilder = ( signers: [authority], key: 'addBaseAsset', }); + + return { + builder, + baseAssetIndex: index, + }; }; diff --git a/packages/js/src/plugins/protocolModule/operations/addUserAsset.ts b/packages/js/src/plugins/protocolModule/operations/addUserAsset.ts new file mode 100644 index 000000000..8a0e0f0ca --- /dev/null +++ b/packages/js/src/plugins/protocolModule/operations/addUserAsset.ts @@ -0,0 +1,160 @@ +import { createAddUserAssetInstruction } from '@convergence-rfq/rfq'; +import { PublicKey } from '@solana/web3.js'; + +import { SendAndConfirmTransactionResponse } from '../../rpcModule'; +import { Convergence } from '../../../Convergence'; +import { + Operation, + OperationHandler, + OperationScope, + useOperation, +} from '../../../types'; +import { + TransactionBuilder, + TransactionBuilderOptions, +} from '../../../utils/TransactionBuilder'; +import { baseAssetsCache, registeredMintsCache } from '../cache'; +import { findVacantBaseAssetIndex } from '../helpers'; + +const Key = 'AddUserAssetOperation' as const; + +export const addUserAssetOperation = useOperation(Key); + +/** + * @group Operations + * @category Types + */ +export type AddUserAssetOperation = Operation< + typeof Key, + AddUserAssetInput, + AddUserAssetOutput +>; + +/** + * @group Operations + * @category Inputs + */ +export type AddUserAssetInput = { + ticker: string; + + mint: PublicKey; + + baseAssetIndex?: number; +}; + +/** + * @group Operations + * @category Outputs + */ +export type AddUserAssetOutput = { + /** The blockchain response from sending and confirming the transaction. */ + response: SendAndConfirmTransactionResponse; + + baseAssetIndex: number; +}; + +/** + * @group Operations + * @category Handlers + */ +export const addUserAssetOperationHandler: OperationHandler = + { + handle: async ( + operation: AddUserAssetOperation, + cvg: Convergence, + scope: OperationScope + ): Promise => { + scope.throwIfCanceled(); + + const { builder, baseAssetIndex } = await addUserAssetBuilder( + cvg, + operation.input, + scope + ); + const { response } = await builder.sendAndConfirm( + cvg, + scope.confirmOptions + ); + baseAssetsCache.clear(); + registeredMintsCache.clear(); + + return { response, baseAssetIndex }; + }, + }; + +/** + * @group Transaction Builders + * @category Inputs + */ +export type AddUserAssetBuilderParams = AddUserAssetInput; + +export type AddUserAssetBuilderResult = { + builder: TransactionBuilder; + baseAssetIndex: number; +}; + +/** + * Adds an UserAsset + * + * ```ts + * const transactionBuilder = convergence + * .rfqs() + * .builders() + * .addUserAsset({ address }); + * ``` + * + * @group Transaction Builders + * @category Constructors + */ +export const addUserAssetBuilder = async ( + cvg: Convergence, + params: AddUserAssetBuilderParams, + options: TransactionBuilderOptions = {} +): Promise => { + const { programs, payer = cvg.rpc().getDefaultFeePayer() } = options; + const rfqProgram = cvg.programs().getRfq(programs); + const protocolPda = cvg.protocol().pdas().protocol(); + const protocol = await cvg.protocol().get(); + const { + ticker, + mint, + baseAssetIndex = await findVacantBaseAssetIndex(cvg), + } = params; + + const baseAsset = cvg.protocol().pdas().baseAsset({ index: baseAssetIndex }); + const mintInfo = cvg.protocol().pdas().mintInfo({ mint }); + + let mintRegistered = false; + try { + await cvg.protocol().findRegisteredMintByAddress({ address: mintInfo }); + mintRegistered = true; + } catch (e) {} + if (mintRegistered) { + throw new Error(`Mint ${mint.toString()} had been already registered`); + } + + const builder = TransactionBuilder.make() + .setFeePayer(payer) + .addTxPriorityFeeIx(cvg) + .add({ + instruction: createAddUserAssetInstruction( + { + creator: cvg.identity().publicKey, + authority: protocol.authority, + protocol: protocolPda, + baseAsset, + mintInfo, + mint, + }, + { + index: { value: baseAssetIndex }, + ticker, + }, + rfqProgram.address + ), + signers: [cvg.identity()], + key: 'addUserAsset', + }); + + return { builder, baseAssetIndex }; +}; diff --git a/packages/js/src/plugins/protocolModule/operations/changeBaseAssetParameters.ts b/packages/js/src/plugins/protocolModule/operations/changeBaseAssetParameters.ts index 70c34825a..3b92a2f82 100644 --- a/packages/js/src/plugins/protocolModule/operations/changeBaseAssetParameters.ts +++ b/packages/js/src/plugins/protocolModule/operations/changeBaseAssetParameters.ts @@ -74,6 +74,8 @@ export type ChangeBaseAssetParametersInput = { * If a null value is passed, unset it */ inPlacePrice?: number | null; + + strict?: boolean; }; /** @@ -134,12 +136,13 @@ export const changeBaseAssetParametersBuilder = ( const protocolPda = cvg.protocol().pdas().protocol(); const { index, - enabled, - riskCategory, - oracleSource, + enabled = null, + riskCategory = null, + oracleSource = null, switchboardOracle, pythOracle, inPlacePrice, + strict = null, } = params; const baseAsset = cvg.protocol().pdas().baseAsset({ index }); @@ -159,16 +162,13 @@ export const changeBaseAssetParametersBuilder = ( baseAsset, }, { - riskCategory: riskCategory - ? toSolitaRiskCategory(riskCategory) - : null, - enabled: enabled ?? null, - oracleSource: oracleSource - ? toSolitaOracleSource(oracleSource) - : null, + riskCategory: riskCategory && toSolitaRiskCategory(riskCategory), + enabled, + oracleSource: oracleSource && toSolitaOracleSource(oracleSource), switchboardOracle: wrapInCustomOption(switchboardOracle), pythOracle: wrapInCustomOption(pythOracle), inPlacePrice: wrapInCustomOption(inPlacePrice), + strict, }, rfqProgram.address ), diff --git a/packages/js/src/plugins/protocolModule/operations/index.ts b/packages/js/src/plugins/protocolModule/operations/index.ts index cd3af1c50..4e96ed02d 100644 --- a/packages/js/src/plugins/protocolModule/operations/index.ts +++ b/packages/js/src/plugins/protocolModule/operations/index.ts @@ -10,4 +10,4 @@ export * from './getRegisteredMints'; export * from './findRegisteredMintByAddress'; export * from './findBaseAssetByAddress'; export * from './closeProtocol'; -export * from './updateBaseAssets'; +export * from './addUserAsset'; diff --git a/packages/js/src/plugins/protocolModule/operations/initializeProtocol.ts b/packages/js/src/plugins/protocolModule/operations/initializeProtocol.ts index cd97aa341..151a38ca0 100644 --- a/packages/js/src/plugins/protocolModule/operations/initializeProtocol.ts +++ b/packages/js/src/plugins/protocolModule/operations/initializeProtocol.ts @@ -83,6 +83,11 @@ export type InitializeProtocolInput = { * The protocol settlement taker fee. */ settlementTakerFee?: number; + + /** + * The add user asset sol fee. + */ + addAssetFee?: number; }; /** @@ -183,6 +188,7 @@ export const createProtocolBuilder = async ( protocolTakerFee = 0, settlementTakerFee = 0, settlementMakerFee = 0, + addAssetFee = 0, } = params; const systemProgram = convergence.programs().getSystem(programs); @@ -214,6 +220,7 @@ export const createProtocolBuilder = async ( collateralMintTokenAccount.decimals ), }; + const solitaAddAssetFee = addDecimals(addAssetFee, 9); return TransactionBuilder.make() .setFeePayer(payer) @@ -229,6 +236,7 @@ export const createProtocolBuilder = async ( { settleFees, defaultFees, + assetAddFee: solitaAddAssetFee, }, rfqProgram.address ), diff --git a/packages/js/src/plugins/protocolModule/operations/registerMint.ts b/packages/js/src/plugins/protocolModule/operations/registerMint.ts index fdcf5979e..f4bbf5c22 100644 --- a/packages/js/src/plugins/protocolModule/operations/registerMint.ts +++ b/packages/js/src/plugins/protocolModule/operations/registerMint.ts @@ -156,7 +156,7 @@ export const registerMintBuilder = async ( const rfqProgram = convergence.programs().getRfq(); const protocol = convergence.protocol().pdas().protocol(); - const mintInfo = convergence.rfqs().pdas().mintInfo({ mint }); + const mintInfo = convergence.protocol().pdas().mintInfo({ mint }); let baseAsset: PublicKey; if (baseAssetIndex >= 0) { diff --git a/packages/js/src/plugins/protocolModule/operations/updateBaseAssets.ts b/packages/js/src/plugins/protocolModule/operations/updateBaseAssets.ts deleted file mode 100644 index 4075d321b..000000000 --- a/packages/js/src/plugins/protocolModule/operations/updateBaseAssets.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { createChangeBaseAssetParametersInstruction } from '@convergence-rfq/rfq'; -import { PublicKey } from '@solana/web3.js'; - -import { SendAndConfirmTransactionResponse } from '../../rpcModule'; -import { - RiskCategory, - PriceOracle, - toSolitaRiskCategory, - toSolitaPriceOracle, -} from '../models/BaseAsset'; -import { Convergence } from '../../../Convergence'; -import { - Operation, - OperationHandler, - OperationScope, - useOperation, - Signer, -} from '../../../types'; -import { - TransactionBuilder, - TransactionBuilderOptions, -} from '../../../utils/TransactionBuilder'; -import { baseAssetsCache } from '../cache'; -import { toCustomOptionalF64, toCustomOptionalPubkey } from '../helpers'; - -const Key = 'updateBaseAssetOperation' as const; - -/** - * Add an BaseAsset - * - * ```ts - * await convergence - * .rfqs() - * .updateBaseAsset({ address }; - * ``` - * - * @group Operations - * @category Constructors - */ -export const updateBaseAssetOperation = - useOperation(Key); - -/** - * @group Operations - * @category Types - */ -export type UpdateBaseAssetOperation = Operation< - typeof Key, - UpdateBaseAssetInput, - UpdateBaseAssetOutput ->; - -/** - * @group Operations - * @category Inputs - */ -export type UpdateBaseAssetInput = { - /** - * The owner of the protocol. - */ - authority: Signer; - - /** - * The protocol to add the BaseAsset to. - */ - protocol?: PublicKey; - - /** - * The index of the BaseAsset. - */ - index: number; - - enabled: boolean; - - riskCategory: RiskCategory; - - priceOracle: PriceOracle; -}; - -/** - * @group Operations - * @category Outputs - */ -export type UpdateBaseAssetOutput = { - /** The blockchain response from sending and confirming the transaction. */ - response: SendAndConfirmTransactionResponse; -}; - -/** - * @group Operations - * @category Handlers - */ -export const updateBaseAssetOperationHandler: OperationHandler = - { - handle: async ( - operation: UpdateBaseAssetOperation, - convergence: Convergence, - scope: OperationScope - ): Promise => { - scope.throwIfCanceled(); - - const builder = updateBaseAssetBuilder( - convergence, - operation.input, - scope - ); - const { response } = await builder.sendAndConfirm( - convergence, - scope.confirmOptions - ); - baseAssetsCache.clear(); - - return { response }; - }, - }; - -/** - * @group Transaction Builders - * @category Inputs - */ -export type UpdateBaseAssetBuilderParams = UpdateBaseAssetInput; - -/** - * Adds an BaseAsset - * - * ```ts - * const transactionBuilder = convergence - * .rfqs() - * .builders() - * .updateBaseAsset({ address }); - * ``` - * - * @group Transaction Builders - * @category Constructors - */ -export const updateBaseAssetBuilder = ( - convergence: Convergence, - params: UpdateBaseAssetBuilderParams, - options: TransactionBuilderOptions = {} -): TransactionBuilder => { - const { programs, payer = convergence.rpc().getDefaultFeePayer() } = options; - const rfqProgram = convergence.programs().getRfq(programs); - const protocolPda = convergence.protocol().pdas().protocol(); - const { - protocol = protocolPda, - authority, - index, - enabled, - riskCategory, - priceOracle, - } = params; - - const baseAsset = convergence.protocol().pdas().baseAsset({ index }); - const { oracleSource, inPlacePrice, pythOracle, switchboardOracle } = - toSolitaPriceOracle(priceOracle); - - return TransactionBuilder.make() - .setFeePayer(payer) - .addTxPriorityFeeIx(convergence) - .add({ - instruction: createChangeBaseAssetParametersInstruction( - { - authority: authority.publicKey, - protocol, - baseAsset, - }, - { - enabled, - riskCategory: toSolitaRiskCategory(riskCategory), - oracleSource, - inPlacePrice: toCustomOptionalF64(inPlacePrice), - pythOracle: toCustomOptionalPubkey(pythOracle), - switchboardOracle: toCustomOptionalPubkey(switchboardOracle), - }, - rfqProgram.address - ), - signers: [authority], - key: 'updateBaseAsset', - }); -}; diff --git a/packages/js/src/plugins/protocolModule/plugin.ts b/packages/js/src/plugins/protocolModule/plugin.ts index 389ea538a..8b4aa742b 100644 --- a/packages/js/src/plugins/protocolModule/plugin.ts +++ b/packages/js/src/plugins/protocolModule/plugin.ts @@ -24,8 +24,8 @@ import { addPrintTradeProviderOperationHandler, changeBaseAssetParametersOperation, changeBaseAssetParametersOperationHandler, - updateBaseAssetOperation, - updateBaseAssetOperationHandler, + addUserAssetOperation, + addUserAssetOperationHandler, } from './operations'; import { ConvergencePlugin } from '@/types'; import type { Convergence } from '@/Convergence'; @@ -64,7 +64,7 @@ export const protocolModule = (): ConvergencePlugin => ({ findBaseAssetByAddressOperationHandler ); op.register(closeProtocolOperation, closeProtocolOperationHandler); - op.register(updateBaseAssetOperation, updateBaseAssetOperationHandler); + op.register(addUserAssetOperation, addUserAssetOperationHandler); convergence.protocol = function () { return new ProtocolClient(this); }; diff --git a/packages/js/src/plugins/psyoptionsAmericanInstrumentModule/instrument.ts b/packages/js/src/plugins/psyoptionsAmericanInstrumentModule/instrument.ts index d450d97bf..66343b790 100644 --- a/packages/js/src/plugins/psyoptionsAmericanInstrumentModule/instrument.ts +++ b/packages/js/src/plugins/psyoptionsAmericanInstrumentModule/instrument.ts @@ -120,7 +120,7 @@ export class PsyoptionsAmericanInstrument implements LegInstrument { expirationTimestamp: number ) { const mintInfoAddress = convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: underlyingMint.address }); const mintInfo = await convergence @@ -199,11 +199,11 @@ export class PsyoptionsAmericanInstrument implements LegInstrument { throw new Error('Missing stable asset mint'); } const mintInfoPda = this.convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: this.underlyingAssetMint }); const quoteAssetMintPda = this.convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: this.stableAssetMint }); return [ diff --git a/packages/js/src/plugins/psyoptionsEuropeanInstrumentModule/instrument.ts b/packages/js/src/plugins/psyoptionsEuropeanInstrumentModule/instrument.ts index d11a03e11..c5e5a785f 100644 --- a/packages/js/src/plugins/psyoptionsEuropeanInstrumentModule/instrument.ts +++ b/packages/js/src/plugins/psyoptionsEuropeanInstrumentModule/instrument.ts @@ -181,7 +181,7 @@ export class PsyoptionsEuropeanInstrument implements LegInstrument { expirationTimestamp: number ) { const mintInfoAddress = convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: underlyingMint.address }); const mintInfo = await convergence @@ -249,7 +249,7 @@ export class PsyoptionsEuropeanInstrument implements LegInstrument { { pubkey: this.optionMetaPubKey, isSigner: false, isWritable: false }, { pubkey: this.convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: this.underlyingAssetMint }), isSigner: false, diff --git a/packages/js/src/plugins/rfqModule/RfqPdasClient.ts b/packages/js/src/plugins/rfqModule/RfqPdasClient.ts index 42eeddf2f..7f2e9bfc6 100644 --- a/packages/js/src/plugins/rfqModule/RfqPdasClient.ts +++ b/packages/js/src/plugins/rfqModule/RfqPdasClient.ts @@ -38,14 +38,6 @@ function toLittleEndian(value: number, bytes: number) { */ export class RfqPdasClient { constructor(protected readonly convergence: Convergence) {} - /** Finds the PDA of a given mint. */ - mintInfo({ mint }: MintInfoInput): Pda { - const programId = this.programId(); - return Pda.find(programId, [ - Buffer.from('mint_info', 'utf8'), - mint.toBuffer(), - ]); - } /** Finds the PDA of a given quote asset. */ quote({ quoteAsset }: QuoteInput): Pda { @@ -137,14 +129,6 @@ const serializeQuoteAssetData = (quoteAsset: QuoteAsset): Buffer => { return quoteAssetSerializer.serialize(quoteAsset); }; -type MintInfoInput = { - /** The address of the mint account. */ - mint: PublicKey; - - /** An optional set of programs that override the registered ones. */ - programs?: Program[]; -}; - type QuoteInput = { /** The quote asset. */ quoteAsset: QuoteAsset; diff --git a/packages/js/src/plugins/spotInstrumentModule/instruments.ts b/packages/js/src/plugins/spotInstrumentModule/instruments.ts index 4381ad8aa..ba61f9b68 100644 --- a/packages/js/src/plugins/spotInstrumentModule/instruments.ts +++ b/packages/js/src/plugins/spotInstrumentModule/instruments.ts @@ -67,7 +67,7 @@ export class SpotLegInstrument implements LegInstrument { side: LegSide = 'long' ): Promise { const mintInfoAddress = convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: mint.address }); const mintInfo = await convergence @@ -102,7 +102,7 @@ export class SpotLegInstrument implements LegInstrument { /** Helper method to get validation accounts for a spot instrument. */ getValidationAccounts() { const mintInfo = this.convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: this.mintAddress }); return [{ pubkey: mintInfo, isSigner: false, isWritable: false }]; @@ -178,7 +178,7 @@ export class SpotQuoteInstrument implements QuoteInstrument { mint: Mint ): Promise { const mintInfoAddress = convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: mint.address }); const mintInfo = await convergence @@ -210,7 +210,7 @@ export class SpotQuoteInstrument implements QuoteInstrument { /** Helper method to get validation accounts for a spot instrument. */ getValidationAccounts() { const mintInfo = this.convergence - .rfqs() + .protocol() .pdas() .mintInfo({ mint: this.mintAddress }); return [{ pubkey: mintInfo, isSigner: false, isWritable: false }]; diff --git a/packages/js/tests/unit/protocol.spec.ts b/packages/js/tests/unit/protocol.spec.ts index 0196d65e6..b06cb895f 100644 --- a/packages/js/tests/unit/protocol.spec.ts +++ b/packages/js/tests/unit/protocol.spec.ts @@ -4,8 +4,8 @@ import { protocolCache, baseAssetsCache, registeredMintsCache, - toPriceOracle, BaseAsset, + Mint, } from '../../src'; import { createUserCvg, generateTicker } from '../helpers'; import { @@ -16,6 +16,7 @@ import { describe('unit.protocol', () => { const cvg = createUserCvg('dao'); + const userCvg = createUserCvg('taker'); it('get', async () => { const protocol = await cvg.protocol().get(); @@ -124,80 +125,72 @@ describe('unit.protocol', () => { }); it('add base asset [switchboard oracle]', async () => { - const baseAssets = await cvg.protocol().getBaseAssets(); const { response } = await cvg.protocol().addBaseAsset({ authority: cvg.identity(), - index: baseAssets.length + 1, ticker: generateTicker(), riskCategory: 'very-low', - priceOracle: { - source: 'switchboard', - address: SWITCHBOARD_BTC_ORACLE_PK, - }, + oracleSource: 'switchboard', + switchboardOracle: SWITCHBOARD_BTC_ORACLE_PK, }); expect(response).toHaveProperty('signature'); }); it('add base asset [pyth oracle]', async () => { - const baseAssets = await cvg.protocol().getBaseAssets(); const { response } = await cvg.protocol().addBaseAsset({ authority: cvg.identity(), - index: baseAssets.length + 1, ticker: generateTicker(), riskCategory: 'very-low', - priceOracle: { - source: 'pyth', - address: PYTH_SOL_ORACLE_PK, - }, + oracleSource: 'pyth', + pythOracle: PYTH_SOL_ORACLE_PK, }); expect(response).toHaveProperty('signature'); }); it('add base asset [in-place price]', async () => { - let baseAssets = await cvg.protocol().getBaseAssets(); - const index = baseAssets.length + 1; const price = 101; - const { response } = await cvg.protocol().addBaseAsset({ + const { response, baseAssetIndex } = await cvg.protocol().addBaseAsset({ authority: cvg.identity(), - index, ticker: generateTicker(), riskCategory: 'very-low', - priceOracle: { - source: 'in-place', - price, - }, + oracleSource: 'in-place', + inPlacePrice: price, }); expect(response).toHaveProperty('signature'); - const baseAssetPda = cvg.protocol().pdas().baseAsset({ index }); - baseAssets = await cvg.protocol().getBaseAssets(); - expect(baseAssets[baseAssets.length - 1].address.toBase58()).toBe( - baseAssetPda.toBase58() - ); - + const baseAssetPda = cvg + .protocol() + .pdas() + .baseAsset({ index: baseAssetIndex }); const baseAsset = await cvg .protocol() .findBaseAssetByAddress({ address: baseAssetPda }); - expect(toPriceOracle(baseAsset).price).toEqual(price); + expect(baseAsset.inPlacePrice).toEqual(price); }); it('change base asset parameters', async () => { + const baseAssets: BaseAsset[] = await cvg.protocol().getBaseAssets(); + const baseAsset = baseAssets[0]; const { response } = await cvg.protocol().changeBaseAssetParameters({ index: 0, enabled: true, inPlacePrice: 42, + strict: false, }); expect(response).toHaveProperty('signature'); - const baseAssets: BaseAsset[] = await cvg.protocol().getBaseAssets(); - const baseAsset = baseAssets.find((x) => x.index === 0); - expect(baseAsset?.inPlacePrice).toBe(42); + const dataAfter = await cvg + .protocol() + .findBaseAssetByAddress({ address: baseAsset.address }); + expect(dataAfter?.inPlacePrice).toBe(42); + expect(dataAfter?.strict).toBe(false); }); it('register mint', async () => { + const baseAssets: BaseAsset[] = await cvg.protocol().getBaseAssets(); + const baseAssetIndex = baseAssets[0].index; const { mint } = await cvg.tokens().createMint({ decimals: 3 }); const { response } = await cvg.protocol().registerMint({ - baseAssetIndex: 1, + baseAssetIndex, mint: mint.address, }); expect(response).toHaveProperty('signature'); @@ -214,4 +207,27 @@ describe('unit.protocol', () => { }); expect(baseAsset).toHaveProperty('address'); }); + + it('add user asset', async () => { + const { mint } = await cvg.tokens().createMint(); + const ticker = generateTicker(); + const { baseAssetIndex } = await cvg + .protocol() + .addUserAsset({ ticker, mint: mint.address }); + const address = cvg.protocol().pdas().baseAsset({ index: baseAssetIndex }); + const baseAsset: BaseAsset = await cvg + .protocol() + .findBaseAssetByAddress({ address }); + expect(baseAsset.ticker).toBe(ticker); + }); + + it('add several user assets', async () => { + const mintResults = await Promise.all( + new Array(5).fill(null).map(() => cvg.tokens().createMint()) + ); + for (const { mint } of mintResults) { + const ticker = generateTicker(); + await cvg.protocol().addUserAsset({ ticker, mint: mint.address }); + } + }); }); diff --git a/packages/validator/fixtures/accounts/rfq-protocol.json b/packages/validator/fixtures/accounts/rfq-protocol.json index a95d5ff3b..7f06bc485 100644 --- a/packages/validator/fixtures/accounts/rfq-protocol.json +++ b/packages/validator/fixtures/accounts/rfq-protocol.json @@ -3,7 +3,7 @@ "account": { "lamports": 35245440, "data": [ - "ITOthiOMw/hkkmwxt0h97FaidP3LKozG7UccMPS5f0Ffs5eNp94gmf8BAC0xAQAAAACAlpgAAAAAAADh9QUAAAAAAGXNHQAAAACwrKo0HjaL9oUZ0AwE1p+JHVKTcs55/kDE/lmUTMVgNmkauU5vef9sRZRd0uT4AWqyvbHveZg+qqPufmdbAGbpAQAAAFkkdOYAxksuBzNIiEuhu5wGIxiDQ20QOBuM8uqkVCV4AgEDAAAAmdb7REiKg21M9/FtGIfsOSsD/K7ESsZyfHJz4tbXUJEBAQEHBQMEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxPBiuESphc/9eTxK0v5lWq0Fhl+Dq4uMncfvyoe62wgEAAgcDAwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPn4JBeNNnKrn93HANn5Iinun1iYe6VXbwyivBDfV0QOAQADBwMDBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "base64" ], "owner": "FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo", diff --git a/packages/validator/fixtures/programs/hxro_print_trade_provider.so b/packages/validator/fixtures/programs/hxro_print_trade_provider.so index c7d01874e..3c711cca5 100755 Binary files a/packages/validator/fixtures/programs/hxro_print_trade_provider.so and b/packages/validator/fixtures/programs/hxro_print_trade_provider.so differ diff --git a/packages/validator/fixtures/programs/psyoptions_american_instrument.so b/packages/validator/fixtures/programs/psyoptions_american_instrument.so index 75ef46ca1..10202db23 100755 Binary files a/packages/validator/fixtures/programs/psyoptions_american_instrument.so and b/packages/validator/fixtures/programs/psyoptions_american_instrument.so differ diff --git a/packages/validator/fixtures/programs/psyoptions_european_instrument.so b/packages/validator/fixtures/programs/psyoptions_european_instrument.so index 6dd9f11fb..3f3ba6ef2 100755 Binary files a/packages/validator/fixtures/programs/psyoptions_european_instrument.so and b/packages/validator/fixtures/programs/psyoptions_european_instrument.so differ diff --git a/packages/validator/fixtures/programs/rfq.so b/packages/validator/fixtures/programs/rfq.so index e47160cb7..3cb4ab443 100755 Binary files a/packages/validator/fixtures/programs/rfq.so and b/packages/validator/fixtures/programs/rfq.so differ diff --git a/packages/validator/fixtures/programs/spot_instrument.so b/packages/validator/fixtures/programs/spot_instrument.so index 184086191..5b3558f9c 100755 Binary files a/packages/validator/fixtures/programs/spot_instrument.so and b/packages/validator/fixtures/programs/spot_instrument.so differ diff --git a/packages/validator/fixtures/programs/vault_operator.so b/packages/validator/fixtures/programs/vault_operator.so index cc7b71cf2..0ee18cbc9 100755 Binary files a/packages/validator/fixtures/programs/vault_operator.so and b/packages/validator/fixtures/programs/vault_operator.so differ diff --git a/yarn.lock b/yarn.lock index 612873d18..e3b9e5837 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1281,10 +1281,10 @@ bn.js "^5.2.0" debug "^4.3.3" -"@convergence-rfq/hxro-print-trade-provider@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/hxro-print-trade-provider/-/hxro-print-trade-provider-3.10.0.tgz#cc84b62bb8dfa1bb803edfb33c5824d9193bc8cc" - integrity sha512-s+7oqL6usif8+FFWCOBQAx/crbrf51DLiONt4Zy2PKx0Ae37f+Wf02xl3vANwFhgqMlgVVn4QPQCSb+BzZ9fUw== +"@convergence-rfq/hxro-print-trade-provider@3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/hxro-print-trade-provider/-/hxro-print-trade-provider-3.11.0.tgz#ef2bb82c717a64e1a697354a460abfc086c03f47" + integrity sha512-/kw2xA5Ac3KHO3S7J1qUGuK2uZjy56DDka6vyqNCGH2nlVuPDcJDtmRJyHxLvIaBB8hxLNhc4LaxfBZI2bAiUg== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11" @@ -1292,10 +1292,10 @@ "@solana/web3.js" "^1.56.2" bn.js "^5.2.0" -"@convergence-rfq/psyoptions-american-instrument@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/psyoptions-american-instrument/-/psyoptions-american-instrument-3.10.0.tgz#39ca418d63b273c52fe33569e958f4c4069e4648" - integrity sha512-mAJ9JF56oQBuGn8sTE8ZcQ7hRY+pxa947pRQVzZZWitt7OO5Pxu9kZq8oFARLglOdHEdVmCkhN05lUaSMel8rA== +"@convergence-rfq/psyoptions-american-instrument@3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/psyoptions-american-instrument/-/psyoptions-american-instrument-3.11.0.tgz#e36337e5f677412a04499cf21c04695c0e9d3976" + integrity sha512-YVgpWIKH8XMJ3jbcB4r++h77pedD90QJZ6XYg5ef30wj7JCBZTWzvTcu8Ed35xwfT8RfR9slKs1bHz1iAblx7g== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11" @@ -1303,10 +1303,10 @@ "@solana/web3.js" "^1.56.2" bn.js "^5.2.0" -"@convergence-rfq/psyoptions-european-instrument@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/psyoptions-european-instrument/-/psyoptions-european-instrument-3.10.0.tgz#6aa20a873cf8206dbc6e1cde2450c6a6a3f552df" - integrity sha512-Yr1JiHVadYTOeMQqxUGuSPnnlNQbrDJDxo0dCEG+wacDomiiv4ThvGovj1XQ4LNqDCorzHBEYi1JpICQXDd/QA== +"@convergence-rfq/psyoptions-european-instrument@3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/psyoptions-european-instrument/-/psyoptions-european-instrument-3.11.0.tgz#d45ec60af04d73912419362be455de18718e0f21" + integrity sha512-tFkF6yR/AwRAx69W7ZFzq6MZS3vMR7eRvzLOwpQ7eM4mWbB3srQ8Dhsr/7HicrSgaXY94CYGHf9vK49OysM3Iw== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11" @@ -1314,10 +1314,10 @@ "@solana/web3.js" "^1.56.2" bn.js "^5.2.0" -"@convergence-rfq/rfq@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/rfq/-/rfq-3.10.0.tgz#53e986f89dc70690904394a008d98ab155bed6c5" - integrity sha512-RgwYMHa0Adj0XTc2yMMj4LI/VIp4JFiVsnGNuK79OfO+oV6OxnGTdVrpixDlYSfJylkH9eUobmoPmiLECK+PPg== +"@convergence-rfq/rfq@3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/rfq/-/rfq-3.11.0.tgz#c7c0e1db5366bcfc388e2fdea048ef578cd74b70" + integrity sha512-bXF2mejleAhdnt81vCpgi9bsxdLWZzPP6EDoQ4WhKFK4kSj08whUOMqbQKGRzezp5nHhwsctKgj4K92p2LAe9w== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11" @@ -1325,10 +1325,10 @@ "@solana/web3.js" "^1.56.2" bn.js "^5.2.0" -"@convergence-rfq/risk-engine@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/risk-engine/-/risk-engine-3.10.0.tgz#6cdf08901aaafb895e87d1db941d30d147ae5b3a" - integrity sha512-dzNcphgvvdF8g3ATu91hTf8PL5W2I3eJixhImE4xX3aDcXpA92ErYSEgSPS7QargFP+3uvB1w1I7THAzXwQJug== +"@convergence-rfq/risk-engine@3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/risk-engine/-/risk-engine-3.11.0.tgz#ec2a7d0781bcde02ffc703eb47bbf7b6e95004fb" + integrity sha512-XjTLsCDX37Ats+jZAIW56jzJ+drDX/ED0w9mJc3RYh09TMD3UXN3eZAHD/Y+WmJSgn+OAVi3/qaQNSOE1ZFLEA== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11" @@ -1336,10 +1336,10 @@ "@solana/web3.js" "^1.56.2" bn.js "^5.2.0" -"@convergence-rfq/spot-instrument@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/spot-instrument/-/spot-instrument-3.10.0.tgz#57b75859c18f821f48635e48c296db13668e449a" - integrity sha512-F066GxaUpqwa7+1o5+Tj4VaK0prozQCXOuIv1N2o0FkyJI0AGfrDir2YmlQnovBii+Atj/zUVSmPrwTlZEG7+w== +"@convergence-rfq/spot-instrument@3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/spot-instrument/-/spot-instrument-3.11.0.tgz#2f020b9874e154f9eaedce00c181f847bb29f1c0" + integrity sha512-nnN1AicLy6vvTycXmAfVtAKjMWSspGt/wFm0w2EuCTlFPodhE7+IUVq/8F2hTi/LPM3StC8xxUJm5Vtf+ibBeQ== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11" @@ -1347,10 +1347,10 @@ "@solana/web3.js" "^1.56.2" bn.js "^5.2.0" -"@convergence-rfq/vault-operator@^3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@convergence-rfq/vault-operator/-/vault-operator-3.10.0.tgz#63616c9e0be2aa3cddc659f3ceecbb9923772ffa" - integrity sha512-d43thgKaSaFEf2khteGQ46pRU1sl65PJwfAjDLy5SnOscLPw7e1irV7ETxs97AZA0zdzv1niOejn0H2jAg/zMQ== +"@convergence-rfq/vault-operator@^3.11.0": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@convergence-rfq/vault-operator/-/vault-operator-3.11.0.tgz#a47624c1e7ba79a99fc6d358f5f347d06e55fa91" + integrity sha512-QFEXBM8yGC41Yv7ENBpUFe73QXIJLpimZrpdHeBrlkRCkOseFNHMS4l1gjgBA+IKcx0bgkRP2hsbZ6WcxDFlzA== dependencies: "@convergence-rfq/beet" "^0.7.10" "@convergence-rfq/beet-solana" "^0.4.11"