Skip to content

Commit

Permalink
Add optional exit price to addressUpdateSchema
Browse files Browse the repository at this point in the history
The addressUpdateSchema used in the Aggregator service has been updated to include an optional 'exit price' field. This has been added to improve the granularity and accuracy of trade management, providing more data for transactional analysis.
  • Loading branch information
TheJuze committed Feb 26, 2024
1 parent 5a1919f commit a037622
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@electra.finance/sdk",
"version": "0.2.10",
"version": "0.2.11-rc0",
"description": "Electra finance SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
Expand Down
2 changes: 2 additions & 0 deletions src/services/Aggregator/ws/schemas/addressUpdateSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const fullOrderSchema = z.object({
t: z.number(), // update time
lv: z.number().optional(), // leverage
roi: z.number().optional(), // ROI%
ep: z.number().optional(), // exit price
c: subOrderSchema.array(), // sub orders (content)

// CFD only
Expand Down Expand Up @@ -128,6 +129,7 @@ export const fullOrderSchema = z.object({
realizedPnL: o.rpnl,
leverage: o.lv,
roi: o.roi,
exitPrice: o.ep,
subOrders: getTransformedSubOrders(o.c),
}));

Expand Down

0 comments on commit a037622

Please sign in to comment.