fix: preserve SOR execution venue separately
This commit is contained in:
@@ -548,7 +548,7 @@ class _PgIntentRecord:
|
||||
_OUTBOX_COLUMNS = (
|
||||
"correlation_id, asset_id, order_id, execution_id, side, qty, price, "
|
||||
"fee, tax, executed_at, status, attempts, last_outcome, last_error, "
|
||||
"created_at, updated_at, next_retry_at, venue"
|
||||
"created_at, updated_at, next_retry_at, venue, order_venue"
|
||||
)
|
||||
|
||||
|
||||
@@ -565,8 +565,8 @@ class PostgreSQLLedgerOutbox:
|
||||
cur.execute(
|
||||
"INSERT INTO ledger_outbox "
|
||||
"(correlation_id, asset_id, order_id, execution_id, side, "
|
||||
" qty, price, fee, tax, executed_at, venue) "
|
||||
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) "
|
||||
" qty, price, fee, tax, executed_at, venue, order_venue) "
|
||||
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) "
|
||||
"ON CONFLICT (correlation_id) DO NOTHING",
|
||||
(
|
||||
trade.correlation_id,
|
||||
@@ -580,6 +580,7 @@ class PostgreSQLLedgerOutbox:
|
||||
trade.tax,
|
||||
trade.executed_at,
|
||||
trade.venue,
|
||||
trade.order_venue,
|
||||
),
|
||||
)
|
||||
conn.commit()
|
||||
@@ -684,6 +685,7 @@ class PostgreSQLLedgerOutbox:
|
||||
tax=f(row[8]),
|
||||
executed_at=row[9],
|
||||
venue=row[17],
|
||||
order_venue=row[18],
|
||||
)
|
||||
return LedgerWorkItem(
|
||||
correlation_id=row[0],
|
||||
|
||||
Reference in New Issue
Block a user