Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
feature: enable OP Horizon campaign via feature flag (#146)
Browse files Browse the repository at this point in the history
* feature: add isFeatureEnableOpHorizon

* Use env to switch OpHorizon campaign on

* fix: use stable @debridge-finance/legacy-dln-profitability

* chore: version bump

---------

Co-authored-by: Alexey Churkin <[email protected]>
  • Loading branch information
mncdg and alexeychr authored Oct 25, 2023
1 parent f245532 commit 7232efc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
22 changes: 11 additions & 11 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@debridge-finance/dln-taker",
"version": "2.15.10",
"version": "2.16.0",
"description": "DLN executor is the rule-based daemon service developed to automatically execute orders placed on the deSwap Liquidity Network (DLN) across supported blockchains",
"license": "GPL-3.0-only",
"author": "deBridge",
Expand Down Expand Up @@ -32,8 +32,8 @@
},
"types": "./dist/index.d.ts",
"dependencies": {
"@debridge-finance/dln-client": "8.0.0",
"@debridge-finance/legacy-dln-profitability": "2.0.0",
"@debridge-finance/dln-client": "8.1.0",
"@debridge-finance/legacy-dln-profitability": "2.1.0",
"@debridge-finance/solana-utils": "4.2.1",
"@protobuf-ts/plugin": "2.8.1",
"@solana/web3.js": "1.66.2",
Expand Down
9 changes: 5 additions & 4 deletions src/processors/universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ class UniversalProcessor extends BaseOrderProcessor {

let evmFulfillGasLimit: number | undefined;
let evmFulfillCappedGasPrice: BigNumber | undefined;
let preswapTx: SwapConnectorRequest['preferEstimation'] | undefined;
let preswapTx: SwapConnectorRequest['routeHint'] | undefined;
if (getEngineByChainId(this.takeChain.chain) === ChainEngine.EVM) {
// we need to perform fulfill estimation (to obtain planned gasLimit),
// but we don't know yet how much reserveAmount should we pass. So, we simply pick
Expand Down Expand Up @@ -737,6 +737,7 @@ class UniversalProcessor extends BaseOrderProcessor {
? BigInt(evmFulfillCappedGasPrice.integerValue().toString())
: undefined,
swapEstimationPreference: preswapTx,
isFeatureEnableOpHorizon: process.env.FEATURE_OP_HORIZON_CAMPAIGN === 'true',
},
);

Expand Down Expand Up @@ -935,11 +936,11 @@ class UniversalProcessor extends BaseOrderProcessor {
reserveDstToken: Uint8Array,
reservedAmount: string,
evaluatedTakeAmount: bigint,
preferEstimation: SwapConnectorRequest['preferEstimation'] | undefined,
routeHint: SwapConnectorRequest['routeHint'] | undefined,
context: OrderProcessorContext,
logger: Logger,
): Promise<{
swapResult?: SwapConnectorRequest['preferEstimation'];
swapResult?: SwapConnectorRequest['routeHint'];
transaction: Awaited<ReturnType<DlnClient['preswapAndFulfillOrder']>>;
}> {
if (buffersAreEqual(reserveDstToken, order.take.tokenAddress)) {
Expand Down Expand Up @@ -970,7 +971,7 @@ class UniversalProcessor extends BaseOrderProcessor {
slippageBps: buffersAreEqual(reserveDstToken, order.take.tokenAddress)
? 0
: this.getPreFulfillSlippage(evaluatedTakeAmount, order.take.amount),
preferEstimation,
routeHint,
fromAddress: this.takeChain.fulfillProvider.bytesAddress,
destReceiver: context.config.client.getForwarderAddress(order.take.chainId),
},
Expand Down

0 comments on commit 7232efc

Please sign in to comment.