Skip to content

Commit

Permalink
point perpetual at existing market when submitting dydx-usd proposal (#…
Browse files Browse the repository at this point in the history
…147)

* point perpetual at existing market when submitting dydx-usd proposal

* bump patch version
  • Loading branch information
tqin7 authored Apr 11, 2024
1 parent 8063969 commit 984f6d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions v4-client-js/package-lock.json

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

2 changes: 1 addition & 1 deletion v4-client-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/v4-client-js",
"version": "1.1.6",
"version": "1.1.7",
"description": "General client library for the new dYdX system (v4 decentralized)",
"main": "build/src/index.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions v4-client-js/src/clients/composite-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,8 @@ export class CompositeClient {
const registry = generateRegistry();
const msgs: EncodeObject[] = [];

const isDydxUsd = params.ticker.toLowerCase() === 'dydx-usd';

// x/prices.MsgCreateOracleMarket
const createOracleMarket = composer.composeMsgCreateOracleMarket(
params.id,
Expand All @@ -1061,7 +1063,7 @@ export class CompositeClient {
// x/perpetuals.MsgCreatePerpetual
const createPerpetual = composer.composeMsgCreatePerpetual(
params.id,
params.id,
isDydxUsd ? 1000001 : params.id,
params.ticker,
params.atomicResolution,
params.liquidityTier,
Expand Down Expand Up @@ -1094,7 +1096,9 @@ export class CompositeClient {
);

// The order matters.
msgs.push(createOracleMarket);
if (!isDydxUsd) {
msgs.push(createOracleMarket);
}
msgs.push(createPerpetual);
msgs.push(createClobPair);
msgs.push(delayMessage);
Expand Down

0 comments on commit 984f6d9

Please sign in to comment.