Skip to content

GET /fee-discount

GET https://router.intear.tech/fee-discount

Returns the fee discount of a trader who stakes TEAR, signed for the trader, to take in their own calls to Intear DEX. Routes of the aggregator come with their discount signed in already, so you only need this to swap on Intear DEX yourself.

https://router.intear.tech/fee-discount?trader_id=slimedragon.near
Parameter Type Description
trader_id account ID Required. The trader whose discount it is
key string Optional. API key, to lift the rate limit

200 OK with Content-Type: application/json:

{
"trader_id": "slimedragon.near",
"fee_discount": 250000,
"expiration_block_height": 226687665,
"signed_fee_discount": {
"discount": {
"ForTrader": {
"trader_id": "slimedragon.near",
"fee_discount": 250000,
"expiration_block_height": 226687665
}
},
"signature": "r8UZ6li9/i3bS0rb5MEmGQl5HWZePym1LU61a4dWcT+Y+1ZqEAv9+n1w98M5fNZwS93OOg4cWOacwqW/tAeUDw=="
}
}
Field Type Description
trader_id string The trader
fee_discount integer The discount, out of 1000000: 250000 is 25%
expiration_block_height integer The last block the discount can be used in, 1008000 blocks after the current one, about 7 days
signed_fee_discount object A SignedFeeDiscount of the ForTrader kind, to pass as fee_discount to swap_simple or execute_operations

Intear DEX takes a ForTrader discount only in calls that the trader makes itself, not in ft_transfer_call or deposit_near deposits. Request a new one before it expires.

Errors are plain text (text/plain):

Status Message Cause
404 <trader_id> doesn't stake enough TEAR for a fee discount The trader stakes less than 10 TEAR
400 Failed to deserialize query string: ... trader_id is missing or isn’t an account ID
502 Failed to get the TEAR stake of <trader_id>: <reason> Reading the trader’s stake failed
503 Block height is not loaded yet The aggregator couldn’t read the current block since it started

A request over the rate limit gets 429 Too Many Requests, and a wrong key 401 Unauthorized, as for /route.