This repository was archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 241
Merged
RFQ-T Firm Quotes #162
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
d3cfe8e
test: Stop running contract migrations
feuGeneA 05ca1b6
Add test of /swap/v0/quote endpoint
feuGeneA e026de2
Add and use RFQ-T configuration types
feuGeneA 0a0de81
yarn clean: separate docker from ts
feuGeneA 89ff735
Only run prettier on ./src
feuGeneA 61cbd5c
Include prettier in lint
feuGeneA 268bff8
yarn add --dev make-promises-safe
feuGeneA 2578a79
Adapt to new RFQ-T namespace in SwapQuoterOpts
feuGeneA 6b21a39
Adapt to new RFQ-T namespace in SwapQuoterReqOpts
feuGeneA d11b850
Revert addition of env var defs to `yarn dev`
feuGeneA b126316
Don't enforce presence of taker address
feuGeneA cbecfc4
Enforce a specific value for intentOnFilling
feuGeneA 902b15d
Remove unused apiKey parameter
feuGeneA bdc7bae
Add `rfqt:` namespace for RFQ-T specific options
feuGeneA 47227ad
Parse RFQT environment variables as CSV, not JSON
feuGeneA 0255b25
Set RFQT taker address to Forwarder for ETH sales
feuGeneA 29d6215
Restore accidentally deleted line in recent commit.
feuGeneA b0488ef
Add metadata for dummy kovan tokens
feuGeneA e50fc98
introduce new test using rfqtMocker
e150eec
HACK: fix ganache-core bug
feuGeneA 7c448d3
TEMPORARY: use gene's ganache snapshot for tests
feuGeneA 08f4d31
TEMPORARY: Update gitpkg monorepo references
feuGeneA f325f42
Enable prettier for {.,test}/**/*.{ts,tsx,json,md}
feuGeneA ea8c8e9
Add SwapQuoteRequestParam `skipValidation`
feuGeneA 0633aca
Add API Key and `intentOnFilling` to API schema
feuGeneA 556a45b
Parse present but empty intentOnFilling as true
feuGeneA e1693bb
Fix bug: env var csv split was wrongly applied
feuGeneA 11cb5a8
RFQT: More tests (#170)
bb2814a
Validate bool query params as enum, not presence
feuGeneA 74d3ea7
Add comments around using Forwarder as Taker
feuGeneA 6a0aed8
Test no quote provided when taker address absent
feuGeneA fb176a5
Revert "TEMPORARY: Update gitpkg monorepo references"
feuGeneA 2e7c7bb
Revert "TEMPORARY: use gene's ganache snapshot for tests"
feuGeneA 3ed896f
Pin updated monorepo deps to development revision
feuGeneA c772d43
Pin tests' ganache snapshot to monorepo commit
feuGeneA 735fe3e
Simplify expressions parsing boolean query params
feuGeneA bf835d0
Merge branch 'master' into rfqt
feuGeneA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ import { | |
CHAIN_ID, | ||
FEE_RECIPIENT_ADDRESS, | ||
LIQUIDITY_POOL_REGISTRY_ADDRESS, | ||
RFQT_API_KEY_WHITELIST, | ||
RFQT_MAKER_ENDPOINTS, | ||
} from '../config'; | ||
import { | ||
DEFAULT_TOKEN_DECIMALS, | ||
|
@@ -51,6 +53,8 @@ export class SwapService { | |
chainId: CHAIN_ID, | ||
expiryBufferMs: QUOTE_ORDER_EXPIRATION_BUFFER_MS, | ||
liquidityProviderRegistryAddress: LIQUIDITY_POOL_REGISTRY_ADDRESS, | ||
feuGeneA marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rfqtTakerApiKeyWhitelist: RFQT_API_KEY_WHITELIST, | ||
rfqtMakerEndpoints: RFQT_MAKER_ENDPOINTS, | ||
}; | ||
this._swapQuoter = new SwapQuoter(this._provider, orderbook, swapQuoterOpts); | ||
this._swapQuoteConsumer = new SwapQuoteConsumer(this._provider, swapQuoterOpts); | ||
|
@@ -69,13 +73,18 @@ export class SwapService { | |
from, | ||
excludedSources, | ||
affiliateAddress, | ||
apiKey, | ||
intentOnFilling, | ||
} = params; | ||
const assetSwapperOpts = { | ||
...ASSET_SWAPPER_MARKET_ORDERS_OPTS, | ||
slippagePercentage, | ||
bridgeSlippage: slippagePercentage, | ||
gasPrice: providedGasPrice, | ||
excludedSources, // TODO(dave4506): overrides the excluded sources selected by chainId | ||
apiKey, | ||
intentOnFilling, | ||
takerAddress: from, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider not conflating What happens when the Forwarder is used? the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to account for this here: 0255b25. Does that address the issue? |
||
}; | ||
if (sellAmount !== undefined) { | ||
swapQuote = await this._swapQuoter.getMarketSellSwapQuoteAsync( | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.